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 \
# 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
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}}
${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}
-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})