File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1020,6 +1020,11 @@ then
1020
1020
err " bad LLVM version: $LLVM_VERSION , need >=3.7"
1021
1021
;;
1022
1022
esac
1023
+
1024
+ if " $CFG_LLVM_ROOT /bin/llvm-mc" -help | grep " -relocation-model" ; then
1025
+ CFG_LLVM_MC_HAS_RELOCATION_MODEL=1
1026
+ putvar CFG_LLVM_MC_HAS_RELOCATION_MODEL
1027
+ fi
1023
1028
fi
1024
1029
1025
1030
# Even when the user overrides the choice of CC, still try to detect
Original file line number Diff line number Diff line change @@ -221,12 +221,19 @@ define CFG_MAKE_TOOLCHAIN
221
221
LLVM_MC_RELOCATION_MODEL="default"
222
222
endif
223
223
224
+ # LLVM changed this flag in 3.9
225
+ ifdef CFG_LLVM_MC_HAS_RELOCATION_MODEL
226
+ LLVM_MC_RELOC_FLAG := -relocation-model=$$(LLVM_MC_RELOCATION_MODEL )
227
+ else
228
+ LLVM_MC_RELOC_FLAG := -position-independent
229
+ endif
230
+
224
231
# We're using llvm-mc as our assembler because it supports
225
232
# .cfi pseudo-ops on mac
226
233
CFG_ASSEMBLE_$(1 ) =$$(CPP_$(1 ) ) -E $$(2 ) | \
227
234
$$(LLVM_MC_$$(CFG_BUILD ) ) \
228
235
-assemble \
229
- -relocation-model= $$(LLVM_MC_RELOCATION_MODEL ) \
236
+ $$(LLVM_MC_RELOC_FLAG ) \
230
237
-filetype=obj \
231
238
-triple=$(1 ) \
232
239
-o=$$(1 )
You can’t perform that action at this time.
0 commit comments