]> Zhao Yanbai Git Server - minix.git/commitdiff
llvm: Split BITCODE_LD_FLAGS
authorCristiano Giuffrida <giuffrida@cs.vu.nl>
Tue, 17 Jun 2014 11:47:07 +0000 (13:47 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:06:06 +0000 (17:06 +0200)
Split across the two linking steps for instrumentation purposes.

minix/llvm/relink.llvm
share/mk/bsd.own.mk
share/mk/bsd.prog.mk

index 060c9941d7f573c033a34fa539ce7c93cb6f5474..3ccf919e0e7c4a18aae86d70d69a7e6fba5d2212 100755 (executable)
@@ -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 \
index 4de947a63625c8bb70dc088c88c6c2dd3c1201eb..92e8cb0daedd602d146c284842fc6239a065121a 100644 (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
index 3707931372291a57845f5220df1bbf099a9a68dc..3c50ff59822d919c3b56e5c12724554624b17cb7 100644 (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})