diff options
author | gerald <gerald@FreeBSD.org> | 2017-11-14 22:05:47 +0800 |
---|---|---|
committer | gerald <gerald@FreeBSD.org> | 2017-11-14 22:05:47 +0800 |
commit | 439b8f07e208c67f6156877caf71634b312cedbd (patch) | |
tree | 52252194ae7c1559cc5a42481c21c0c9c98c4e28 /lang | |
parent | 9f49b2481a0f2ed06cc23ef93eb8f71d3bc2430a (diff) | |
download | freebsd-ports-gnome-439b8f07e208c67f6156877caf71634b312cedbd.tar.gz freebsd-ports-gnome-439b8f07e208c67f6156877caf71634b312cedbd.tar.zst freebsd-ports-gnome-439b8f07e208c67f6156877caf71634b312cedbd.zip |
Make sure what we install is stripped (i.e., debug info is removed).
The straightforward way is setting INSTALL_TARGET to install-strip,
which is supported by the upstream GCC build machinery.
Unfortunately this fails when running as regular user (non-root)
since strip requires write permission to the files in question,
and we install binaries as r-xr-xr-x by default. To work around
that we need to set BINMODE to allow for write access by the user,
something that's common on GNU/Linux (which is why this probably
has not been noticed there). This is not necessary when running
as root.
(A different approach suggested was to set STRIP=true, alas that
leads to many files actually not being stripped. This is due to
GCC using its own script install-sh that in turn uses cp, chmod,
strip,... instead of our own install-* tools in many cases.)
According to tests by sobomax@ and me installs of lang/gcc6 went
down by about a fourth.
Reported by: Ports QA Framework, miwi, sobomax
Discussed with: tijl, miwi
Tested by: sobomax
Differential Revision: https://reviews.freebsd.org/D10357
Diffstat (limited to 'lang')
-rw-r--r-- | lang/gcc7/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lang/gcc7/Makefile b/lang/gcc7/Makefile index b6e3a174743e..cfbc45efc10d 100644 --- a/lang/gcc7/Makefile +++ b/lang/gcc7/Makefile @@ -3,7 +3,7 @@ PORTNAME= gcc PORTVERSION= 7.2.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= lang MASTER_SITES= GCC/releases/gcc-${DISTVERSION} PKGNAMESUFFIX= ${SUFFIX} @@ -83,6 +83,10 @@ CONFIGURE_ARGS+=--disable-bootstrap CONFIGURE_ARGS+=--with-build-config=bootstrap-debug ALL_TARGET= bootstrap-lean .endif +INSTALL_TARGET= install-strip +.if ${UID} != 0 +BINMODE= 755 +.endif CONFIGURE_ARGS+=--disable-nls \ --enable-gnu-indirect-function \ --libdir=${TARGLIB} \ |