From 56e55fe11fa401cfb8a04494160680efc148a5f0 Mon Sep 17 00:00:00 2001 From: zrj Date: Sat, 11 Nov 2017 12:37:39 +0200 Subject: [PATCH] buildworld: Really support static toolchain. 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. --- gnu/usr.bin/binutils225/block2/ar/Makefile | 2 ++ gnu/usr.bin/binutils225/block2/ld/Makefile | 2 ++ gnu/usr.bin/binutils225/block2/nm/Makefile | 2 ++ gnu/usr.bin/binutils225/block2/ranlib/Makefile | 2 ++ gnu/usr.bin/binutils225/block3/gold-linker/Makefile | 2 ++ gnu/usr.bin/binutils227/block2/ar/Makefile | 2 ++ gnu/usr.bin/binutils227/block2/ld/Makefile | 2 ++ gnu/usr.bin/binutils227/block2/nm/Makefile | 2 ++ gnu/usr.bin/binutils227/block2/ranlib/Makefile | 2 ++ gnu/usr.bin/binutils227/block3/gold-linker/Makefile | 2 ++ gnu/usr.bin/cc47/Makefile | 2 ++ gnu/usr.bin/cc47/cc_prep/Makefile | 4 ++++ gnu/usr.bin/cc50/cc_prep/Makefile | 4 ++++ gnu/usr.bin/cc50/support-libs/Makefile | 2 ++ sbin/mount_smbfs/Makefile | 2 ++ usr.bin/ldd/Makefile | 2 ++ 16 files changed, 36 insertions(+) diff --git a/gnu/usr.bin/binutils225/block2/ar/Makefile b/gnu/usr.bin/binutils225/block2/ar/Makefile index 45feb8a90c..df64dcff6d 100644 --- a/gnu/usr.bin/binutils225/block2/ar/Makefile +++ b/gnu/usr.bin/binutils225/block2/ar/Makefile @@ -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} diff --git a/gnu/usr.bin/binutils225/block2/ld/Makefile b/gnu/usr.bin/binutils225/block2/ld/Makefile index 9b26408182..ae0fe83191 100644 --- a/gnu/usr.bin/binutils225/block2/ld/Makefile +++ b/gnu/usr.bin/binutils225/block2/ld/Makefile @@ -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 diff --git a/gnu/usr.bin/binutils225/block2/nm/Makefile b/gnu/usr.bin/binutils225/block2/nm/Makefile index d4cdd83ff9..bb7b35fd40 100644 --- a/gnu/usr.bin/binutils225/block2/nm/Makefile +++ b/gnu/usr.bin/binutils225/block2/nm/Makefile @@ -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} diff --git a/gnu/usr.bin/binutils225/block2/ranlib/Makefile b/gnu/usr.bin/binutils225/block2/ranlib/Makefile index c529f31df4..a1555e1c1c 100644 --- a/gnu/usr.bin/binutils225/block2/ranlib/Makefile +++ b/gnu/usr.bin/binutils225/block2/ranlib/Makefile @@ -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} diff --git a/gnu/usr.bin/binutils225/block3/gold-linker/Makefile b/gnu/usr.bin/binutils225/block3/gold-linker/Makefile index 8fe540ba5f..0b1d1910ac 100644 --- a/gnu/usr.bin/binutils225/block3/gold-linker/Makefile +++ b/gnu/usr.bin/binutils225/block3/gold-linker/Makefile @@ -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 diff --git a/gnu/usr.bin/binutils227/block2/ar/Makefile b/gnu/usr.bin/binutils227/block2/ar/Makefile index 45feb8a90c..df64dcff6d 100644 --- a/gnu/usr.bin/binutils227/block2/ar/Makefile +++ b/gnu/usr.bin/binutils227/block2/ar/Makefile @@ -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} diff --git a/gnu/usr.bin/binutils227/block2/ld/Makefile b/gnu/usr.bin/binutils227/block2/ld/Makefile index 33b552d1c0..074b3dd268 100644 --- a/gnu/usr.bin/binutils227/block2/ld/Makefile +++ b/gnu/usr.bin/binutils227/block2/ld/Makefile @@ -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 diff --git a/gnu/usr.bin/binutils227/block2/nm/Makefile b/gnu/usr.bin/binutils227/block2/nm/Makefile index d4cdd83ff9..bb7b35fd40 100644 --- a/gnu/usr.bin/binutils227/block2/nm/Makefile +++ b/gnu/usr.bin/binutils227/block2/nm/Makefile @@ -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} diff --git a/gnu/usr.bin/binutils227/block2/ranlib/Makefile b/gnu/usr.bin/binutils227/block2/ranlib/Makefile index c529f31df4..a1555e1c1c 100644 --- a/gnu/usr.bin/binutils227/block2/ranlib/Makefile +++ b/gnu/usr.bin/binutils227/block2/ranlib/Makefile @@ -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} diff --git a/gnu/usr.bin/binutils227/block3/gold-linker/Makefile b/gnu/usr.bin/binutils227/block3/gold-linker/Makefile index 8fe540ba5f..0b1d1910ac 100644 --- a/gnu/usr.bin/binutils227/block3/gold-linker/Makefile +++ b/gnu/usr.bin/binutils227/block3/gold-linker/Makefile @@ -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 diff --git a/gnu/usr.bin/cc47/Makefile b/gnu/usr.bin/cc47/Makefile index ebf2e1e9db..ba28da94a0 100644 --- a/gnu/usr.bin/cc47/Makefile +++ b/gnu/usr.bin/cc47/Makefile @@ -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 diff --git a/gnu/usr.bin/cc47/cc_prep/Makefile b/gnu/usr.bin/cc47/cc_prep/Makefile index ce0eeffcde..ec0f0187ea 100644 --- a/gnu/usr.bin/cc47/cc_prep/Makefile +++ b/gnu/usr.bin/cc47/cc_prep/Makefile @@ -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 diff --git a/gnu/usr.bin/cc50/cc_prep/Makefile b/gnu/usr.bin/cc50/cc_prep/Makefile index d27ccd834d..6a81098b11 100644 --- a/gnu/usr.bin/cc50/cc_prep/Makefile +++ b/gnu/usr.bin/cc50/cc_prep/Makefile @@ -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} diff --git a/gnu/usr.bin/cc50/support-libs/Makefile b/gnu/usr.bin/cc50/support-libs/Makefile index eddcc973f3..3c415ce723 100644 --- a/gnu/usr.bin/cc50/support-libs/Makefile +++ b/gnu/usr.bin/cc50/support-libs/Makefile @@ -12,6 +12,8 @@ SUBDIR+= libcpp SUBDIR+= libdecnumber SUBDIR+= libiberty SUBDIR+= libiberty-pic +.if !defined(REALLY_NOSHARED) SUBDIR+= liblto_plugin +.endif .include diff --git a/sbin/mount_smbfs/Makefile b/sbin/mount_smbfs/Makefile index 07e3f32361..e8502c8b65 100644 --- a/sbin/mount_smbfs/Makefile +++ b/sbin/mount_smbfs/Makefile @@ -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 diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile index 6ae041d51b..927cdea7fe 100644 --- a/usr.bin/ldd/Makefile +++ b/usr.bin/ldd/Makefile @@ -3,6 +3,8 @@ PROG= ldd # DO NOT USE -static, dlopen() for shared libs +.if !defined(REALLY_NOSHARED) .undef NOSHARED +.endif .include -- 2.11.4.GIT