public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs
@ 2024-05-05 19:41 Rainer Orth
  2024-05-05 19:41 ` Rainer Orth
  2024-05-05 20:01 ` FX Coudert
  0 siblings, 2 replies; 4+ messages in thread
From: Rainer Orth @ 2024-05-05 19:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: gfortran

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

The move of libgfortran objects to subdirectories completely broke the
creation of libgfortran.so on Solaris.  Since the gfortran.ver-sun rule
doesn't support that structure, no libtool objects are found, thus no
symbols exported from libgfortran.so, causing every link to fail.

This patch fixes this by allowing for the new structure.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

Ok for trunk?

Btw., I'm the first to admit the current way of performing those
filename/pathname transforms from libtool objects/archives to regular
objects/archives in the Makefiles is incredibly fragile.  It should be
handled in make_sunver.pl itself instead, but for now this needs a quick
fix.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgfortran:
	* Makefile.am [LIBGFOR_USE_SYMVER_SUN] (gfortran.ver-sun): Handle
	objects in subdirs.
	* Makefile.in: Regenerate.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-libgfortran-subdir-vers.patch --]
[-- Type: text/x-patch, Size: 1479 bytes --]

diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -29,7 +29,7 @@ gfortran.ver-sun : gfortran.ver \
 		$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
 	perl $(top_srcdir)/../contrib/make_sunver.pl \
 	  gfortran.ver \
-	  $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+	  $(subst /,/.libs/,$(libgfortran_la_OBJECTS:.lo=.o)) \
 	 `echo $(libgfortran_la_LIBADD) | \
 	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 	 > $@ || (rm -f $@ ; exit 1)
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -4576,7 +4576,7 @@ uninstall-am: uninstall-cafexeclibLTLIBR
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@		$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	perl $(top_srcdir)/../contrib/make_sunver.pl \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  gfortran.ver \
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  $(subst /,/.libs/,$(libgfortran_la_OBJECTS:.lo=.o)) \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	 `echo $(libgfortran_la_LIBADD) | \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	 > $@ || (rm -f $@ ; exit 1)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs
  2024-05-05 19:41 [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs Rainer Orth
@ 2024-05-05 19:41 ` Rainer Orth
  2024-05-05 20:01 ` FX Coudert
  1 sibling, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2024-05-05 19:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: fortran

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

The move of libgfortran objects to subdirectories completely broke the
creation of libgfortran.so on Solaris.  Since the gfortran.ver-sun rule
doesn't support that structure, no libtool objects are found, thus no
symbols exported from libgfortran.so, causing every link to fail.

This patch fixes this by allowing for the new structure.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

Ok for trunk?

Btw., I'm the first to admit the current way of performing those
filename/pathname transforms from libtool objects/archives to regular
objects/archives in the Makefiles is incredibly fragile.  It should be
handled in make_sunver.pl itself instead, but for now this needs a quick
fix.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgfortran:
	* Makefile.am [LIBGFOR_USE_SYMVER_SUN] (gfortran.ver-sun): Handle
	objects in subdirs.
	* Makefile.in: Regenerate.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-libgfortran-subdir-vers.patch --]
[-- Type: text/x-patch, Size: 1479 bytes --]

diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -29,7 +29,7 @@ gfortran.ver-sun : gfortran.ver \
 		$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
 	perl $(top_srcdir)/../contrib/make_sunver.pl \
 	  gfortran.ver \
-	  $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+	  $(subst /,/.libs/,$(libgfortran_la_OBJECTS:.lo=.o)) \
 	 `echo $(libgfortran_la_LIBADD) | \
 	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 	 > $@ || (rm -f $@ ; exit 1)
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -4576,7 +4576,7 @@ uninstall-am: uninstall-cafexeclibLTLIBR
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@		$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	perl $(top_srcdir)/../contrib/make_sunver.pl \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  gfortran.ver \
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  $(subst /,/.libs/,$(libgfortran_la_OBJECTS:.lo=.o)) \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	 `echo $(libgfortran_la_LIBADD) | \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	 > $@ || (rm -f $@ ; exit 1)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs
  2024-05-05 19:41 [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs Rainer Orth
  2024-05-05 19:41 ` Rainer Orth
@ 2024-05-05 20:01 ` FX Coudert
  2024-05-06  7:37   ` Rainer Orth
  1 sibling, 1 reply; 4+ messages in thread
From: FX Coudert @ 2024-05-05 20:01 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, fortran

Hi Rainer,

> This patch fixes this by allowing for the new structure.
> Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.
> 
> Ok for trunk?

OK to push, given it’s localised inside LIBGFOR_USE_SYMVER_SUN.

I find it weird though that .libs is harcoded there. If we look at all the lib*/Makefile.am in gcc, the only thing that ever needs to specify .libs is for Solaris versioning. It feels like it should be more generic, as you say (but that’s for longer term).

FX

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs
  2024-05-05 20:01 ` FX Coudert
@ 2024-05-06  7:37   ` Rainer Orth
  0 siblings, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2024-05-06  7:37 UTC (permalink / raw)
  To: FX Coudert; +Cc: gcc-patches, fortran

Hi FX,

>> This patch fixes this by allowing for the new structure.
>> Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.
>> 
>> Ok for trunk?
>
> OK to push, given it’s localised inside LIBGFOR_USE_SYMVER_SUN.
>
> I find it weird though that .libs is harcoded there. If we look at all the
> lib*/Makefile.am in gcc, the only thing that ever needs to specify .libs is
> for Solaris versioning. It feels like it should be more generic, as you say
> (but that’s for longer term).

look again ;-) libgo/Makefile.am has other unrelated instances for both
setting LD_LIBRARY_PATH and related to AIX.

It seems that libtool has no provision for operations other than compile
(create .lo from sources) and link (create executable from libtool
objects/archives).  It you need something else, there's no way but to
reach below the abstraction.  I believe libtool could provide something
like this, but apparently it doesn't.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-06  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-05 19:41 [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs Rainer Orth
2024-05-05 19:41 ` Rainer Orth
2024-05-05 20:01 ` FX Coudert
2024-05-06  7:37   ` Rainer Orth

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).