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
10201020 err " bad LLVM version: $LLVM_VERSION , need >=3.7"
10211021 ;;
10221022 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
10231028fi
10241029
10251030# 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
221221 LLVM_MC_RELOCATION_MODEL="default"
222222 endif
223223
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+
224231 # We're using llvm-mc as our assembler because it supports
225232 # .cfi pseudo-ops on mac
226233 CFG_ASSEMBLE_$(1 ) =$$(CPP_$(1 ) ) -E $$(2 ) | \
227234 $$(LLVM_MC_$$(CFG_BUILD ) ) \
228235 -assemble \
229- -relocation-model= $$(LLVM_MC_RELOCATION_MODEL ) \
236+ $$(LLVM_MC_RELOC_FLAG ) \
230237 -filetype=obj \
231238 -triple=$(1 ) \
232239 -o=$$(1 )
You can’t perform that action at this time.
0 commit comments