From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 77302385841C; Thu, 18 Nov 2021 12:55:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77302385841C From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/88590] System Integrity Protection (SIP) breaks GCC build assumptions on Darwin. Date: Thu, 18 Nov 2021 12:55:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 9.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2021 12:55:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D88590 --- Comment #4 from Iain Sandoe --- (In reply to Iain Sandoe from comment #0) > Possible fix #1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > This is what I've been tinkering with >=20 > 1) convert all the target libraries to use @rpath/libxxxxx.dylib as their > install names > 2) get GCC to emit the necessary rpaths into executables during build and > test (and, obviously, at install time). >=20 > Actually, this is sensibly in line with a useful macOS deployment model - > since the "approved" way to package shared libraries on macOS / Darwin is= to > place them alongside the executables and use rpaths. >=20 > unfortunately: > * it's quite an involved set of changes and almost certainly not going to > happen for 9. > * there are details to work out to make sure that build-time paths don't > leak into installed libraries/exes. tested and working fix posted here: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584775.html > Possible fix #2 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Have a build environment where all the used executables and paths are > outside the remit of SIP. This is untested so far, and might not suit the > casual user of GCC - since it would involve building at least a shell / m= ake > / GCC prerequisites etc. Not going to work - /bin/sh is hardwired into configure scripts.=