forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 14
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
"macro 'parse_r' is already defined" when building LoongArch with full LTO #1924
Labels
[ARCH] loongarch
This bug impacts ARCH=loongarch
[FEATURE] LTO
Related to building the kernel with LLVM Link Time Optimization
[FIXED][LINUX] 6.6
This bug was fixed in Linux 6.6
Comments
intel-lab-lkp
pushed a commit
to intel-lab-lkp/linux
that referenced
this issue
Sep 5, 2023
When building with CONFIG_LTO_CLANG_FULL, there are several errors due to the way that parse_r is defined with an __asm__ statement in a header: ld.lld: error: ld-temp.o <inline asm>:105:1: macro 'parse_r' is already defined .macro parse_r var r ^ This was an issue for arch/mips as well, which was resolved by commit 67512a8 ("MIPS: Avoid macro redefinitions"). However, parse_r is unused in arch/loongarch after commit 83d8b38 ("LoongArch: Simplify the invtlb wrappers"), so doing the same change does not make much sense now. Just remove parse_r (and parse_v, which is also unused) to resolve the redefinition error. If it needs to be brought back due to an actual use, it should be brought back with the same changes as the aforementioned arch/mips commit. Closes: ClangBuiltLinux#1924 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
chenhuacai
pushed a commit
to chenhuacai/linux
that referenced
this issue
Sep 6, 2023
When building with CONFIG_LTO_CLANG_FULL, there are several errors due to the way that parse_r is defined with an __asm__ statement in a header: ld.lld: error: ld-temp.o <inline asm>:105:1: macro 'parse_r' is already defined .macro parse_r var r ^ This was an issue for arch/mips as well, which was resolved by commit 67512a8 ("MIPS: Avoid macro redefinitions"). However, parse_r is unused in arch/loongarch after commit 83d8b38 ("LoongArch: Simplify the invtlb wrappers"), so doing the same change does not make much sense now. Just remove parse_r (and parse_v, which is also unused) to resolve the redefinition error. If it needs to be brought back due to an actual use, it should be brought back with the same changes as the aforementioned arch/mips commit. Closes: ClangBuiltLinux/linux#1924 Reviewed-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This is actually fixed in 6.6-rc1: https://git.kernel.org/linus/8ff81bb24f68f747ab2f738c3d493b9c2cad52bf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[ARCH] loongarch
This bug impacts ARCH=loongarch
[FEATURE] LTO
Related to building the kernel with LLVM Link Time Optimization
[FIXED][LINUX] 6.6
This bug was fixed in Linux 6.6
When building
ARCH=loongarch
withCONFIG_LTO_CLANG_FULL=y
, the following error is repeated several times:The MIPS folks hit this as well and fixed it in commit 67512a8cf5a7 ("MIPS: Avoid macro redefinitions"), a copy of which LoongArch appears to need. I can work on this tomorrow, unless someone wants to beat me to it.
The text was updated successfully, but these errors were encountered: