From owner-freebsd-toolchain@FreeBSD.ORG Fri Apr 27 11:47:07 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4772A106566B; Fri, 27 Apr 2012 11:47:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A4ED08FC12; Fri, 27 Apr 2012 11:47:06 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q3RBl3Fa011630; Fri, 27 Apr 2012 14:47:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q3RBl21N034470; Fri, 27 Apr 2012 14:47:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q3RBl2kN034469; Fri, 27 Apr 2012 14:47:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Apr 2012 14:47:02 +0300 From: Konstantin Belousov To: Ruslan Ermilov Message-ID: <20120427114702.GZ2358@deviant.kiev.zoral.com.ua> References: <20120426093548.GR2358@deviant.kiev.zoral.com.ua> <20120426134140.GF14350@lo0.su> <20120427085859.GY2358@deviant.kiev.zoral.com.ua> <20120427105806.GB4477@lo0.su> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LO1tiPwOBUf6PfOG" Content-Disposition: inline In-Reply-To: <20120427105806.GB4477@lo0.su> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: toolchain@freebsd.org, current@freebsd.org Subject: Re: [RFC] Un-staticise the toolchain X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2012 11:47:07 -0000 --LO1tiPwOBUf6PfOG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 27, 2012 at 02:58:06PM +0400, Ruslan Ermilov wrote: > Regarding your patch... >=20 > By placing SHARED_TOOLCHAIN to __DEFAULT_NO_OPTIONS list in > bsd.own.mk, you already had MK_SHARED_TOOLCHAIN set to "no" by > default, which preserves the current status quo of building > toolchain static. But you misspelled > tools/build/options/WITH_STATIC_TOOLCHAIN, probably as the result > of iteratively modifying your change. The option and this file > should be named WITH_SHARED_TOOLCHAIN, the opposite of the > default. Anyway, checking that the resulting src.conf(5) manpage > sounds sensible is a good idea. As for the contents of this file, > I wouldn't call "ar/ranlib" a "librarian" but rather a "library > archives manager", as per POSIX. Your diff also suggests that it > misses a newline at EOF. Thank you for the suggestions. Below is the variant that should handle all the commentary. diff --git a/gnu/usr.bin/binutils/ar/Makefile b/gnu/usr.bin/binutils/ar/Mak= efile index 464445e..6fe22c8 100644 --- a/gnu/usr.bin/binutils/ar/Makefile +++ b/gnu/usr.bin/binutils/ar/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ =20 .include "../Makefile.inc0" +.include =20 .PATH: ${SRCDIR}/binutils ${SRCDIR}/binutils/doc =20 @@ -16,7 +17,9 @@ CFLAGS+=3D -D_GNU_SOURCE CFLAGS+=3D -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+=3D -I${SRCDIR}/binutils CFLAGS+=3D -I${SRCDIR}/bfd +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3D yes +.endif DPADD=3D ${RELTOP}/libbinutils/libbinutils.a DPADD+=3D ${RELTOP}/libbfd/libbfd.a DPADD+=3D ${RELTOP}/libiberty/libiberty.a diff --git a/gnu/usr.bin/binutils/as/Makefile b/gnu/usr.bin/binutils/as/Mak= efile index bf8df81..5fef1f3 100644 --- a/gnu/usr.bin/binutils/as/Makefile +++ b/gnu/usr.bin/binutils/as/Makefile @@ -4,6 +4,7 @@ # BINDIR .include "${.CURDIR}/../../Makefile.inc" .include "${.CURDIR}/../Makefile.inc0" +.include =20 .PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config =20 @@ -79,7 +80,9 @@ CFLAGS+=3D -D_GNU_SOURCE CFLAGS+=3D -I${SRCDIR}/gas -I${SRCDIR}/bfd -I${SRCDIR}/gas/config -I${SRCD= IR} CFLAGS+=3D -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd =20 +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3D yes +.endif =20 DPADD=3D ${RELTOP}/libbfd/libbfd.a DPADD+=3D ${RELTOP}/libiberty/libiberty.a diff --git a/gnu/usr.bin/binutils/ld/Makefile b/gnu/usr.bin/binutils/ld/Mak= efile index d4420ed..ef19afa 100644 --- a/gnu/usr.bin/binutils/ld/Makefile +++ b/gnu/usr.bin/binutils/ld/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ =20 .include "../Makefile.inc0" +.include =20 .PATH: ${SRCDIR}/ld =20 @@ -34,7 +35,9 @@ CFLAGS+=3D -DBINDIR=3D\"${BINDIR}\" -DTARGET_SYSTEM_ROOT= =3D\"${TOOLS_PREFIX}\" CFLAGS+=3D -DTOOLBINDIR=3D\"${TOOLS_PREFIX}/${BINDIR}/libexec\" CFLAGS+=3D -D_GNU_SOURCE CFLAGS+=3D -I${SRCDIR}/ld -I${SRCDIR}/bfd +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3D yes +.endif DPADD=3D ${RELTOP}/libbfd/libbfd.a DPADD+=3D ${RELTOP}/libiberty/libiberty.a LDADD=3D ${DPADD} diff --git a/gnu/usr.bin/binutils/ranlib/Makefile b/gnu/usr.bin/binutils/ra= nlib/Makefile index 8679375..052f9fe 100644 --- a/gnu/usr.bin/binutils/ranlib/Makefile +++ b/gnu/usr.bin/binutils/ranlib/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ =20 .include "../Makefile.inc0" +.include =20 .PATH: ${SRCDIR}/binutils ${SRCDIR}/binutils/doc =20 @@ -16,7 +17,9 @@ CFLAGS+=3D -D_GNU_SOURCE CFLAGS+=3D -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+=3D -I${SRCDIR}/binutils CFLAGS+=3D -I${SRCDIR}/bfd +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3D yes +.endif DPADD=3D ${RELTOP}/libbinutils/libbinutils.a DPADD+=3D ${RELTOP}/libbfd/libbfd.a DPADD+=3D ${RELTOP}/libiberty/libiberty.a diff --git a/gnu/usr.bin/cc/cc/Makefile b/gnu/usr.bin/cc/cc/Makefile index 78c83a5..ba53565 100644 --- a/gnu/usr.bin/cc/cc/Makefile +++ b/gnu/usr.bin/cc/cc/Makefile @@ -9,7 +9,9 @@ PROG=3D gcc MAN=3D gcc.1 SRCS+=3D gccspec.c =20 +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3Dyes +.endif =20 MLINKS=3D gcc.1 g++.1 .if ${MK_CLANG_IS_CC} =3D=3D "no" diff --git a/gnu/usr.bin/cc/cc1/Makefile b/gnu/usr.bin/cc/cc1/Makefile index c65acd2..7b1e343 100644 --- a/gnu/usr.bin/cc/cc1/Makefile +++ b/gnu/usr.bin/cc/cc1/Makefile @@ -1,14 +1,17 @@ # $FreeBSD$ =20 .include "../Makefile.inc" +NO_MAN=3D +.include =20 .PATH: ${GCCDIR} =20 PROG=3D cc1 SRCS=3D main.c c-parser.c c-lang.c BINDIR=3D /usr/libexec -NO_MAN=3D +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3Dyes +.endif =20 OBJS+=3D ${PROG}-checksum.o DPADD=3D ${LIBBACKEND} ${LIBCPP} ${LIBDECNUMBER} ${LIBIBERTY} diff --git a/gnu/usr.bin/cc/cc1plus/Makefile b/gnu/usr.bin/cc/cc1plus/Makef= ile index 964d20f..dd3d524 100644 --- a/gnu/usr.bin/cc/cc1plus/Makefile +++ b/gnu/usr.bin/cc/cc1plus/Makefile @@ -1,6 +1,8 @@ # $FreeBSD$ =20 .include "../Makefile.inc" +NO_MAN=3D +.include =20 .PATH: ${GCCDIR}/cp ${GCCDIR} =20 @@ -13,8 +15,9 @@ SRCS+=3D main.c cp-lang.c c-opts.c call.c class.c cvt.c c= xx-pretty-print.c \ cp-objcp-common.c cp-gimplify.c tree-mudflap.c =20 BINDIR=3D /usr/libexec -NO_MAN=3D +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3Dyes +.endif =20 CFLAGS+=3D -I${GCCDIR}/cp -I. =20 diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 55d6ba2..b0acbfd 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -425,7 +425,8 @@ __DEFAULT_NO_OPTIONS =3D \ ICONV \ IDEA \ LIBCPLUSPLUS \ - OFED + OFED \ + SHARED_TOOLCHAIN =20 # # Default behaviour of some options depends on the architecture. Unfortun= ately diff --git a/tools/build/options/WITH_SHARED_TOOLCHAIN b/tools/build/option= s/WITH_SHARED_TOOLCHAIN new file mode 100644 index 0000000..48eea6d --- /dev/null +++ b/tools/build/options/WITH_SHARED_TOOLCHAIN @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to build the toolchain binaries shared. +The set includes +.Xr cc 1 , +.Xr make 1 +and neccessary utilites like assembler, linker and library archive manager. diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile index e373120..e9bb893 100644 --- a/usr.bin/ar/Makefile +++ b/usr.bin/ar/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ =20 +.include + PROG=3D ar SRCS=3D ar.c acplex.l acpyacc.y read.c util.c write.c y.tab.h =20 @@ -8,7 +10,9 @@ LDADD=3D -larchive -lelf =20 CFLAGS+=3D-I. -I${.CURDIR} =20 +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3D yes +.endif LINKS=3D ${BINDIR}/ar ${BINDIR}/ranlib MLINKS=3D ar.1 ranlib.1 =20 diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index 2dc7e58..f67cf50 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -2,13 +2,17 @@ # $Id: Makefile,v 1.6 1994/06/30 05:33:39 cgd Exp $ # $FreeBSD$ =20 +.include + PROG=3D make CFLAGS+=3D-I${.CURDIR} SRCS=3D arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \ lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \ util.c var.c =20 +.if ${MK_SHARED_TOOLCHAIN} =3D=3D "no" NO_SHARED?=3D YES +.endif =20 # Version has the RYYYYMMDDX format, where R is from RELENG_ CFLAGS+=3D-DMAKE_VERSION=3D\"5201111300\" --LO1tiPwOBUf6PfOG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+ahzYACgkQC3+MBN1Mb4ii+wCeMlwMjiu4g17+P7HZrfbaFPa3 /aMAoOWs/efEQOlrwE8Np89hI1hhDdNs =UpfA -----END PGP SIGNATURE----- --LO1tiPwOBUf6PfOG--