Re: [PATCH 6/8] fortran: use grep -F instead of fgrep

2022-06-24 Thread Rainer Orth
Hi Xi,

> On Fri, 2022-06-24 at 13:13 +0200, Bernhard Reutner-Fischer wrote:
>
>> > -   if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v
>> > -i debian' >/dev/null 2>&1; then \
>> > +   if $(SHELL) -c 'install-info --version | sed 1q | grep -F -s -v
>> > -i debian' >/dev/null 2>&1; then \
>> >   echo " install-info --delete --info-dir=$(DESTDIR)$(infodir)
>> > $(DESTDIR)$(infodir)/gfortran.info"; \
>> >   install-info --delete --info-dir=$(DESTDIR)$(infodir)
>> > $(DESTDIR)$(infodir)/gfortran.info || : ; \
>> > else : ; fi; \
>> 
>> I'd replace -s >/dev/null 2>&1 with -q while at it.
>> 
>> But why is -F used here in the first place?
>> I do not see much in debian that can be interpreted as a regex?
>
> I'm not sure.  It was there since 2004.  Perhaps the author thinks fgrep
> may save several CPU cycles :).  I'll just use a plain grep in PATCH v2.
>
> Rainer: do you have some idea about the availability of "-q" on
> different hosts?  If you agree I'll use it instead of -s > /dev/null
> too.

again, the autoconf manual warns agains it, even more so against -s.
That's the first reference for portability issues and shouldn't be
ignored without good reason.

In the GCC and Solaris context, /bin/grep supports both -q and -s in
Solaris 11.3 and 11.4.  It doesn't support -q on Solaris 10, though
(again, no longer relevant for GCC).

Rainer

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


[COMMITTED] testsuite: gfortran: Remove obsolete references to Solaris 9

2024-02-14 Thread Rainer Orth
Some gfortran tests still contain references to long-obsolete Solaris 9.

This patch removes them.

Tested on i386-pc-solaris2.11.

Committed to trunk.

Rainer

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


2024-02-13  Rainer Orth  

gcc/testsuite:
* gfortran.dg/fmt_en.f90 (dg-output): Don't xfail on
?86-*-solaris2.9*.
* gfortran.dg/fmt_en_rd.f90: Likewise.
* gfortran.dg/fmt_en_rn.f90: Likewise.
* gfortran.dg/fmt_en_ru.f90: Likewise.
* gfortran.dg/fmt_en_rz.f90: Likewise.

# HG changeset patch
# Parent  8c800c0f81d703746d07e942672856e9bf7eaf30
testsuite: Remove obsolete references to Solaris 9

diff --git a/gcc/testsuite/gfortran.dg/fmt_en.f90 b/gcc/testsuite/gfortran.dg/fmt_en.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en.f90
@@ -180,4 +180,4 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to nearest" { xfail hppa*-*-hpux* } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rd.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded down" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded down" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rn.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to nearest" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_ru.f90 b/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded up" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded up" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rz.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded to zero" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to zero" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }


[PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs

2024-05-05 Thread Rainer Orth
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  

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

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)


Re: [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs

2024-05-06 Thread Rainer Orth
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


[COMMITTED] build: Derive object names in make_sunver.pl

2024-05-07 Thread Rainer Orth
The recent move of libgfortran object files to subdirs and the resulting
breakage of libgfortran.so symbol exports demonstrated how fragile
deriving object and archive names from their libtool counterparts in the
Makefiles is.  Therefore, this patch moves that step into
make_sunver.pl, considerably simplifying the Makefile rules to create
the version scripts.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11, verifying that the version scripts are identical
except for the input filenames.

Committed to trunk.

Rainer

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


2024-05-06  Rainer Orth  

contrib:
* make_sunver.pl: Use File::Basename;
Skip -lLIB args.
Convert libtool object/archive names to underlying
objects/archives.

libatomic:
* Makefile.am [LIBAT_BUILD_VERSIONED_SHLIB_SUN]
(libatomic.map-sun): Pass $(libatomic_la_OBJECTS),
$(libatomic_la_LIBADD) to make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libffi:
* Makefile.am [LIBFFI_BUILD_VERSIONED_SHLIB_SUN] (libffi.map-sun):
Pass $(libffi_la_OBJECTS), $(libffi_la_LIBADD) to make_sunver.pl
unmodified.
* Makefile.in: Regenerate.

libgfortran:
* Makefile.am [LIBGFOR_USE_SYMVER_SUN} (gfortran.ver-sun): Pass
$(libgfortran_la_OBJECTS), $(libgfortran_la_LIBADD) to
make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libgomp:
* Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]
(libgomp.ver-sun): Pass $(libgomp_la_OBJECTS),
$(libgomp_la_LIBADD) to make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libitm:
* Makefile.am [LIBITM_BUILD_VERSIONED_SHLIB_SUN] (libitm.map-sun):
Pass $(libitm_la_OBJECTS), $(libitm_la_LIBADD) to make_sunver.pl
unmodified.
* Makefile.in: Regenerate.

libquadmath:
* Makefile.am [LIBQUAD_USE_SYMVER_SUN] (quadmath.map-sun): Pass
$(libquadmath_la_OBJECTS), $(libquadmath_la_LIBADD) to
make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libssp:
* Makefile.am [LIBSSP_USE_SYMVER_SUN] (ssp.map-sun): Pass
$(libssp_la_OBJECTS), $(libssp_la_LIBADD) to make_sunver.pl
unmodified.
* Makefile.in: Regenerate.

libstdc++-v3:
* src/Makefile.am [ENABLE_SYMVERS_SUN]
(libstdc++-symbols.ver-sun): Pass $(libstdc___la_OBJECTS),
$(libstdc___la_LIBADD) to make_sunver.pl unmodified.
* src/Makefile.in: Regenerate.

# HG changeset patch
# Parent  760a45ebd3104e6b2f5f739e62790ce1a4e7f33b
build: Derive object names in make_sunver.pl

diff --git a/contrib/make_sunver.pl b/contrib/make_sunver.pl
--- a/contrib/make_sunver.pl
+++ b/contrib/make_sunver.pl
@@ -17,6 +17,7 @@
 # GNU mangling style.
 
 use FileHandle;
+use File::Basename;
 use IPC::Open2;
 
 # Enforce C locale.
@@ -37,12 +38,22 @@ my @OBJECTS = ();
 # List of shared objects to omit from processing.
 my @SHAREDOBJS = ();
 
-# Filter out those input archives that have corresponding shared objects to
-# avoid adding all symbols matched in the archive to the output map.
 foreach $file (@ARGV) {
+# Filter out those input archives that have corresponding shared objects to
+# avoid adding all symbols matched in the archive to the output map.
 if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
 	printf STDERR "omitted $file -> $so\n";
 	push (@SHAREDOBJS, $so);
+# Skip libraries.
+} elsif ($file =~ /^-l/) {
+	next;
+# Convert libtool object/archive names to underlying objects/archives.
+} elsif ($file =~ /\.l[ao]$/) {
+	my ($name, $path, $suffix) = fileparse($file, ".l[ao]");
+	$suffix =~ s/l//;
+	# Strip leading ./ prepended by fileparse.
+	$path =~ s%^\./%%;
+	push (@OBJECTS, "$path.libs/$name$suffix")
 } else {
 	push (@OBJECTS, $file);
 }
diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
--- a/libatomic/Makefile.am
+++ b/libatomic/Makefile.am
@@ -55,9 +55,7 @@ libatomic.map-sun : $(top_srcdir)/libato
 		$(libatomic_la_OBJECTS) $(libatomic_la_LIBADD)
 	perl $(top_srcdir)/../contrib/make_sunver.pl \
 	  $(top_srcdir)/libatomic.map \
-	  $(libatomic_la_OBJECTS:%.lo=.libs/%.o) \
-	 `echo $(libatomic_la_LIBADD) | \
-	sed 's,\([^/ 	]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+	  $(libatomic_la_OBJECTS) $(libatomic_la_LIBADD) \
 	 > $@ || (rm -f $@ ; exit 1)
 endif
 else
diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
--- a/libatomic/Makefile.in
+++ b/libatomic/Makefile.in
@@ -888,9 +888,7 @@ vpath % $(strip $(search_path))
 @LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@		$(libatomic_la_OBJECTS) $(libatomic_la_LIBADD)
 @LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SH

Re: 6/7 [Fortran, Patch, Coarray, PR107635] Add transfer_between_remotes

2025-02-21 Thread Rainer Orth
Hi Andre,

> thanks for testing and also for giving a solution. I was sure, I would break
> something. Fixed as obvious as gcc-15-7662-g08bdc2ac98a after regtesting ok on
> x86_64-pc-linux-gnu / Fedora 41 (which gets more unstable with every update I
> receive IMO). I opted for the __builtin_alloca version. That seemed to be the
> most portable one.

agreed, and the least intrusive one.

> Thanks again for the report and keep testing please,

Sure: usually once a day ;-)

Thanks for the quick fix.

Rainer

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


Re: 6/7 [Fortran, Patch, Coarray, PR107635] Add transfer_between_remotes

2025-02-20 Thread Rainer Orth
Hi Andre,

this patch broke Solaris bootstrap:

/vol/gcc/src/hg/master/local/libgfortran/caf/single.c: In function 
‘_gfortran_caf_transfer_between_remotes’:
/vol/gcc/src/hg/master/local/libgfortran/caf/single.c:675:23: error: implicit 
declaration of function ‘alloca’ [-Wimplicit-function-declaration]
  675 |   transfer_desc = alloca (desc_size);
  |   ^~
/vol/gcc/src/hg/master/local/libgfortran/caf/single.c:675:23: warning: 
incompatible implicit declaration of built-in function ‘alloca’ 
[-Wbuiltin-declaration-mismatch]
/vol/gcc/src/hg/master/local/libgfortran/caf/single.c:680:20: warning: 
incompatible implicit declaration of built-in function ‘alloca’ 
[-Wbuiltin-declaration-mismatch]
  680 | transfer_ptr = alloca (*opt_dst_charlen * src_size);
  |^~
make[3]: *** [Makefile:4675: caf/single.lo] Error 1

Solaris needs to include  to get an alloca declaration.  While
this could be handled with AC_FUNC_ALLOCA (like libcpp does) or checking
for alloca.h and including it if found (like libssp does), I guess
there's a simpler way: several runtime libs use __builtin_alloca
unconditionally (libgcc, libquadmath, libstdc++-v3).

Rainer

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