-
Notifications
You must be signed in to change notification settings - Fork 15
Clang picks wrong linker/assembler #78
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
Comments
Passing
Alternatively, in both cases symlinking clang into the cross compiler directory helps. Clang than also claims its install directory is the cross compilers directory.
I guess this is an expected behavior of Clang? Should/can we let the Linux build system pass a reasonable search dir? |
This seems to do the trick:
Does that seem sensible? Hope this breaks no other use cases... |
Let me speak with @stephenhines in person. I wonder if your install of Clang is configured to only support x86_64, so it always picks the wrong target toolchain? |
Speaking more with @stephenhines and @pirama-arumuga-nainar , it sounds like I would recommend against the patch in #78 (comment), since it sounds like you may have your cross tools in a non standard search path. That said, I still think Clang should obey |
Building with ARM64 with
|
Well yes, I do have my cross compiler toolchain in a non standard path. That is why I have to add it to the |
As mentioned above, this cross-compiler doesn't seem to have been set up with a known sysroot for ARM tools. Thus it is falling back to /usr/bin/as, which isn't useful. The easiest solution is to pass -B with the path to your cross-compiler tools. |
With this cross-compiler you refer to Clang/LLVM? So the Clang/LLVM I am using is a stock build from Ubuntu or ArchLinux. Of course this has not been built with a known sysroot for an ARM toolchain... |
FWIW, this is how I can reproduce it on a vanilla Ubuntu 18.04:
We are at a point where developers can use LLVM/Clang to build Linux without the need of building LLVM/Clang from scratch. We should support that as far as possible. |
Wouldn't Ubuntu/Debian devs install via: So your example, you're still installing your cross toolchain to a non standard dir. If Clang doesn't respect |
The diff in #78 (comment) works for me. You can add my reviewed by tag to send it upstream. Might want to change I also think clang should respect |
@nickdesaulniers hm, I guess that is true, using Clang from distro and gcc from Linaro might actually be a rather unusual case. It still seems a valid use case to me. Ok, thanks, will send a patch upstream. I will use |
Can you share the patch before sending it? I don't understand what you mean. @stephenhines has convinced me that maybe Clang should not check |
oh, nvm I understand. |
Sorry, wasn't very clear above. For the records, I meant replacing Will send a patch upstream. |
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux#78 Signed-off-by: Stefan Agner <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
(commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream) When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [ND: adjusted to context, due to adjusting the context of my previous backport of upstream's ae6b289a3789] Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ia5683ef2a9def6122219bb38d834ad45e2d204c2 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
(commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream) When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [ND: adjusted to context, due to adjusting the context of my previous backport of upstream's ae6b289a3789] Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Conflicts: Makefile
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ia5683ef2a9def6122219bb38d834ad45e2d204c2 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
(commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream) When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [ND: adjusted to context, due to adjusting the context of my previous backport of upstream's ae6b289a3789] Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Conflicts: Makefile
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: เจียน <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: เจียน <[email protected]>
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Change-Id: I3bc0f10512f7f932a43a9cdf55579e4fec3da230
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Robin <[email protected]> Change-Id: I3bc0f10512f7f932a43a9cdf55579e4fec3da230
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Change-Id: Ib14e7ee036d8ade5d1121c912df8ced66afca0c7 Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Link: https://git.kernel.org/linus/ef8c4ed9db80261f397f0c0bf723684601ae3b52 Signed-off-by: Nathan Chancellor <[email protected]>
When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: ClangBuiltLinux/linux#78 Signed-off-by: Stefan Agner <[email protected]> Reviewed-and-tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [nc: Adjust context] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
When using the a system installation of Clang (e.g. with Ubuntu 18.04 or Arch Linux), and a cross compiler toolchain from Linaro, building fails with the following errors:
A similar issue can also be observed with arm64:
In both cases Clang chooses the wrong version of external utilities. In the arm32 case its the wrong linker which seems to cause problems first, in the arm64 case the assembler (using
-v
reveals/usr/bin/ld
and/usr/bin/as
instead of the assembler/linker provided by the cross compiler).The text was updated successfully, but these errors were encountered: