-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to build llvm libc 14.0.5 on Oracle Ampere A1 Arm with GCC 8.5.0 #60473
Comments
What is your host compiler, and which version is it? E.g. what does the CMake stage print when it detects |
@llvm/issue-subscribers-libc |
@llvm/issue-subscribers-backend-arm |
Hi, the host compiler GNU C++, of version 8.5.0, the print info at CMake stage is below -- The C compiler identification is GNU 8.5.0
-- The CXX compiler identification is GNU 8.5.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done Thanks! |
The minimum version of gcc required for building the libc is 12.2. Also, I do no think anyone has actually done an arm64 host build of the libc. We have a CI builder for x86_64 which builds using gcc-12.2: https://lab.llvm.org/buildbot/#/builders/250 |
Seems like the function is present for C but not C++ when using gcc https://godbolt.org/z/Gjr1bfWx3. |
Yes, thanks for it! and seems the function works well with C++ when using clang https://godbolt.org/z/cG8GsEMs3 |
There are two AArch64 bots that I presume compile this code, https://lab.llvm.org/buildbot/#/builders/138, https://lab.llvm.org/buildbot/#/builders/223. However they both use clang. I will see what's going on with gcc/g++ and at least raise a bug for it. |
Filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108642. As far as I can tell it's always worked for clang and I'm a but surprised your initial cmake command wasn't using the newly built clang to build libc, because it looks a lot like https://libcxx.llvm.org/BuildingLibcxx.html#bootstrapping-build. Either way, if you've got a clang that works that's the important thing. |
There is a slim chance we could work around this or at least document a required version of g++. Might be worth waiting for the gcc bug to be triaged before closing this. |
@Tomcruseal included |
A correction to my previous comment: It would be the suggested way after https://reviews.llvm.org/D141460 lands. |
@DavidSpickett Thanks! I will have a look at Bootstrapping build, it is quite new to me. |
@sivachandra Thanks for the link! |
Fix the full build with gcc: https://reviews.llvm.org/D143261 I also found that the overlay mode has been broken with gcc on any platform for a while. In case you were trying to use that too. Stick with clang if you can. |
@llvm/issue-subscribers-backend-aarch64 |
For the overlay build see #60481. |
The libc uses some functions that GCC does not currently implement, that come from Arm's ACLE header usually. These are: ``` __arm_wsr64 __arm_rsr64 __arm_wsr __arm_rsr ``` This issue was reported to us (#60473) and I've then reported that back to GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108642). Even if these functions are added, clang has some non standard extensions to them that gcc may not take. So we're looking at a fix in gcc 13 at best, and that may not be enough for what we're doing with them. So I've added ifdefs to use alternatives with gcc. For handling the stack pointer, inline assembly is unfortunately the only option. I have verified that the single mov is essentially what __arm_rsr64 generates. For fpsr and fpcr the gcc devs suggested using https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/AArch64-Built-in-Functions.html#AArch64-Built-in-Functions. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D143261
The fix is on @Tomcruseal unless you're looking to build some kind of release off of this, are you happy to use the libc from the |
The libc uses some functions that GCC does not currently implement, that come from Arm's ACLE header usually. These are: ``` __arm_wsr64 __arm_rsr64 __arm_wsr __arm_rsr ``` This issue was reported to us (llvm/llvm-project#60473) and I've then reported that back to GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108642). Even if these functions are added, clang has some non standard extensions to them that gcc may not take. So we're looking at a fix in gcc 13 at best, and that may not be enough for what we're doing with them. So I've added ifdefs to use alternatives with gcc. For handling the stack pointer, inline assembly is unfortunately the only option. I have verified that the single mov is essentially what __arm_rsr64 generates. For fpsr and fpcr the gcc devs suggested using https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/AArch64-Built-in-Functions.html#AArch64-Built-in-Functions. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D143261
Hi @DavidSpickett thanks for it! Yes, I will use the libc from the |
Great, then I will close this. |
The libc uses some functions that GCC does not currently implement, that come from Arm's ACLE header usually. These are: ``` __arm_wsr64 __arm_rsr64 __arm_wsr __arm_rsr ``` This issue was reported to us (llvm/llvm-project#60473) and I've then reported that back to GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108642). Even if these functions are added, clang has some non standard extensions to them that gcc may not take. So we're looking at a fix in gcc 13 at best, and that may not be enough for what we're doing with them. So I've added ifdefs to use alternatives with gcc. For handling the stack pointer, inline assembly is unfortunately the only option. I have verified that the single mov is essentially what __arm_rsr64 generates. For fpsr and fpcr the gcc devs suggested using https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/AArch64-Built-in-Functions.html#AArch64-Built-in-Functions. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D143261
Hi there,
I was trying to build LLVM 14.0.5 and all the subprojects from source on Oracle Ampere A1 Arm. The OS is Oracle Linux arm-server-beta-2022 5.4.17-2102.204.4.4.el8uek.aarch64 with 4 cores 24GB ram.
My cmake configure was
CMake went well, but it crashed at Make. The error information is shown below,
Could you please give some suggestions? Many thanks
The text was updated successfully, but these errors were encountered: