mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple
Android has an unusual setup where the kernel needs to target [arch]-linux-gnu to avoid Android userspace-specific flags and optimizations, but AOSP doesn't ship a matching binutils. Add a new variable CLANG_TRIPLE which can override the "-target" triple used to compile the kernel, while using a different CROSS_COMPILE to pick the binutils/gcc installation. For Android you'd do something like: export CLANG_TRIPLE=aarch64-linux-gnu- export CROSS_COMPILE=aarch64-linux-android- If you don't need something like this, leave CLANG_TRIPLE unset and it will default to CROSS_COMPILE. Change-Id: I85d63599c6ab8ed458071cdf9197d85b1f7f150b Signed-off-by: Greg Hackmann <[email protected]> [astrachan: Added a script to check for incorrectly falling back to the default when CLANG_TRIPLE is unset] Bug: 118439987 Bug: 120440614 Test: make CLANG_TRIPLE=x86_64-linux-gnu CC=clang Signed-off-by: Alistair Strachan <[email protected]>
This commit is contained in:
parent
1f1098e0a3
commit
e145f7b103
2 changed files with 9 additions and 1 deletions
4
scripts/clang-android.sh
Executable file
4
scripts/clang-android.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
$* -dM -E - </dev/null 2>&1 | grep -q __ANDROID__ && echo "y"
|
||||
Loading…
Reference in a new issue