Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[SOLVED] sys-devel/llvm Update Fails to Emerge on Gentoo on…

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

[SOLVED] sys-devel/llvm Update Fails to Emerge on Gentoo on…

  • Quote

Post by RandomDSdevel » Thu May 05, 2022 10:31 pm

(Note: This thread's old, full title was 'sys-devel/llvm Update Fails to Emerge on Gentoo on WSL2,' but it wouldn't fit when I marked it as solved by editing that.)

`sys-devel/llvm` keeps failing to to build for me on the Gentoo instance I have running on/under Windows Subsystem for Linux v2 with an error saying that it can't find (most of) the host compiler's built-in or library support for C++ atomics:

Code: Select all

-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - found
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Failed
CMake Error at cmake/modules/CheckAtomic.cmake:56 (message):
  Host compiler must support std::atomic!
Call Stack (most recent call first):
  cmake/config-ix.cmake:374 (include)
  CMakeLists.txt:684 (include)


-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64/CMakeFiles/CMakeOutput.log".
See also "/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64/CMakeFiles/CMakeError.log".
 ERROR: sys-devel/llvm-13.0.1::gentoo failed (configure phase):
   cmake failed

 Call stack:
     ebuild.sh, line  127:  Called src_configure
   environment, line 3872:  Called multilib-minimal_src_configure
   environment, line 2701:  Called multilib_foreach_abi 'multilib-minimal_abi_src_configure'
   environment, line  588:  Called multilib-minimal_abi_src_configure
   environment, line 2695:  Called multilib_src_configure
   environment, line 3207:  Called cmake_src_configure
   environment, line 1552:  Called die
 The specific snippet of code:
       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";

 If you need support, post the output of `emerge --info '=sys-devel/llvm-13.0.1::gentoo'`,
 the complete build log and the output of `emerge -pqv '=sys-devel/llvm-13.0.1::gentoo'`.
 The complete build log is located at '/var/tmp/portage/sys-devel/llvm-13.0.1/temp/build.log'.
 The ebuild environment file is located at '/var/tmp/portage/sys-devel/llvm-13.0.1/temp/environment'.
 Working directory: '/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64'
 S: '/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm'
My full build logs and environment information are here in this GitHub repository

(Note: I'm going to see if the test program CMake used for that test compiles locally outside of any build attempt and report back on that.)
Last edited by RandomDSdevel on Sat May 14, 2022 2:35 am, edited 1 time in total.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

Re: sys-devel/llvm Update Fails to Emerge on Gentoo on WSL2

  • Quote

Post by GDH-gentoo » Fri May 06, 2022 7:39 pm

RandomDSdevel wrote:

Code: Select all

-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64/CMakeFiles/CMakeOutput.log".
See also "/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64/CMakeFiles/CMakeError.log".
These files should have more information about how CMake's tests failed, but it seems that you haven't shared them.
Top
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

Re: sys-devel/llvm Update Fails to Emerge on Gentoo on WSL2

  • Quote

Post by RandomDSdevel » Tue May 10, 2022 12:42 am

GDH-gentoo wrote:
RandomDSdevel wrote:

Code: Select all

-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64/CMakeFiles/CMakeOutput.log".
See also "/var/tmp/portage/sys-devel/llvm-13.0.1/work/llvm-13.0.1_build-abi_x86_64.amd64/CMakeFiles/CMakeError.log".
These files should have more information about how CMake's tests failed, but it seems that you haven't shared them.
Sorry, forgot about those; I've now added them to the GitHub logs repository I linked to before.
Top
Phoenix591
Guru
Guru
Posts: 504
Joined: Mon Sep 17, 2007 3:52 am

  • Quote

Post by Phoenix591 » Tue May 10, 2022 1:33 am

Code: Select all

ld.lld: error: Invalid value (Producer: 'LLVM13.0.0' Reader: 'LLVM 12.0.1'
it looks like lld (which you still have at version 12) is not happy with clang/llvm-13 lto output.
Top
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

  • Quote

Post by RandomDSdevel » Tue May 10, 2022 2:31 am

Phoenix591 wrote:

Code: Select all

ld.lld: error: Invalid value (Producer: 'LLVM13.0.0' Reader: 'LLVM 12.0.1'
it looks like lld (which you still have at version 12) is not happy with clang/llvm-13 lto output.
Ah, that'd explain that output. I was trying to upgrade everything LLVM-/Clang-related together, but I can try doing `lld` (and LLVM itself if that needs it) first, I guess? (Edit: Never mind; these look like they do all have to be upgraded together; `emerge` gives me errors if I try to upgrade just `lld`, just LLVM, or just LLVM and `lld`.) (Edit 2: No, wait; that's what I tried in the first place and didn't work; I get the same error. I have two ideas I can try next:
  1. Building LLVM with GCC, then building LLD with that.
  2. Making a copy of my WSL2 Gentoo instance and completely uninstalling the entire LLVM/Clang toolchain from scratch following the wiki instructions again in said copy.)
Top
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

  • Quote

Post by RandomDSdevel » Tue May 10, 2022 12:57 pm

For reference, here's what `emerge` and `equery` say about the state my Gentoo instance is currently in before I try anything else; it might be a bit weird:

Code: Select all

… # emerge --pretend --verbose --update --newuse --with-bdeps=y sys-devel/llvm sys-devel/lld sys-devel/clang sys-libs/compiler-rt sys-libs/compiler-rt-sanitizers sys-devel/clang-runtime

These are the packages that would be merged, in order:  

Calculating dependencies... done!  
[ebuild     U  ] sys-devel/llvm-13.0.1:13::gentoo [13.0.0:13::gentoo] USE="binutils-plugin%* libffi ncurses xml -debug -doc -exegesis -libedit -test -xar -z3 (-gold%*)" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="(AArch64*) (AMDGPU) (ARM*) (AVR*) (BPF) (Hexagon*) (Lanai*) (MSP430*) (Mips*) (NVPTX) (PowerPC*) (RISCV*) (Sparc*) (SystemZ*) (WebAssembly*) (X86) (XCore*) (-ARC) (-CSKY) (-M68k) (-VE)" 0 KiB
[ebuild     U  ] sys-devel/lld-13.0.1::gentoo [12.0.1::gentoo] USE="-debug% -test" 0 KiB
[ebuild     U  ] sys-devel/clang-13.0.1:13::gentoo [13.0.0:13::gentoo] USE="default-lld llvm-libunwind static-analyzer xml -debug -default-compiler-rt -default-libcxx -doc -test" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="(AArch64*) (AMDGPU) (ARM*) (AVR*) (BPF) (Hexagon*) (Lanai*) (MSP430*) (Mips*) (NVPTX) (PowerPC*) (RISCV*) (Sparc*) (SystemZ*) (WebAssembly*) (X86) (XCore*) (-ARC) (-CSKY) (-M68k) (-VE)" PYTHON_SINGLE_TARGET="python3_9 -python3_8 -python3_10" 0 KiB
[ebuild  NS    ] sys-libs/compiler-rt-13.0.1:13.0.1::gentoo [13.0.0:13.0.0::gentoo] USE="clang -debug -test" ABI_X86="32%* (64%*)" 0 KiB
[ebuild  NS    ] sys-libs/compiler-rt-sanitizers-13.0.1:13.0.1::gentoo [13.0.0:13.0.0::gentoo] USE="asan cfi clang dfsan gwp-asan hwasan libfuzzer lsan memprof msan orc profile safestack scudo tsan ubsan xray -debug (-shadowcallstack) -test" ABI_X86="32%* (64%*)" 0 KiB
[ebuild  NS    ] sys-devel/clang-runtime-13.0.1:13.0.1::gentoo [13.0.0:13.0.0::gentoo] USE="compiler-rt openmp sanitize -libcxx" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 6 packages (3 upgrades, 3 in new slots), Size of downloads: 0 KiB

Code: Select all

… # equery list sys-devel/llvm sys-devel/lld sys-devel/clang sys-libs/compiler-rt sys-libs/compiler-rt-sanitizers sys-devel/clang-runtime
 * Searching for llvm in sys-devel ...
[IP-] [  ] sys-devel/llvm-12.0.1:12
[I--] [??] sys-devel/llvm-13.0.0:13

* Searching for lld in sys-devel ...
[IP-] [  ] sys-devel/lld-12.0.1:0

 * Searching for clang in sys-devel ...
[I--] [??] sys-devel/clang-13.0.0:13

 * Searching for compiler-rt in sys-libs ...
[I--] [??] sys-libs/compiler-rt-13.0.0:13.0.0

 * Searching for compiler-rt-sanitizers in sys-libs ...
[I--] [??] sys-libs/compiler-rt-sanitizers-13.0.0:13.0.0

 * Searching for clang-runtime in sys-devel ...
[I--] [??] sys-devel/clang-runtime-13.0.0:13.0.0
Top
Phoenix591
Guru
Guru
Posts: 504
Joined: Mon Sep 17, 2007 3:52 am

  • Quote

Post by Phoenix591 » Tue May 10, 2022 8:43 pm

I would just try dropping lto temporarily until you get lld updated.
Top
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

  • Quote

Post by RandomDSdevel » Fri May 13, 2022 8:14 pm

Phoenix591 wrote:I would just try dropping lto temporarily until you get lld updated.
Yeah, that's another thing I could/should try.
Top
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

  • Quote

Post by RandomDSdevel » Fri May 13, 2022 11:21 pm

RandomDSdevel wrote: (Snipped…)
  1. Building LLVM with GCC, then building LLD with that.
I tested this in a new copy of my existing WSL2 Gentoo instance, and it worked. Let's check to see if compiling with LLVM/Clang without LTO works before falling back to using GCC in my main instance first, though. (It naturally sounds like that should do the trick, so I suppose I'd be surprised if it wouldn't.)
Top
Phoenix591
Guru
Guru
Posts: 504
Joined: Mon Sep 17, 2007 3:52 am

  • Quote

Post by Phoenix591 » Sat May 14, 2022 1:04 am

the reason lto is causing issues is that when used the compiler does not create normal object files (the bits that get linked together to create the final program/library) but instead writes an intermediate representation that has extra info needed to optimize at link time.

So you have clang speaking llvm 13's intermediate representation when your old lld only understands llvm 12.
Top
RandomDSdevel
n00b
n00b
Posts: 46
Joined: Mon Feb 28, 2022 11:11 pm
Location: Kokomo, IN, USA

  • Quote

Post by RandomDSdevel » Sat May 14, 2022 2:33 am

Building without `lld` worked and also resolved my other issue. Thanks for the help, everyone.
Top
Post Reply

11 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic