public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-107612-4-VJ1isVlaVL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107612-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107612

--- Comment #10 from Iain Sandoe <iains at gcc dot gnu.org> ---
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 find
the libstdc++ because it is not yet installed.

 * it's not right to link it anyway - the plugin needs to resolve its symbols
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.

---- 

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=.so
 else
   soext=.dylib
-  PLUGINLDFLAGS=-Wl,-undefined,dynamic_lookup
+  PLUGINLDFLAGS = -Wl,-undefined,dynamic_lookup
+  PLUGINLDFLAGS += -Wl,-install_name,m2rte$(soext)
+  PLUGINLDFLAGS += -Wl,-rpath,@loader_path,-rpath,@loader_path/..
+  PLUGINLDFLAGS += -nodefaultlibs
 endif

  parent reply	other threads:[~2022-12-20  0:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 12:48 [Bug modula2/107612] New: " ro at gcc dot gnu.org
2022-11-10 12:49 ` [Bug modula2/107612] " ro at gcc dot gnu.org
2022-11-11  9:01 ` ro at gcc dot gnu.org
2022-11-15 13:45 ` ro at gcc dot gnu.org
2022-12-15  8:08 ` iains at gcc dot gnu.org
2022-12-15  8:09 ` iains at gcc dot gnu.org
2022-12-15  8:16 ` iains at gcc dot gnu.org
2022-12-15 12:33 ` iains at gcc dot gnu.org
2022-12-15 12:46 ` iains at gcc dot gnu.org
2022-12-15 23:29 ` iains at gcc dot gnu.org
2022-12-17  0:25 ` iains at gcc dot gnu.org
2022-12-20  0:23 ` iains at gcc dot gnu.org [this message]
2022-12-31 16:15 ` cvs-commit at gcc dot gnu.org
2023-01-02 11:18 ` iains at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107612-4-VJ1isVlaVL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).