From owner-freebsd-ports@freebsd.org Sat Apr 22 20:38:02 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9F00D4AA5C for ; Sat, 22 Apr 2017 20:38:02 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id A6BF0BD7 for ; Sat, 22 Apr 2017 20:38:02 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: by mailman.ysv.freebsd.org (Postfix) id A3377D4AA5B; Sat, 22 Apr 2017 20:38:02 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E02D4AA59 for ; Sat, 22 Apr 2017 20:38:02 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from ainaz.pair.com (ainaz.pair.com [209.68.2.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83D0CBD6; Sat, 22 Apr 2017 20:38:01 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from anthias (vie-188-118-245-044.dsl.sil.at [188.118.245.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ainaz.pair.com (Postfix) with ESMTPSA id 628F53F530; Sat, 22 Apr 2017 16:37:59 -0400 (EDT) Date: Sat, 22 Apr 2017 22:37:57 +0200 (CEST) From: Gerald Pfeifer To: Tijl Coosemans , ports@FreeBSD.org cc: Martin Wilke Subject: Re: INSTALL_TARGET=install-strip runs into "permission denied" In-Reply-To: <20150119092404.0a448f9f@kalimero.tijl.coosemans.org> Message-ID: References: <20150118130127.71b8cba9@kalimero.tijl.coosemans.org> <20150119092404.0a448f9f@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2017 20:38:02 -0000 [ Old thread alert, but still relevant. ] On Mon, 19 Jan 2015, Tijl Coosemans wrote: >>>> install -m 555 mkheaders .../prefix/gcc5/libexec/gcc5/gcc/i386-portbld-freebsd10.1/5.0.0/install-tools/mkheaders >>>> test -z 'strip' || strip .../prefix/gcc5/libexec/gcc5/gcc/i386-portbld-freebsd10.1/5.0.0/install-tools/fixincl >>>> strip: unable to copy file '.../prefix/gcc5/libexec/gcc5/gcc/i386-portbld-freebsd10.1/5.0.0/install-tools/fixincl'; reason: Permission denied >>>> Makefile:191: recipe for target 'install-strip' failed >>>> gmake[3]: *** [install-strip] Error 1 >>> This strip command seems redundant. Isn't fixincl already stripped by >>> the "install -s" command above? >> Good point. >> >>> What does this piece of the log look like outside the ports framework? >> >> /usr/bin/install -c fixinc.sh .../gcc-ref8-amd64/libexec/gcc/x86_64-unknown-freebsd8.4/5.0.0/install-tools/fixinc.sh >> /usr/bin/install -c fixincl .../gcc-ref8-amd64/libexec/gcc/x86_64-unknown-freebsd8.4/5.0.0/install-tools/fixincl >> /usr/bin/install -c mkheaders .../gcc-ref8-amd64/libexec/gcc/x86_64-unknown-freebsd8.4/5.0.0/install-tools/mkheaders >> test -z 'strip' || strip .../gcc-ref8-amd64/libexec/gcc/x86_64-unknown-freebsd8.4/5.0.0/install-tools/fixincl >> gmake[2]: Leaving directory '.../OBJ-0118-1528/fixincludes' >> >> (I also tried setting STRIP_CMD to true, alas that is not used by GCC.) > Try adding BINMODE=755 to the port Makefile or STRIP=true to CONFIGURE_ARGS Both of these allow the build to succeed as a regular user (non-root), when INSTALL_TARGET=install-strip is set. Alas with STRIP=true many files end up being not stripped, whereas with the BINMODE setting the list is down to one file. This appears to be the case since various aspects of GCC do not use our install-* tools, but a script install-sh (which you can find at the root of the GCC source tree that uses cp, chmod, strip,... for compatibility reasons with many systems). So I guess setting BINMODE=755 is the best option if we want binaries and libraries in the gcc* ports stripped? (This is now also tracked in https://reviews.freebsd.org/D10357 where miwi proposed a patch originally.) Gerald