[LLVM-3.9] Pass correct relocation model flag
This commit is contained in:
parent
2c92756dde
commit
dc7076b52e
2 changed files with 13 additions and 1 deletions
5
configure
vendored
5
configure
vendored
|
@ -1020,6 +1020,11 @@ then
|
||||||
err "bad LLVM version: $LLVM_VERSION, need >=3.7"
|
err "bad LLVM version: $LLVM_VERSION, need >=3.7"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if "$CFG_LLVM_ROOT/bin/llvm-mc" -help | grep "-relocation-model"; then
|
||||||
|
CFG_LLVM_MC_HAS_RELOCATION_MODEL=1
|
||||||
|
putvar CFG_LLVM_MC_HAS_RELOCATION_MODEL
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Even when the user overrides the choice of CC, still try to detect
|
# Even when the user overrides the choice of CC, still try to detect
|
||||||
|
|
|
@ -221,12 +221,19 @@ define CFG_MAKE_TOOLCHAIN
|
||||||
LLVM_MC_RELOCATION_MODEL="default"
|
LLVM_MC_RELOCATION_MODEL="default"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# LLVM changed this flag in 3.9
|
||||||
|
ifdef CFG_LLVM_MC_HAS_RELOCATION_MODEL
|
||||||
|
LLVM_MC_RELOC_FLAG := -relocation-model=$$(LLVM_MC_RELOCATION_MODEL)
|
||||||
|
else
|
||||||
|
LLVM_MC_RELOC_FLAG := -position-independent
|
||||||
|
endif
|
||||||
|
|
||||||
# We're using llvm-mc as our assembler because it supports
|
# We're using llvm-mc as our assembler because it supports
|
||||||
# .cfi pseudo-ops on mac
|
# .cfi pseudo-ops on mac
|
||||||
CFG_ASSEMBLE_$(1)=$$(CPP_$(1)) -E $$(2) | \
|
CFG_ASSEMBLE_$(1)=$$(CPP_$(1)) -E $$(2) | \
|
||||||
$$(LLVM_MC_$$(CFG_BUILD)) \
|
$$(LLVM_MC_$$(CFG_BUILD)) \
|
||||||
-assemble \
|
-assemble \
|
||||||
-relocation-model=$$(LLVM_MC_RELOCATION_MODEL) \
|
$$(LLVM_MC_RELOC_FLAG) \
|
||||||
-filetype=obj \
|
-filetype=obj \
|
||||||
-triple=$(1) \
|
-triple=$(1) \
|
||||||
-o=$$(1)
|
-o=$$(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue