Jump to content
funtoo forums
  • 0
seaofash

How to unmask clang, llvm, lldb 4 or 5?

Question

Hi,

 

I'm using Funtoo for my Unreal Engine 4 development. Since lldb use flag has been masked for 3.9.x I cannot use lldb for debugging. So, I have to do my debugging on a Windows machine using Visual Studio which is a pain since I have to use my colleagues PCs.

 

I saw these on Funtoo's system-wide profiles:

# Micha? G?rny <mgorny@gentoo.org> (28 Aug 2016)
# lldb fails to build in the current RC, and needs a lot of minor fixes.
# It's no longer available in -9999 line, and it won't be in 3.9.0
# either unless somebody steps up to fix it.
>=sys-devel/llvm-3.9.0_rc lldb

# mask release candidates of llvm:
>=dev-util/lldb-4.0.0
>=sys-devel/llvm-common-4.0.0
=sys-devel/lld-4.0.0_rc*
=sys-devel/clang-4.0.0_rc*
=sys-devel/llvm-4.0.0_rc*
>=sys-devel/llvm-4.0.0
=sys-devel/clang-runtime-4.0.0_rc*
>=sys-devel/clang-runtime-4.0.0
>=app-vim/llvm-vim-4.0.0
>=sys-devel/llvmgold-4
>=dev-libs/libclc-0.2.0_pre20170118
>=sys-libs/libcxx-4.0.0

I tried to unmask newer versions but I get the following error when I emerge:

emerge: there are no ebuilds to satisfy "app-vim/llvm-vim"

I would like to know what is the correct way to unmask newer versions of clang, llvm, and lldb.

 

In addition to that, is lldb usable on newer versions?

 

Thanks

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 1

Hello, seaofash!

You can do this to use lldb in sys-devel/llvm-3.9.1-r1:

# mkdir -p /etc/portage/profile/use.mask
# echo '-lldb' > /etc/portage/profile/use.mask/test-forum
# USE="lldb" emerge -1 =sys-devel/llvm-3.9.1-r1 or # echo '=sys-devel/llvm-3.9.1-r1 lldb' > /etc/portage/package.use/test-forum

But if you want llvm, lldb and clang in version 4, you need all this:

# mkdir -p /var/git/overlay/local/sys-devel/llvm
# cd /var/git/overlay/local/sys-devel/llvm/
# wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/llvm-4.0.1.ebuild
# ebuild llvm-4.0.1.ebuild digest
# mkdir -p /var/git/overlay/local/sys-devel/llvm-common
# cd /var/git/overlay/local/sys-devel/llvm-common/
# wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm-common/llvm-common-4.0.1.ebuild
# ebuild llvm-common-4.0.1.ebuild digest

And the file /etc/portage/package.unmask/test-forum with this:

sys-devel/clang:4
sys-devel/llvm:4
=dev-util/lldb-4.0.1
=sys-devel/llvm-common-4.0.1
=sys-devel/clang-runtime-4.0.1

 

Share this post


Link to post
Share on other sites
  • 1

This may help explain your situation: https://bugs.funtoo.org/browse/FL-3953

If possible, you may consider just using llvm-3.x in the meantime until the issues are resolved.  If you require the lldb USE flag, consider installing a version of llvm before 3.9.0_rc.  llvm-3.7.1-r3 is unmasked for me, or one could unmask one of the 3.8.x versions as well.

Obviously if llvm-4.x is a requirement for your situation, this isn't going to help, but does provide a reference indicating that the problem is known and unresolved as of yet.

Share this post


Link to post
Share on other sites
  • 1
On 28/10/2017 at 3:18 PM, seaofash said:

@cafaia Thank you so much good sir!

Thanks to you, now I have a working debugger for C++/Unreal Engine which I can use with Qt Creator as LLDB debugger front-end to debug my game. Although it did not work out of the box, I was able to build LLVM4 using your instructions with slight modifications (it was required to fetch patches in addition to the ebuild files even patches from 9999 or 5.0.0 were required for LLVM4 to build, otherwise it failed. In addition to that, mesa had a dependency on llvm use flag and the minimum working version with llvm 4 was mesa 17.0.6 in portage so I had to unmask that too).

For anyone coming across this with similar issues here's what I did:


$ nvim /etc/portage/make.conf
########
PORTDIR_OVERLAY="/var/git/overlay/local"
########

$ mkdir -p /var/git/overlay/local/profiles
$ echo "$HOSTNAME" > /var/git/overlay/local/profiles/repo_name

$ mkdir -p /var/git/overlay/local/metadata
$ nvim /var/git/overlay/local/metadata/layout.conf
########
masters = core-kit
########

$ nvim /etc/portage/package.unmask
########
# LLVM4
sys-devel/clang:4
sys-devel/llvm:4
=dev-util/lldb-4.0.1
=sys-devel/llvm-common-4.0.1
=sys-devel/clang-runtime-4.0.1
########

$ sudo nvim /etc/portage/package.keywords
########
# required by media-libs/mesa-17.0.6::x-local
# required by mesa (argument)
=x11-libs/libdrm-9999 **
########

$ mkdir -p /var/git/overlay/local/sys-devel/llvm
$ cd /var/git/overlay/local/sys-devel/llvm/
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/llvm-4.0.1.ebuild
$ mkdir -p /var/git/overlay/local/sys-devel/llvm/files/9999
$ cd /var/git/overlay/local/sys-devel/llvm/files/9999
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/files/9999/musl-fixes.patch
$ ebuild /var/git/overlay/local/sys-devel/llvm/llvm-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/sys-devel/llvm-common
$ cd /var/git/overlay/local/sys-devel/llvm-common
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm-common/llvm-common-4.0.1.ebuild
$ ebuild /var/git/overlay/local/sys-devel/llvm-common/llvm-common-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/sys-devel/clang
$ cd /var/git/overlay/local/sys-devel/clang
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/clang-4.0.1.ebuild
$ mkdir -p /var/git/overlay/local/sys-devel/clang/files/4.0.1
$ cd /var/git/overlay/local/sys-devel/clang/files/4.0.1
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
$ mkdir /var/git/overlay/local/sys-devel/clang/files/4.0.1/extra
$ cd /var/git/overlay/local/sys-devel/clang/files/4.0.1/extra
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
$ mkdir -p /var/git/overlay/local/sys-devel/clang/files/5.0.0
$ cd /var/git/overlay/local/sys-devel/clang/files/5.0.0
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
$ mkdir /var/git/overlay/local/sys-devel/clang/files/5.0.0/extra
$ cd /var/git/overlay/local/sys-devel/clang/files/5.0.0/extra
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
$ ebuild /var/git/overlay/local/sys-devel/clang/clang-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/dev-util/lldb
$ cd /var/git/overlay/local/dev-util/lldb
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-util/lldb/lldb-4.0.1.ebuild
$ mkdir -p /var/git/overlay/local/dev-util/lldb/files/4.0.1
$ cd /var/git/overlay/local/dev-util/lldb/files/4.0.1
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-util/lldb/files/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-util/lldb/files/4.0.1/0002-Fix-bug-28898.patch
$ ebuild /var/git/overlay/local/dev-util/lldb/lldb-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/media-libs/mesa
$ cd /var/git/overlay/local/media-libs/mesa
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/mesa/mesa-17.0.6.ebuild
$ mkdir -p /var/git/overlay/local/media-libs/mesa/files
$ cd /var/git/overlay/local/media-libs/mesa/files
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/mesa/files/eselect-mesa.conf.9.2
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
$ ebuild /var/git/overlay/local/media-libs/mesa/mesa-17.0.6.ebuild digest

$ emerge -avt sys-devel/llvm sys-devel/clang dev-util/lldb

Thanks again!

Hello, seaofash!

I'm happy to have helped!

We are here to help each other!

Big hug!

Share this post


Link to post
Share on other sites
  • 0

@gissf1 thank you so much for the reply.

It seems that would be a good idea. I tried to mask 3.9.x version like this (I took it from meta-repo/kits/core-kit/profiles/package.mask/funtoo-cautionary-oleg):

>=dev-util/lldb-3.9.0
>=sys-devel/llvm-common-3.9.0
=sys-devel/lld-3.9.0
>=sys-devel/clang-3.9.0
>=sys-devel/llvm-3.9.0
>=sys-devel/clang-runtime-3.9.0
>=app-vim/llvm-vim-3.9.0
>=sys-devel/llvmgold-3.9.0
>=dev-libs/libclc-0.2.0_pre20170118
>=sys-libs/libcxx-3.9.0

Unfortunately, portage pulls in the 5.0.x series like this and in the end I'll get the same error as before: emerge: there are no ebuilds to satisfy "app-vim/llvm-vim".

The following mask changes are necessary to proceed:
 (see "package.unmask" in the portage(5) man page for more details)
# required by lldb (argument)
# /etc/portage/package.mask:
=dev-util/lldb-5.0.0

That is really weird. I would appreciate it if you'd share the proper way to mask llvm, clang and lldb.

Share this post


Link to post
Share on other sites
  • 0

@cafaia Thank you so much good sir!

Thanks to you, now I have a working debugger for C++/Unreal Engine which I can use with Qt Creator as LLDB debugger front-end to debug my game. Although it did not work out of the box, I was able to build LLVM4 using your instructions with slight modifications (it was required to fetch patches in addition to the ebuild files even patches from 9999 or 5.0.0 were required for LLVM4 to build, otherwise it failed. In addition to that, mesa had a dependency on llvm use flag and the minimum working version with llvm 4 was mesa 17.0.6 in portage so I had to unmask that too).

For anyone coming across this with similar issues here's what I did:

$ nvim /etc/portage/make.conf
########
PORTDIR_OVERLAY="/var/git/overlay/local"
########

$ mkdir -p /var/git/overlay/local/profiles
$ echo "$HOSTNAME" > /var/git/overlay/local/profiles/repo_name

$ mkdir -p /var/git/overlay/local/metadata
$ nvim /var/git/overlay/local/metadata/layout.conf
########
masters = core-kit
########

$ nvim /etc/portage/package.unmask
########
# LLVM4
sys-devel/clang:4
sys-devel/llvm:4
=dev-util/lldb-4.0.1
=sys-devel/llvm-common-4.0.1
=sys-devel/clang-runtime-4.0.1
########

$ sudo nvim /etc/portage/package.keywords
########
# required by media-libs/mesa-17.0.6::x-local
# required by mesa (argument)
=x11-libs/libdrm-9999 **
########

$ mkdir -p /var/git/overlay/local/sys-devel/llvm
$ cd /var/git/overlay/local/sys-devel/llvm/
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/llvm-4.0.1.ebuild
$ mkdir -p /var/git/overlay/local/sys-devel/llvm/files/9999
$ cd /var/git/overlay/local/sys-devel/llvm/files/9999
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm/files/9999/musl-fixes.patch
$ ebuild /var/git/overlay/local/sys-devel/llvm/llvm-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/sys-devel/llvm-common
$ cd /var/git/overlay/local/sys-devel/llvm-common
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/llvm-common/llvm-common-4.0.1.ebuild
$ ebuild /var/git/overlay/local/sys-devel/llvm-common/llvm-common-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/sys-devel/clang
$ cd /var/git/overlay/local/sys-devel/clang
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/clang-4.0.1.ebuild
$ mkdir -p /var/git/overlay/local/sys-devel/clang/files/4.0.1
$ cd /var/git/overlay/local/sys-devel/clang/files/4.0.1
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
$ mkdir /var/git/overlay/local/sys-devel/clang/files/4.0.1/extra
$ cd /var/git/overlay/local/sys-devel/clang/files/4.0.1/extra
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
$ mkdir -p /var/git/overlay/local/sys-devel/clang/files/5.0.0
$ cd /var/git/overlay/local/sys-devel/clang/files/5.0.0
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
$ mkdir /var/git/overlay/local/sys-devel/clang/files/5.0.0/extra
$ cd /var/git/overlay/local/sys-devel/clang/files/5.0.0/extra
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
$ ebuild /var/git/overlay/local/sys-devel/clang/clang-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/dev-util/lldb
$ cd /var/git/overlay/local/dev-util/lldb
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-util/lldb/lldb-4.0.1.ebuild
$ mkdir -p /var/git/overlay/local/dev-util/lldb/files/4.0.1
$ cd /var/git/overlay/local/dev-util/lldb/files/4.0.1
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-util/lldb/files/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-util/lldb/files/4.0.1/0002-Fix-bug-28898.patch
$ ebuild /var/git/overlay/local/dev-util/lldb/lldb-4.0.1.ebuild digest

$ mkdir -p /var/git/overlay/local/media-libs/mesa
$ cd /var/git/overlay/local/media-libs/mesa
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/mesa/mesa-17.0.6.ebuild
$ mkdir -p /var/git/overlay/local/media-libs/mesa/files
$ cd /var/git/overlay/local/media-libs/mesa/files
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/mesa/files/eselect-mesa.conf.9.2
$ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
$ ebuild /var/git/overlay/local/media-libs/mesa/mesa-17.0.6.ebuild digest

$ emerge -avt sys-devel/llvm sys-devel/clang dev-util/lldb

Thanks again!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...