buildworld: Really support static toolchain.
authorzrj <rimvydas.jasinskas@gmail.com>
Sat, 11 Nov 2017 10:37:39 +0000 (12:37 +0200)
committerzrj <zrj@dragonflybsd.org>
Sat, 11 Nov 2017 12:53:17 +0000 (14:53 +0200)
Not to be used for day-to-day stuff, testing and experimenting feature only.
This includes the cross-tools and would come very helpful when we will make
a switch for /libexec/ld-elf.so runtime linker.

16 files changed:
gnu/usr.bin/binutils225/block2/ar/Makefile
gnu/usr.bin/binutils225/block2/ld/Makefile
gnu/usr.bin/binutils225/block2/nm/Makefile
gnu/usr.bin/binutils225/block2/ranlib/Makefile
gnu/usr.bin/binutils225/block3/gold-linker/Makefile
gnu/usr.bin/binutils227/block2/ar/Makefile
gnu/usr.bin/binutils227/block2/ld/Makefile
gnu/usr.bin/binutils227/block2/nm/Makefile
gnu/usr.bin/binutils227/block2/ranlib/Makefile
gnu/usr.bin/binutils227/block3/gold-linker/Makefile
gnu/usr.bin/cc47/Makefile
gnu/usr.bin/cc47/cc_prep/Makefile
gnu/usr.bin/cc50/cc_prep/Makefile
gnu/usr.bin/cc50/support-libs/Makefile
sbin/mount_smbfs/Makefile
usr.bin/ldd/Makefile

index 45feb8a..df64dcf 100644 (file)
@@ -16,7 +16,9 @@ CFLAGS+=      -I${SRCDIR}/binutils \
 
 # link-time optimization requires dlopen() which means ar cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ${MFILE}: ${SRCDIR}/binutils/doc/ar.1
        cp ${.ALLSRC} ${.TARGET}
index 9b26408..ae0fe83 100644 (file)
@@ -44,7 +44,9 @@ CFLAGS+=      -DENABLE_PLUGINS -DHAVE_CONFIG_H
 CFLAGS+=       -DTARGET_SYSTEM_ROOT=\"${USRDATA_PREFIX}\"
 # link-time optimization requires dlopen() which means ld cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ldemul.c: ldemul-list.h
 
index d4cdd83..bb7b35f 100644 (file)
@@ -11,7 +11,9 @@ LDADD=        ${STD_LDADD} -lz
 
 # link-time optimization requires dlopen() which means nm cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ${MFILE}: ${SRCDIR}/binutils/doc/nm.1
        cp ${.ALLSRC} ${.TARGET}
index c529f31..a1555e1 100644 (file)
@@ -16,7 +16,9 @@ CFLAGS+=      -I${SRCDIR}/binutils \
 
 # link-time optimization requires dlopen() which means ranlib cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ${MFILE}: ${SRCDIR}/binutils/doc/ranlib.1
        cp ${.ALLSRC} ${.TARGET}
index 8fe540b..0b1d191 100644 (file)
@@ -9,6 +9,8 @@ NOMAN=
 
 # link-time optimization requires dlopen() which means ld cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 .include <bsd.prog.mk>
index 45feb8a..df64dcf 100644 (file)
@@ -16,7 +16,9 @@ CFLAGS+=      -I${SRCDIR}/binutils \
 
 # link-time optimization requires dlopen() which means ar cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ${MFILE}: ${SRCDIR}/binutils/doc/ar.1
        cp ${.ALLSRC} ${.TARGET}
index 33b552d..074b3dd 100644 (file)
@@ -52,7 +52,9 @@ CFLAGS+=      -DDEFAULT_LD_Z_RELRO=0
 
 # link-time optimization requires dlopen() which means ld cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ldemul.c: ldemul-list.h
 
index d4cdd83..bb7b35f 100644 (file)
@@ -11,7 +11,9 @@ LDADD=        ${STD_LDADD} -lz
 
 # link-time optimization requires dlopen() which means nm cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ${MFILE}: ${SRCDIR}/binutils/doc/nm.1
        cp ${.ALLSRC} ${.TARGET}
index c529f31..a1555e1 100644 (file)
@@ -16,7 +16,9 @@ CFLAGS+=      -I${SRCDIR}/binutils \
 
 # link-time optimization requires dlopen() which means ranlib cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 ${MFILE}: ${SRCDIR}/binutils/doc/ranlib.1
        cp ${.ALLSRC} ${.TARGET}
index 8fe540b..0b1d191 100644 (file)
@@ -9,6 +9,8 @@ NOMAN=
 
 # link-time optimization requires dlopen() which means ld cannot be built
 # statically and also support -plugin, not even for cross-tools.
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 .include <bsd.prog.mk>
index ebf2e1e..ba28da9 100644 (file)
@@ -2,7 +2,9 @@ SUBDIR=         cc_prep
 SUBDIR+=       libiberty
 SUBDIR+=       libdecnumber
 SUBDIR+=       cc_tools
+.if !defined(REALLY_NOSHARED)
 SUBDIR+=       liblto_plugin
+.endif
 SUBDIR+=       libbackend
 SUBDIR+=       libcommon
 SUBDIR+=       libcommon-target
index ce0eeff..ec0f018 100644 (file)
@@ -64,6 +64,10 @@ tm.h:
        echo '#ifndef GCC_TM_H'                         > ${.TARGET}
        echo '#define GCC_TM_H'                         >> ${.TARGET}
        echo '#ifdef IN_GCC'                            >> ${.TARGET}
+.if defined(REALLY_NOSHARED)
+       echo '#undef HAVE_LTO_PLUGIN'                   >> ${.TARGET}
+       echo '#define HAVE_LTO_PLUGIN 0'                >> ${.TARGET}
+.endif
 .for H in ${TARGET_INC}
        echo '# include "$H"'                           >> ${.TARGET}
 .endfor
index d27ccd8..6a81098 100644 (file)
@@ -64,6 +64,10 @@ tm.h:
        echo '#ifndef LIBC_BIONIC'      >> ${.TARGET}
        echo '# define LIBC_BIONIC 3'   >> ${.TARGET}
        echo '#endif'                   >> ${.TARGET}
+.if defined(REALLY_NOSHARED)
+       echo '#undef HAVE_LTO_PLUGIN'   >> ${.TARGET}
+       echo '#define HAVE_LTO_PLUGIN 0'>> ${.TARGET}
+.endif
        echo '#ifdef IN_GCC'            >> ${.TARGET}
 .for H in ${TARGET_INC}
        echo '# include "$H"'           >> ${.TARGET}
index eddcc97..3c415ce 100644 (file)
@@ -12,6 +12,8 @@ SUBDIR+=      libcpp
 SUBDIR+=       libdecnumber
 SUBDIR+=       libiberty
 SUBDIR+=       libiberty-pic
+.if !defined(REALLY_NOSHARED)
 SUBDIR+=       liblto_plugin
+.endif
 
 .include <bsd.subdir.mk>
index 07e3f32..e8502c8 100644 (file)
@@ -13,7 +13,9 @@ DPADD+= ${LIBSMB}
 # Needs to be dynamically linked for optional dlopen() access to
 # userland libiconv (see the -E option).
 #
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 .PATH: ${CONTRIBDIR}/mount_smbfs
 
index 6ae041d..927cdea 100644 (file)
@@ -3,6 +3,8 @@
 PROG=  ldd
 
 # DO NOT USE -static, dlopen() for shared libs
+.if !defined(REALLY_NOSHARED)
 .undef NOSHARED
+.endif
 
 .include <bsd.prog.mk>