llvm: Split BITCODE_LD_FLAGS

Split across the two linking steps for instrumentation purposes.
This commit is contained in:
Cristiano Giuffrida 2014-06-17 13:47:07 +02:00 committed by Lionel Sambuc
parent 79f9fd0612
commit 9f6977d22d
3 changed files with 9 additions and 6 deletions

View file

@ -126,7 +126,7 @@ do
clean_module $n $m "relink"
if [ "${STATIC_LIBS}"!="" ]; then
STATIC_LIBS=`echo ${STATIC_LIBS} | sed -e "s/\ /\\\ /g"`
LDFLAGS_PLACEHOLDER="BITCODE_LD_FLAGS.$n=${STATIC_LIBS}"
LDFLAGS_PLACEHOLDER="BITCODE_LD_FLAGS_1ST.$n=${STATIC_LIBS}"
fi
env "`echo ${LDFLAGS_PLACEHOLDER}`" MKBITCODE=yes \

View file

@ -74,11 +74,13 @@ OPTFLAGS?= -disable-opt \
# Whitout -Wl,--no-ctors-in-init-array, golds moves the constructors out of
# .ctors into .init_array, which is bad on intel.
BITCODE_LD_FLAGS?= \
BITCODE_LD_FLAGS_1ST?= \
-Wl,--no-ctors-in-init-array \
-Wl,-plugin=${GOLD_PLUGIN} \
-Wl,-plugin-opt=-disable-opt \
-Wl,-plugin-opt=-disable-inlining \
-Wl,-plugin-opt=-disable-inlining
BITCODE_LD_FLAGS_2ND?=${BITCODE_LD_FLAGS_1ST}
.ifdef CONFIG_SMP
SMP_FLAGS += -DCONFIG_SMP

View file

@ -580,7 +580,8 @@ ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
CLEANFILES+= ${_P}.opt.bcl ${_P}.bcl ${_P}.bcl.o
OPTFLAGS.${_P}?= ${OPTFLAGS}
BITCODE_LD_FLAGS.${_P}+= ${BITCODE_LD_FLAGS}
BITCODE_LD_FLAGS_1ST.${_P}+= ${BITCODE_LD_FLAGS_1ST}
BITCODE_LD_FLAGS_2ND.${_P}+= ${BITCODE_LD_FLAGS_2ND}
${_P}.bcl: .gdbinit ${LIBCRT0} ${LIBCRTI} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} \
${LIBCRTEND} ${_DPADD.${_P}}
@ -592,7 +593,7 @@ ${_P}.bcl: .gdbinit ${LIBCRT0} ${LIBCRTI} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} \
${OBJS.${_P}} ${LLVM_LINK_ARGS} ${_LDADD.${_P}:N-shared} \
${_LDSTATIC.${_P}} ${_PROGLDOPTS} \
-Wl,-r \
${BITCODE_LD_FLAGS.${_P}} \
${BITCODE_LD_FLAGS_1ST.${_P}} \
-Wl,-plugin-opt=emit-llvm
${_P}.opt.bcl: ${_P}.bcl ${LLVM_PASS}
@ -611,7 +612,7 @@ ${_P}: ${_P}.bcl.o
-L${DESTDIR}/usr/lib \
${_LDSTATIC.${_P}} -o ${.TARGET} \
${.TARGET}.bcl.o ${_PROGLDOPTS} ${_LDADD.${_P}} \
${BITCODE_LD_FLAGS.${_P}} \
${BITCODE_LD_FLAGS_2ND.${_P}} \
-Wl,--allow-multiple-definition
.endif # !commands(${_P})