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

error: register 'sp' unsuitable for global register variables on this target #1857

Closed
nickdesaulniers opened this issue May 30, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@nickdesaulniers
Copy link
Member

nickdesaulniers commented May 30, 2023

on linux-next with ToT LLVM, after hitting #1855 then #1856, I then hit:

$ ARCH=arm make LLVM=1 -j128 KBUILD_CFLAGS="-Wno-builtin-macro-redefined -Wno-incompatible-library-redeclaration"
...
  UPD     include/generated/timeconst.h
In file included from kernel/bounds.c:13:
In file included from ./include/linux/log2.h:12:
In file included from ./include/linux/bitops.h:68:
In file included from ./arch/arm/include/asm/bitops.h:28:
In file included from ./include/linux/irqflags.h:17:
./arch/arm/include/asm/percpu.h:10:51: error: register 'sp' unsuitable for global register variables on this target
register unsigned long current_stack_pointer asm ("sp");
                                                  ^

I don't see a Makefile rule for kernel/bounds.o; I wonder if it get's consumed to produce include/generated/timeconst.h perhaps? And perhaps the header isn't being built with CLANG_FLAGS such as --target (or is assuming x86_64 host rather than arm target)?

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented May 30, 2023

Strange https://reviews.llvm.org/D151741 does indeed avoid this error...closing as dup of #1857.

@nickdesaulniers nickdesaulniers added duplicate This issue or pull request already exists and removed [BUG] Untriaged Something isn't working labels May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant