Skip to content
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

Unable to build LLDB on Amazon Linux 2 ARM64 #52823

Open
DoDoENT opened this issue Dec 21, 2021 · 4 comments
Open

Unable to build LLDB on Amazon Linux 2 ARM64 #52823

DoDoENT opened this issue Dec 21, 2021 · 4 comments

Comments

@DoDoENT
Copy link
Contributor

DoDoENT commented Dec 21, 2021

I'm trying to build full LLVM 13 toolchain within Amazon Linux 2 ARM64 docker and compilation of LLDB fails with:

/home/build/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:63:28: error: variable has incomplete type 'struct user_sve_header'
    struct user_sve_header sve_header;
                           ^
/home/build/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:63:12: note: forward declaration of 'user_sve_header'
    struct user_sve_header sve_header;
           ^
/home/build/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:376:13: error: use of undeclared identifier 'sve_vl_valid'
        if (sve_vl_valid(vg_value * 8)) {
            ^
/home/build/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:562:10: error: use of undeclared identifier 'sve_vl_valid'
    if (!sve_vl_valid(m_sve_header.vl)) {
         ^
/home/build/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:930:11: error: use of undeclared identifier 'sve_vl_valid'
      if (sve_vl_valid(m_sve_header.vl))
          ^
4 errors generated.

I've discovered that a similar issue has been also discovered in spack and the underlying problem is that Amazon Linux 2 is running on Kernel 4.14 which does not provide user_sve_header that has been added to kernel 4.15.

The main question is why does LLDB need a kernel with SVE support on non-SVE CPU? Should we add support for building the LLDB without SVE support?

@DoDoENT DoDoENT changed the title Unable to build LLDB on Amazon Linux 2 Unable to build LLDB on Amazon Linux 2 AARCH64 Dec 21, 2021
@DoDoENT DoDoENT changed the title Unable to build LLDB on Amazon Linux 2 AARCH64 Unable to build LLDB on Amazon Linux 2 ARM64 Dec 21, 2021
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 15, 2022

@llvm/issue-subscribers-lldb

@DavidSpickett
Copy link
Collaborator

@omjavaid

@omjavaid
Copy link
Contributor

LLDB build does not require kernel support for SVE but requires header to be present in your toolchain sysroot path. You may use a fairly recent arm toolchain like for example https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz
It contains an updated ptrace.h containing user_sve_header definitions at libc/usr/include/asm/ptrace.h

@EugeneZelenko
Copy link
Contributor

I think will be reasonable to check availability of user_sve_header definitions at CMake configuration time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants