From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CBDDE3858D1E; Tue, 20 Dec 2022 00:23:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBDDE3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671495826; bh=+k0z7HPry8dkGpCxKBKh0tQ8bpbStJpxPMkYcq9P+7k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jUuw/77L0Jmm0anNPI2lDtj4pA0UI2sc5uuMQBFekGmZZ9md2qpNr/nxO07mKiirk Gv5Oha6yUNVgicHDk/jvkVfi0Ps4UAeioxCO7a/3pFRrSWXOeJFTmhUj+sbEM1z6kS S7RPtoFupFxJK+00ZzKqGS9wArgP9nXWg5bAICLQ= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/107612] plugin/m2rte doesn't build on Mac OS X 10.7 Date: Tue, 20 Dec 2022 00:23:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: 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: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107612 --- Comment #10 from Iain Sandoe --- I fixed the plugin build to avoid linking libstdc++ (small additions to Rainer's patch) * linking libstdc++ causes the build to fail because the plugin cannot fi= nd the libstdc++ because it is not yet installed. * it's not right to link it anyway - the plugin needs to resolve its symbo= ls from cc1gm2 Adding -nodefaultlibs fixes this + I adjusted the install name. Actually, I do not think the rpaths are needed - because the plugin is explicitly loaded - it does not need to find any dependent libs. ----=20 diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in index 0ea73e766d1..8d86c1371f3 100644 --- a/gcc/m2/Make-lang.in +++ b/gcc/m2/Make-lang.in @@ -36,7 +36,10 @@ ifeq (,$(findstring darwin,$(host))) soext=3D.so else soext=3D.dylib - PLUGINLDFLAGS=3D-Wl,-undefined,dynamic_lookup + PLUGINLDFLAGS =3D -Wl,-undefined,dynamic_lookup + PLUGINLDFLAGS +=3D -Wl,-install_name,m2rte$(soext) + PLUGINLDFLAGS +=3D -Wl,-rpath,@loader_path,-rpath,@loader_path/.. + PLUGINLDFLAGS +=3D -nodefaultlibs endif=