public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
@ 2012-06-18 18:11 Maciej (Matchek) Bliziński
  2012-06-19  5:47 ` Tom G. Christensen
  0 siblings, 1 reply; 18+ messages in thread
From: Maciej (Matchek) Bliziński @ 2012-06-18 18:11 UTC (permalink / raw)
  To: gcc-help

I've hit a build problem when upgrading from 4.7.0 to 4.7.1. I'm using
the same build recipe[1], so it's most probably a change in GCC code.
The immediate error I'm hitting is this:

rm -f rts/libgna*.so
cd rts; `echo "/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/./gcc/xgcc
-B/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/./gcc/
-B/opt/csw/sparc-sun-solaris2.10/bin/
-B/opt/csw/sparc-sun-solaris2.10/lib/ -isystem
/opt/csw/sparc-sun-solaris2.10/include -isystem
/opt/csw/sparc-sun-solaris2.10/sys-include   " \
                | sed -e 's,\./xgcc,../../xgcc,' -e
's,-B\./,-B../../,'` -shared -g -O2  \
        -fPIC \
        -o libgnat-4.7.so \
        a-assert.o (...) raise-gcc.o \
        -Wl,-h,libgnat-4.7.so \
        -lposix4 -lnsl -lsocket -lm
Text relocation remains                         referenced
    against symbol                  offset      in file
<unknown>                           0x0         raise-gcc.o
(...many, many lines...)
memcpy                              0x4c        sysdep.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: error: ld returned 1 exit status
gmake[5]: *** [gnatlib-shared-default] Error 1
gmake[5]: Leaving directory
`/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/gcc/ada'
gmake[4]: *** [gnatlib-shared-dual] Error 2

From asking around so far, it's similar to this minimal example:

static int c = 1;

int f(int a) {
       return a+c;
}

gcc -shared -o liba.so liba.c

Text relocation remains                         referenced
   against symbol                  offset      in file
c                                   0x4         /var/tmp//ccqHaWcX.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status

In this case, the fix is to add -fpic to the invocation. But in the
build logs I do see -fPIC, and it still fails, so I'm not sure if it's
really the same kind of problem.

Has anyone else encountered this error?

Maciej

[1] https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/Makefile

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-18 18:11 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections Maciej (Matchek) Bliziński
@ 2012-06-19  5:47 ` Tom G. Christensen
  2012-06-19 15:16   ` Tom Christensen
  2012-06-22  9:07   ` Maciej (Matchek) Bliziński
  0 siblings, 2 replies; 18+ messages in thread
From: Tom G. Christensen @ 2012-06-19  5:47 UTC (permalink / raw)
  To: gcc-help

On 06/18/2012 08:09 PM, Maciej (Matchek) Bliziński wrote:

<snip build error>
I see the same error on Solaris 8/x86.

<snip example>
> In this case, the fix is to add -fpic to the invocation. But in the
> build logs I do see -fPIC, and it still fails, so I'm not sure if it's
> really the same kind of problem.
>
Look closer in the buildlogs, you'll see that the objects that it is 
complaining about where not built with a pic flag.

The most likely candidate for having caused this break is this patch:
http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e8641b7435587c748491cc82c038ebcf41e6d4b6

It touches the picflags in the Ada subdir.

The fix is probably this commit that was made after 4.7.1 was tagged:
http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=176ff0f9a1016553978d6cf41770703e2ad90958

I'm starting a build now with this patch included, but it will be some 
hours before I have a result.

-tgc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-19  5:47 ` Tom G. Christensen
@ 2012-06-19 15:16   ` Tom Christensen
  2012-06-22  9:07   ` Maciej (Matchek) Bliziński
  1 sibling, 0 replies; 18+ messages in thread
From: Tom Christensen @ 2012-06-19 15:16 UTC (permalink / raw)
  Cc: gcc-help

On 06/19/2012 07:46 AM, Tom G. Christensen wrote:
> The fix is probably this commit that was made after 4.7.1 was tagged:
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=176ff0f9a1016553978d6cf41770703e2ad90958
>
> I'm starting a build now with this patch included, but it will be some
> hours before I have a result.
>
It works.
The buildlog shows that -fpic is now being passed to xgcc when building 
the objects used to link libgnat-4.7.so and the linking proceeds without 
issue.

Testresults will be posted in a day or two if all goes well.

-tgc


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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-19  5:47 ` Tom G. Christensen
  2012-06-19 15:16   ` Tom Christensen
@ 2012-06-22  9:07   ` Maciej (Matchek) Bliziński
  1 sibling, 0 replies; 18+ messages in thread
From: Maciej (Matchek) Bliziński @ 2012-06-22  9:07 UTC (permalink / raw)
  To: Tom G. Christensen; +Cc: gcc-help

2012/6/19 Tom G. Christensen <tgc@jupiterrise.com>:
> Look closer in the buildlogs, you'll see that the objects that it is
> complaining about where not built with a pic flag.

True.

> The most likely candidate for having caused this break is this patch:
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e8641b7435587c748491cc82c038ebcf41e6d4b6
>
> It touches the picflags in the Ada subdir.
>
> The fix is probably this commit that was made after 4.7.1 was tagged:
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=176ff0f9a1016553978d6cf41770703e2ad90958

Cool, that's it. The build completes fine after adding this patch. The
gcc-4.7.1 packages are now available from the OpenCSW unstable
catalog. Thanks for the help!

Maciej

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-22 13:59             ` Tom Christensen
@ 2012-06-22 15:56               ` Dennis Clarke
  0 siblings, 0 replies; 18+ messages in thread
From: Dennis Clarke @ 2012-06-22 15:56 UTC (permalink / raw)
  To: Tom Christensen; +Cc: gcc-help



----- Original Message -----
From: Tom Christensen <tgc@jupiterrise.com>
Date: Friday, June 22, 2012 9:59 am
Subject: Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
To: Dennis Clarke <dclarke@blastwave.org>
Cc: gcc-help@gcc.gnu.org


> On 06/22/2012 12:30 PM, Dennis Clarke wrote:
> > The general rule is, never change anything. Every test result I have 
> ever
> > posted is correct and pure because no source changes were ever required.
> >
> Good.
> 
> > GCC 4.7.1 however DOES require a patch even for it to build on 
> Solaris at all.
> >
> Ofcourse, but that may not be clear to an outsider looking at the 
> testresults and wondering why his build is failing on Ada and yours didn't.
> 
> I try to only add results to the buildstat pages which are either 
> built 
> from unmodified sources or make it reasonably clear that modifications 
> 
> were made and where to find them.
> If Blastwave branded testresults fail to pass those conditions then I 
> 
> won't add them.

Good criteria and I admire that. 

I am running another build right now without ADA to see what happens. 
Also, I will repost the previous test results with the diffs on those
two Makefile.in's. 

dc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-22 10:30           ` Dennis Clarke
@ 2012-06-22 13:59             ` Tom Christensen
  2012-06-22 15:56               ` Dennis Clarke
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Christensen @ 2012-06-22 13:59 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc-help

On 06/22/2012 12:30 PM, Dennis Clarke wrote:
> The general rule is, never change anything. Every test result I have ever
> posted is correct and pure because no source changes were ever required.
>
Good.

> GCC 4.7.1 however DOES require a patch even for it to build on Solaris at all.
>
Ofcourse, but that may not be clear to an outsider looking at the 
testresults and wondering why his build is failing on Ada and yours didn't.

I try to only add results to the buildstat pages which are either built 
from unmodified sources or make it reasonably clear that modifications 
were made and where to find them.
If Blastwave branded testresults fail to pass those conditions then I 
won't add them.

-tgc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-22  5:21         ` Tom G. Christensen
@ 2012-06-22 10:30           ` Dennis Clarke
  2012-06-22 13:59             ` Tom Christensen
  0 siblings, 1 reply; 18+ messages in thread
From: Dennis Clarke @ 2012-06-22 10:30 UTC (permalink / raw)
  To: Tom G. Christensen; +Cc: gcc-help

> > Well this was my first pass where I edited the necessary files by
> > hand and tested to see if I get a valid build. I totally ignored
> > the parts for win32 platforms and thus this is a very stilted
> > hacked patch.
> >
> Given the large amount of information you inject into your testresults
>
> otherwise, I am disappointed to learn that you would leave out details
>
> of source modifications done.
> I don't think I can continue to add blastwave testresults to the
> buildstat pages knowing that.

Drinking a little too much coffee there ?

The general rule is, never change anything. Every test result I have ever
posted is correct and pure because no source changes were ever required.

GCC 4.7.1 however DOES require a patch even for it to build on Solaris at all.

Don't get so serious there Tom.

Dennis 

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-21 16:47       ` Dennis Clarke
@ 2012-06-22  5:21         ` Tom G. Christensen
  2012-06-22 10:30           ` Dennis Clarke
  0 siblings, 1 reply; 18+ messages in thread
From: Tom G. Christensen @ 2012-06-22  5:21 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc-help

On 06/21/2012 06:46 PM, Dennis Clarke wrote:
> ----- Original Message -----
> From: Tom Christensen<tgc@jupiterrise.com>
> Date: Thursday, June 21, 2012 1:34 am
> Subject: Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
> To: Dennis Clarke<dclarke@blastwave.org>
> Cc: gcc-help@gcc.gnu.org
>
>
>> On 06/20/2012 08:12 PM, Dennis Clarke wrote:
>>> this is where I stand on Solaris 8 i386 :
>>> http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01790.html
>>>
>> No mention of any patches?
>
> Well this was my first pass where I edited the necessary files by
> hand and tested to see if I get a valid build. I totally ignored
> the parts for win32 platforms and thus this is a very stilted
> hacked patch.
>
Given the large amount of information you inject into your testresults 
otherwise, I am disappointed to learn that you would leave out details 
of source modifications done.
I don't think I can continue to add blastwave testresults to the 
buildstat pages knowing that.

> Any issues with install ?
>
None.

Packages have been made, someday I might even put them online.

-tgc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-21  5:34     ` Tom Christensen
@ 2012-06-21 16:47       ` Dennis Clarke
  2012-06-22  5:21         ` Tom G. Christensen
  0 siblings, 1 reply; 18+ messages in thread
From: Dennis Clarke @ 2012-06-21 16:47 UTC (permalink / raw)
  To: Tom Christensen; +Cc: gcc-help

----- Original Message -----
From: Tom Christensen <tgc@jupiterrise.com>
Date: Thursday, June 21, 2012 1:34 am
Subject: Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
To: Dennis Clarke <dclarke@blastwave.org>
Cc: gcc-help@gcc.gnu.org


> On 06/20/2012 08:12 PM, Dennis Clarke wrote:
> > this is where I stand on Solaris 8 i386 :
> > http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01790.html
> >
> No mention of any patches?

Well this was my first pass where I edited the necessary files by
hand and tested to see if I get a valid build. I totally ignored 
the parts for win32 platforms and thus this is a very stilted 
hacked patch. 

# diff ./libada/Makefile.in ./libada/Makefile.in_backup
57c57
< GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(PICFLAG) \
---
> GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \


and this one : 

 
# diff ./gcc/ada/gcc-interface/Makefile.in ./gcc/ada/gcc-interface/Makefile.in_backup
118c118
< GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET) \
---
> GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
2646c2646
<            GNATLIBCFLAGS="$(GNATLIBCFLAGS)" $(PICFLAG_FOR_TARGET)" \
---
>            GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \


Seemed to be the absolute minimal effort required and minimal changes
to achieve the result. 

> > How are your tests going ?
> >
> http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01781.html
> 
> Seems about the same as 4.7.0 for this host.

Any issues with install ? 

When I run make install I get this foo : 

.
.
.
gmake ada/doctools/xgnatugn
gmake[3]: Entering directory `/opt/bw/src/gcc-4.7.1-SunOS5.8-i386/gcc'
mkdir -p ada/doctools
cp -p ../../gcc-4.7.1/gcc/ada/xgnatugn.adb ada/doctools
cd ada/doctools && gnatmake -q xgnatugn
gnatmake: "xgnatugn.ali" incompatible ALI file, please recompile
gnatmake: "xgnatugn.adb" compilation error
gmake[3]: *** [ada/doctools/xgnatugn] Error 4
gmake[3]: Leaving directory `/opt/bw/src/gcc-4.7.1-SunOS5.8-i386/gcc'
gmake[2]: *** [doc/projects.texi] Error 2
gmake[2]: Leaving directory `/opt/bw/src/gcc-4.7.1-SunOS5.8-i386/gcc'
gmake[1]: *** [install-gcc] Error 2
gmake[1]: Leaving directory `/opt/bw/src/gcc-4.7.1-SunOS5.8-i386'
gmake: *** [install] Error 2
# 


That annoys the heck out of me as the build looks good but can not
be installed due to a problem with gnat.  I may toss ada over my shoulders
and march forwards regardless. 

Dennis 


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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-20 18:12   ` Dennis Clarke
@ 2012-06-21  5:34     ` Tom Christensen
  2012-06-21 16:47       ` Dennis Clarke
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Christensen @ 2012-06-21  5:34 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc-help

On 06/20/2012 08:12 PM, Dennis Clarke wrote:
> this is where I stand on Solaris 8 i386 :
> http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01790.html
>
No mention of any patches?

> How are your tests going ?
>
http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01781.html

Seems about the same as 4.7.0 for this host.

-tgc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-19 18:55 ` Tom Christensen
@ 2012-06-20 18:12   ` Dennis Clarke
  2012-06-21  5:34     ` Tom Christensen
  0 siblings, 1 reply; 18+ messages in thread
From: Dennis Clarke @ 2012-06-20 18:12 UTC (permalink / raw)
  To: Tom Christensen; +Cc: gcc-help


> On 06/19/2012 07:53 PM, Dennis Clarke wrote:
> >
> > ah .. thanks.  must back that out on Sol 8 .
> >
> Either that or apply the fix (which is what I've done).
> Also it presumably affects all Solaris releases as you've already noticed.


this is where I stand on Solaris 8 i386 :  

http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01790.html

How are your tests going ? 

My Sparc builds are still churning at the moment. 

Dennis 

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
@ 2012-06-19 19:16 Dennis Clarke
  0 siblings, 0 replies; 18+ messages in thread
From: Dennis Clarke @ 2012-06-19 19:16 UTC (permalink / raw)
  To: Tom Christensen; +Cc: dclarke, gcc-help


> On 06/19/2012 07:53 PM, Dennis Clarke wrote:
>>
>> ah .. thanks.  must back that out on Sol 8 .
>>
> Either that or apply the fix (which is what I've done).

That is the better way to go clearly.

> Also it presumably affects all Solaris releases as you've already
> noticed.

annoying and yes, true.

dc


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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-19 17:54 Dennis Clarke
@ 2012-06-19 18:55 ` Tom Christensen
  2012-06-20 18:12   ` Dennis Clarke
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Christensen @ 2012-06-19 18:55 UTC (permalink / raw)
  To: dclarke; +Cc: gcc-help

On 06/19/2012 07:53 PM, Dennis Clarke wrote:
>
> ah .. thanks.  must back that out on Sol 8 .
>
Either that or apply the fix (which is what I've done).
Also it presumably affects all Solaris releases as you've already noticed.

> Have you done any tests in Linux land ?
>
No.

-tgc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
@ 2012-06-19 17:54 Dennis Clarke
  2012-06-19 18:55 ` Tom Christensen
  0 siblings, 1 reply; 18+ messages in thread
From: Dennis Clarke @ 2012-06-19 17:54 UTC (permalink / raw)
  To: Tom Christensen; +Cc: dclarke, gcc-help


> On 06/19/2012 06:53 PM, Dennis Clarke wrote:
>> The patch which triggers this issues seems to be this :
>>
> <snip patch>
> No that's the fix, it adds back PICFLAG_FOR_TARGET which had been
> removed by a patch a few days before 4.7.1 was tagged.
>
> This is the patch that broke it:
> http://gcc.gnu.org/git/?p=gcc.git;a=patch;h=e8641b7435587c748491cc82c038ebcf41e6d4b6
>

ah .. thanks.  must back that out on Sol 8 .

On other fronts I am not seeing brilliant results on Linux either :


http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01675.html

Have you done any tests in Linux land ?

dc



-- 
--
http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x1D936C72FA35B44B
+-------------------------+-----------------------------------+
| Dennis Clarke           | Solaris and Linux and Open Source |
| dclarke@blastwave.org   | Respect for open standards.       |
+-------------------------+-----------------------------------+

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
  2012-06-19 16:54 Dennis Clarke
@ 2012-06-19 17:39 ` Tom Christensen
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Christensen @ 2012-06-19 17:39 UTC (permalink / raw)
  To: dclarke; +Cc: gcc-help

On 06/19/2012 06:53 PM, Dennis Clarke wrote:
> The patch which triggers this issues seems to be this :
>
<snip patch>
No that's the fix, it adds back PICFLAG_FOR_TARGET which had been 
removed by a patch a few days before 4.7.1 was tagged.

This is the patch that broke it:
http://gcc.gnu.org/git/?p=gcc.git;a=patch;h=e8641b7435587c748491cc82c038ebcf41e6d4b6

-tgc

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
@ 2012-06-19 16:54 Dennis Clarke
  2012-06-19 17:39 ` Tom Christensen
  0 siblings, 1 reply; 18+ messages in thread
From: Dennis Clarke @ 2012-06-19 16:54 UTC (permalink / raw)
  To: Tom Christensen; +Cc: gcc-help


> On 06/19/2012 07:46 AM, Tom G. Christensen wrote:
>> The fix is probably this commit that was made after 4.7.1 was tagged:
>> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=176ff0f9a1016553978d6cf41770703e2ad90958
>>
>> I'm starting a build now with this patch included, but it will be some
>> hours before I have a result.
>>
> It works.
> The buildlog shows that -fpic is now being passed to xgcc when building
> the objects used to link libgnat-4.7.so and the linking proceeds without
> issue.
>
> Testresults will be posted in a day or two if all goes well.

another possibility is to not build ada. Not my preference.

The patch which triggers this issues seems to be this :

diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog


index 7e3195a..072a3f2 100644 (file)


--- a/gcc/ada/ChangeLog

+++ b/gcc/ada/ChangeLog

@@ -1,3 +1,8 @@

+2012-06-14  Jakub Jelinek  <jakub@redhat.com>

+

+       * gcc-interface/Makefile.in (gnatlib-shared-default): Append

+       $(PICFLAG_FOR_TARGET) to GNATLIBCFLAGS_FOR_C passed to submake.

+

 2012-06-14  Release Manager



        * GCC 4.7.1 released.



diff --git a/gcc/ada/gcc-interface/Makefile.in
b/gcc/ada/gcc-interface/Makefile.in


index ee8db38..f9e7eda 100644 (file)


--- a/gcc/ada/gcc-interface/Makefile.in

+++ b/gcc/ada/gcc-interface/Makefile.in

@@ -2597,7 +2597,7 @@ gnatlib-shared-default:

        $(MAKE) $(FLAGS_TO_PASS) \

              GNATLIBFLAGS="$(GNATLIBFLAGS)" \

             GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \

-            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \

+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \

             MULTISUBDIR="$(MULTISUBDIR)" \

             THREAD_KIND="$(THREAD_KIND)" \

              gnatlib



>

dc

-- 
--
http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x1D936C72FA35B44B
+-------------------------+-----------------------------------+
| Dennis Clarke           | Solaris and Linux and Open Source |
| dclarke@blastwave.org   | Respect for open standards.       |
+-------------------------+-----------------------------------+

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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
@ 2012-06-19  6:42 Dennis Clarke
  0 siblings, 0 replies; 18+ messages in thread
From: Dennis Clarke @ 2012-06-19  6:42 UTC (permalink / raw)
  To: Tom G. Christensen; +Cc: gcc-help


> On 06/18/2012 08:09 PM, Maciej (Matchek) Bliziński wrote:
>
> <snip build error>
> I see the same error on Solaris 8/x86.
>
> <snip example>
>> In this case, the fix is to add -fpic to the invocation. But in the
>> build logs I do see -fPIC, and it still fails, so I'm not sure if it's
>> really the same kind of problem.
>>
> Look closer in the buildlogs, you'll see that the objects that it is
> complaining about where not built with a pic flag.
>
> The most likely candidate for having caused this break is this patch:
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e8641b7435587c748491cc82c038ebcf41e6d4b6
>
> It touches the picflags in the Ada subdir.
>
> The fix is probably this commit that was made after 4.7.1 was tagged:
> http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=176ff0f9a1016553978d6cf41770703e2ad90958
>
> I'm starting a build now with this patch included, but it will be some
> hours before I have a result.
>

Thank you very much Tom. I generally go looking for your results as a
comparison to see if I am heading in the right direction.  Having
independant results is a "good thing".

Dennis Clarke


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

* Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections
@ 2012-06-18 18:22 Dennis Clarke
  0 siblings, 0 replies; 18+ messages in thread
From: Dennis Clarke @ 2012-06-18 18:22 UTC (permalink / raw)
  To: Maciej Bliziński; +Cc: gcc-help


I hit the exact same problem on Solaris 8/9/10 and simply tossed
it over my shoulder and ignored it for a while. I know that some
folks will say "use gas/gld from binutils" however that simply is
not reasonable on Solaris systems.

Dennis

ps: sorry for the top post

> I've hit a build problem when upgrading from 4.7.0 to 4.7.1. I'm using
> the same build recipe[1], so it's most probably a change in GCC code.
> The immediate error I'm hitting is this:
>
> rm -f rts/libgna*.so
> cd rts; `echo
> "/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/./gcc/xgcc
> -B/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/./gcc/
> -B/opt/csw/sparc-sun-solaris2.10/bin/
> -B/opt/csw/sparc-sun-solaris2.10/lib/ -isystem
> /opt/csw/sparc-sun-solaris2.10/include -isystem
> /opt/csw/sparc-sun-solaris2.10/sys-include   " \
>                 | sed -e 's,\./xgcc,../../xgcc,' -e
> 's,-B\./,-B../../,'` -shared -g -O2  \
>         -fPIC \
>         -o libgnat-4.7.so \
>         a-assert.o (...) raise-gcc.o \
>         -Wl,-h,libgnat-4.7.so \
>         -lposix4 -lnsl -lsocket -lm
> Text relocation remains                         referenced
>     against symbol                  offset      in file
> <unknown>                           0x0         raise-gcc.o
> (...many, many lines...)
> memcpy                              0x4c        sysdep.o
> ld: fatal: relocations remain against allocatable but non-writable sections
> collect2: error: ld returned 1 exit status
> gmake[5]: *** [gnatlib-shared-default] Error 1
> gmake[5]: Leaving directory
> `/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/gcc/ada'
> gmake[4]: *** [gnatlib-shared-dual] Error 2
>
> From asking around so far, it's similar to this minimal example:
>
> static int c = 1;
>
> int f(int a) {
>        return a+c;
> }
>
> gcc -shared -o liba.so liba.c
>
> Text relocation remains                         referenced
>    against symbol                  offset      in file
> c                                   0x4         /var/tmp//ccqHaWcX.o
> ld: fatal: relocations remain against allocatable but non-writable sections
> collect2: ld returned 1 exit status
>
> In this case, the fix is to add -fpic to the invocation. But in the
> build logs I do see -fPIC, and it still fails, so I'm not sure if it's
> really the same kind of problem.
>
> Has anyone else encountered this error?
>
> Maciej
>
> [1]
> https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/Makefile
>


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

end of thread, other threads:[~2012-06-22 15:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-18 18:11 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections Maciej (Matchek) Bliziński
2012-06-19  5:47 ` Tom G. Christensen
2012-06-19 15:16   ` Tom Christensen
2012-06-22  9:07   ` Maciej (Matchek) Bliziński
2012-06-18 18:22 Dennis Clarke
2012-06-19  6:42 Dennis Clarke
2012-06-19 16:54 Dennis Clarke
2012-06-19 17:39 ` Tom Christensen
2012-06-19 17:54 Dennis Clarke
2012-06-19 18:55 ` Tom Christensen
2012-06-20 18:12   ` Dennis Clarke
2012-06-21  5:34     ` Tom Christensen
2012-06-21 16:47       ` Dennis Clarke
2012-06-22  5:21         ` Tom G. Christensen
2012-06-22 10:30           ` Dennis Clarke
2012-06-22 13:59             ` Tom Christensen
2012-06-22 15:56               ` Dennis Clarke
2012-06-19 19:16 Dennis Clarke

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