Patchwork Add some forgotten exports to libgfortran/gfortran.map (PR libfortran/47757)

login
register
mail settings
Submitter Jakub Jelinek
Date Feb. 16, 2011, 1:51 p.m.
Message ID <20110216135154.GV30899@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/83366/
State New
Headers show

Comments

Jakub Jelinek - Feb. 16, 2011, 1:51 p.m.
Hi!

As the testcases below show, some exports from libgfortran.so
were forgotten on targets with symbol versioning.
This patch fixes it, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk?

2011-02-16  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/47757
	* libgfortran/gfortran.map (GFORTRAN_1.4): Export
	_gfortran_{m,s}i{all,any,parity}_i{1,2,4,8,16} and
	_gfortran_{cshift0,eoshift{0,2}}_16_char4.

	* gfortran.dg/pr47757-1.f90: New test.
	* gfortran.dg/pr47757-2.f90: New test.
	* gfortran.dg/pr47757-3.f90: New test.


	Jakub
Tobias Burnus - Feb. 16, 2011, 5:10 p.m.
On 02/16/2011 02:51 PM, Jakub Jelinek wrote:
> As the testcases below show, some exports from libgfortran.so
> were forgotten on targets with symbol versioning.
> This patch fixes it, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?

OK. Thanks for the patch. I think we should do something similar before 
every new release.

Tobias

> 2011-02-16  Jakub Jelinek<jakub@redhat.com>
>
> 	PR libfortran/47757
> 	* libgfortran/gfortran.map (GFORTRAN_1.4): Export
> 	_gfortran_{m,s}i{all,any,parity}_i{1,2,4,8,16} and
> 	_gfortran_{cshift0,eoshift{0,2}}_16_char4.
>
> 	* gfortran.dg/pr47757-1.f90: New test.
> 	* gfortran.dg/pr47757-2.f90: New test.
> 	* gfortran.dg/pr47757-3.f90: New test.
Jakub Jelinek - Feb. 16, 2011, 5:23 p.m.
On Wed, Feb 16, 2011 at 06:10:12PM +0100, Tobias Burnus wrote:
> On 02/16/2011 02:51 PM, Jakub Jelinek wrote:
> >As the testcases below show, some exports from libgfortran.so
> >were forgotten on targets with symbol versioning.
> >This patch fixes it, bootstrapped/regtested on x86_64-linux and i686-linux,
> >ok for trunk?
> 
> OK. Thanks for the patch. I think we should do something similar
> before every new release.

Agreed.  Anyway, there are other issues:
1) for __float128 using targets, lots of new symbols appeared even in older
   GFORTRAN_1.0 etc. versions, ideally they would go to GFORTRAN_1.4
   if they have been added on those targets for 4.6 (you'd probably need
   to preprocess gfortran.map for this)
2) I see quite many PLT slots for _gfortran_* functions in libgfortran.so.3,
   while some of them may be from Fortran sources and harder to avoid,
   perhaps a bunch of new iexport_proto's are needed

	Jakub
Janne Blomqvist - Feb. 16, 2011, 6:18 p.m.
On Wed, Feb 16, 2011 at 19:23, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Feb 16, 2011 at 06:10:12PM +0100, Tobias Burnus wrote:
>> On 02/16/2011 02:51 PM, Jakub Jelinek wrote:
>> >As the testcases below show, some exports from libgfortran.so
>> >were forgotten on targets with symbol versioning.
>> >This patch fixes it, bootstrapped/regtested on x86_64-linux and i686-linux,
>> >ok for trunk?
>>
>> OK. Thanks for the patch. I think we should do something similar
>> before every new release.
>
> Agreed.  Anyway, there are other issues:
> 1) for __float128 using targets, lots of new symbols appeared even in older
>   GFORTRAN_1.0 etc. versions, ideally they would go to GFORTRAN_1.4
>   if they have been added on those targets for 4.6 (you'd probably need
>   to preprocess gfortran.map for this)
> 2) I see quite many PLT slots for _gfortran_* functions in libgfortran.so.3,
>   while some of them may be from Fortran sources and harder to avoid,
>   perhaps a bunch of new iexport_proto's are needed

Would it make sense to compile libgfortran with -fvisibility=hidden?
Jakub Jelinek - Feb. 16, 2011, 6:24 p.m.
On Wed, Feb 16, 2011 at 08:18:39PM +0200, Janne Blomqvist wrote:
> On Wed, Feb 16, 2011 at 19:23, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Wed, Feb 16, 2011 at 06:10:12PM +0100, Tobias Burnus wrote:
> >> On 02/16/2011 02:51 PM, Jakub Jelinek wrote:
> >> >As the testcases below show, some exports from libgfortran.so
> >> >were forgotten on targets with symbol versioning.
> >> >This patch fixes it, bootstrapped/regtested on x86_64-linux and i686-linux,
> >> >ok for trunk?
> >>
> >> OK. Thanks for the patch. I think we should do something similar
> >> before every new release.
> >
> > Agreed.  Anyway, there are other issues:
> > 1) for __float128 using targets, lots of new symbols appeared even in older
> >   GFORTRAN_1.0 etc. versions, ideally they would go to GFORTRAN_1.4
> >   if they have been added on those targets for 4.6 (you'd probably need
> >   to preprocess gfortran.map for this)
> > 2) I see quite many PLT slots for _gfortran_* functions in libgfortran.so.3,
> >   while some of them may be from Fortran sources and harder to avoid,
> >   perhaps a bunch of new iexport_proto's are needed
> 
> Would it make sense to compile libgfortran with -fvisibility=hidden?

It wouldn't, it would just completely break it.

	Jakub

Patch

--- libgfortran/gfortran.map.jj	2010-11-17 10:13:20.000000000 +0100
+++ libgfortran/gfortran.map	2011-02-16 10:54:46.979897353 +0100
@@ -1122,16 +1122,46 @@  GFORTRAN_1.4 {
     _gfortran_iall_i4;
     _gfortran_iall_i8;
     _gfortran_iall_i16;
+    _gfortran_miall_i1;
+    _gfortran_miall_i2;
+    _gfortran_miall_i4;
+    _gfortran_miall_i8;
+    _gfortran_miall_i16;
+    _gfortran_siall_i1;
+    _gfortran_siall_i2;
+    _gfortran_siall_i4;
+    _gfortran_siall_i8;
+    _gfortran_siall_i16;
     _gfortran_iany_i1;
     _gfortran_iany_i2;
     _gfortran_iany_i4;
     _gfortran_iany_i8;
     _gfortran_iany_i16;
+    _gfortran_miany_i1;
+    _gfortran_miany_i2;
+    _gfortran_miany_i4;
+    _gfortran_miany_i8;
+    _gfortran_miany_i16;
+    _gfortran_siany_i1;
+    _gfortran_siany_i2;
+    _gfortran_siany_i4;
+    _gfortran_siany_i8;
+    _gfortran_siany_i16;
     _gfortran_iparity_i1;
     _gfortran_iparity_i2;
     _gfortran_iparity_i4;
     _gfortran_iparity_i8;
     _gfortran_iparity_i16;
+    _gfortran_miparity_i1;
+    _gfortran_miparity_i2;
+    _gfortran_miparity_i4;
+    _gfortran_miparity_i8;
+    _gfortran_miparity_i16;
+    _gfortran_siparity_i1;
+    _gfortran_siparity_i2;
+    _gfortran_siparity_i4;
+    _gfortran_siparity_i8;
+    _gfortran_siparity_i16;
     _gfortran_norm2_r4;
     _gfortran_norm2_r8;
     _gfortran_norm2_r10;
@@ -1154,6 +1184,9 @@  GFORTRAN_1.4 {
     _gfortran_transfer_real_write;
     _gfortran_transfer_real128;
     _gfortran_transfer_real128_write;
+    _gfortran_cshift0_16_char4;
+    _gfortran_eoshift0_16_char4;
+    _gfortran_eoshift2_16_char4;
 } GFORTRAN_1.3; 
 
 F2C_1.0 {
--- gcc/testsuite/gfortran.dg/pr47757-1.f90.jj	2011-02-16 10:32:59.273764520 +0100
+++ gcc/testsuite/gfortran.dg/pr47757-1.f90	2011-02-16 10:35:12.370402168 +0100
@@ -0,0 +1,40 @@ 
+! PR libfortran/47757
+! { dg-do run }
+
+  integer(1) :: a1(2,2)
+  integer(2) :: a2(2,2)
+  integer(4) :: a4(2,2)
+  integer(8) :: a8(2,2)
+  logical :: mask(2,2)
+  logical :: mask2
+  a1 = 0
+  a2 = 0
+  a3 = 0
+  a4 = 0
+  mask2 = .true.
+  mask = reshape([.true.,.true.,.false.,.true.],[2,2])
+  print *, iany(a1, dim=1, mask=mask)
+  print *, iany(a2, dim=1, mask=mask)
+  print *, iany(a4, dim=1, mask=mask)
+  print *, iany(a8, dim=1, mask=mask)
+  print *, iall(a1, dim=1, mask=mask)
+  print *, iall(a2, dim=1, mask=mask)
+  print *, iall(a4, dim=1, mask=mask)
+  print *, iall(a8, dim=1, mask=mask)
+  print *, iparity(a1, dim=1, mask=mask)
+  print *, iparity(a2, dim=1, mask=mask)
+  print *, iparity(a4, dim=1, mask=mask)
+  print *, iparity(a8, dim=1, mask=mask)
+  print *, iany(a1, dim=1, mask=mask2)
+  print *, iany(a2, dim=1, mask=mask2)
+  print *, iany(a4, dim=1, mask=mask2)
+  print *, iany(a8, dim=1, mask=mask2)
+  print *, iall(a1, dim=1, mask=mask2)
+  print *, iall(a2, dim=1, mask=mask2)
+  print *, iall(a4, dim=1, mask=mask2)
+  print *, iall(a8, dim=1, mask=mask2)
+  print *, iparity(a1, dim=1, mask=mask2)
+  print *, iparity(a2, dim=1, mask=mask2)
+  print *, iparity(a4, dim=1, mask=mask2)
+  print *, iparity(a8, dim=1, mask=mask2)
+end
--- gcc/testsuite/gfortran.dg/pr47757-2.f90.jj	2011-02-16 10:33:09.269420078 +0100
+++ gcc/testsuite/gfortran.dg/pr47757-2.f90	2011-02-16 10:50:30.057714582 +0100
@@ -0,0 +1,16 @@ 
+! PR libfortran/47757
+! { dg-do run { target fortran_large_int } }
+
+  integer(16) :: a16(2,2)
+  logical :: mask(2,2)
+  logical :: mask2
+  a16 = 0
+  mask2 = .true.
+  mask = reshape([.true.,.true.,.false.,.true.],[2,2])
+  print *, iany(a16, dim=1, mask=mask)
+  print *, iall(a16, dim=1, mask=mask)
+  print *, iparity(a16, dim=1, mask=mask)
+  print *, iany(a16, dim=1, mask=mask2)
+  print *, iall(a16, dim=1, mask=mask2)
+  print *, iparity(a16, dim=1, mask=mask2)
+end
--- gcc/testsuite/gfortran.dg/pr47757-3.f90.jj	2011-02-16 10:35:25.864388810 +0100
+++ gcc/testsuite/gfortran.dg/pr47757-3.f90	2011-02-16 10:50:41.550388829 +0100
@@ -0,0 +1,12 @@ 
+! PR libfortran/47757
+! { dg-do run { target fortran_large_int } }
+
+  character(kind=4):: str(3,3), s(3)
+  str(1,:) = [4_'A', 4_'b', 4_'C']
+  str(2,:) = [4_'A', 4_'b', 4_'C']
+  str(3,:) = [4_'A', 4_'b', 4_'C']
+  s = 4_'A'
+  print *, cshift(str, shift=2_16, dim=1_16)
+  print *, eoshift(str, shift=2_16, dim=1_16)
+  print *, eoshift(str, shift=2_16, boundary=s, dim=1_16)
+end