Skip to content

Commit

Permalink
clang: Fix native and nativesdk builds for hf targets
Browse files Browse the repository at this point in the history
Setting the ${HF} variable based on ${TUNE_CCARGS_MFLOAT} does only make sense
for target builds, as it defines arguments for target.  Without this fix,
building with hf machine configuration will cause problems, as native and
nativesdk triplets will be include "hf", something like "x86_64hf-linux", which
is wrong and not recognized by LLVM build/configuration system.

Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
(cherry picked from commit 9cea736)
  • Loading branch information
esben authored and kraj committed Jul 5, 2022
1 parent 36c4dc6 commit d669d87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion recipes-devtools/clang/clang_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86"
LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= ""
LLVM_EXPERIMENTAL_TARGETS_TO_BUILD:append = ";${@get_clang_experimental_target_arch(bb, d)}"

HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
HF = ""
HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
HF[vardepvalue] = "${HF}"

LLVM_PROJECTS ?= "clang;clang-tools-extra;lld${LLDB}"
Expand Down
3 changes: 2 additions & 1 deletion recipes-devtools/clang/compiler-rt-sanitizers_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ PACKAGECONFIG ??= ""
PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF"
PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON,,"

HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
HF = ""
HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
HF[vardepvalue] = "${HF}"

OECMAKE_TARGET_COMPILE = "compiler-rt"
Expand Down
3 changes: 2 additions & 1 deletion recipes-devtools/clang/compiler-rt_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ PACKAGECONFIG ??= ""
PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF"
PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF"

HF = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
HF = ""
HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
HF[vardepvalue] = "${HF}"

OECMAKE_TARGET_COMPILE = "compiler-rt"
Expand Down

0 comments on commit d669d87

Please sign in to comment.