]> git.ipfire.org Git - thirdparty/gcc.git/commit
modula-2: Fix building the plugin for Darwin [PR107612].
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 15 Dec 2022 10:43:37 +0000 (10:43 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 31 Dec 2022 15:49:04 +0000 (15:49 +0000)
commitebc41f9a817dbae01c7450cd33c1968318ce8df0
tree8f68b88f815128f24f9a12aebafb6de2448bf9f0
parent0e8c946508f4515ef9d92a3b9156283d1295b760
modula-2: Fix building the plugin for Darwin [PR107612].

 * Makes the configured value for INCINTL available as a variable so that
it can be used in language makefile fragements.  It is then used in the m2
fragment to make the include path available to the plugin compile.

 * Updates the DSO suffix  to use .dylib for Darwin.

 * Adds '-Wl,-undefined,dynamic_lookup' to the link flags so that symbols can
   be resolved at runtime.

 * Removes the extraneous $(exeext) from the DSO names.

Since the linking is driven by CXX, we also need to supress the addition of
default libraries otherwise:
 (1) we will get a reference to an uninstalled libstdc++
 (2) the process opening the plugin would have two instances 0f libstdc++ -
     one statically linked into gm2 and one dynamically linked into the plugin.

PR modula2/107612

gcc/ChangeLog:

* Makefile.in: Make the configured libintl includes avaiable in INCINTL.
(BUILD_CPPFLAGS): Use INCINTL.

gcc/m2/ChangeLog:

* Make-lang.in (soext): Use .dylib for Darwin.
(PLUGINLDFLAGS): Use dynmic lookup, set the plugin name, and append
-nodefaultlibs to suppress the linking of libstdc++.
Use INCINTL in compile lines for the plugin.

Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk>
gcc/Makefile.in
gcc/m2/Make-lang.in