* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
[not found] <bug-45053-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-25 10:46 ` rguenth at gcc dot gnu.org
2012-04-12 14:44 ` [Bug target/45053] " rhabarber1848 at web dot de
` (3 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-25 10:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-25 10:21:25 UTC ---
*** Bug 48278 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
[not found] <bug-45053-4@http.gcc.gnu.org/bugzilla/>
2011-03-25 10:46 ` [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc rguenth at gcc dot gnu.org
@ 2012-04-12 14:44 ` rhabarber1848 at web dot de
2012-04-13 22:37 ` rhabarber1848 at web dot de
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: rhabarber1848 at web dot de @ 2012-04-12 14:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
rhabarber1848 at web dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rhabarber1848 at web dot de
--- Comment #10 from rhabarber1848 at web dot de 2012-04-12 14:42:55 UTC ---
This bug is still present in 4.7.0.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
[not found] <bug-45053-4@http.gcc.gnu.org/bugzilla/>
2011-03-25 10:46 ` [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc rguenth at gcc dot gnu.org
2012-04-12 14:44 ` [Bug target/45053] " rhabarber1848 at web dot de
@ 2012-04-13 22:37 ` rhabarber1848 at web dot de
2013-02-07 8:37 ` amodra at gmail dot com
2013-02-07 8:41 ` amodra at gmail dot com
4 siblings, 0 replies; 13+ messages in thread
From: rhabarber1848 at web dot de @ 2012-04-13 22:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
--- Comment #11 from rhabarber1848 at web dot de 2012-04-13 22:35:58 UTC ---
Using this patch solves the problem here:
https://dev.openwrt.org/browser/trunk/toolchain/gcc/patches/4.7.0/870-ppc_no_crtsavres.patch
# ./powerpc-tuxbox-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./powerpc-tuxbox-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdk/libexec/gcc/powerpc-tuxbox-linux-gnu/4.7.0/lto-wrapper
Target: powerpc-tuxbox-linux-gnu
Configured with: ../gcc-4.7.0/configure --build=i686-pc-linux-gnu
--host=i686-pc-linux-gnu --target=powerpc-tuxbox-linux-gnu
--prefix=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdk
--with-sysroot=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdkroot
--with-native-system-header-dir=/include --enable-languages=c,c++
--with-cpu=823 --with-float=soft --enable-__cxa_atexit --disable-libmudflap
--disable-libgomp --disable-libssp
--with-gmp=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdk
--with-mpfr=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdk
--with-ppl=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdk
--with-cloog=/root/tuxbox/work_eglibc_dbox2_26_470/image/cdk
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--enable-threads=posix --enable-target-optspace --disable-nls
--enable-clocale=generic --disable-multilib --enable-c99 --enable-long-long
--enable-symvers=gnu --enable-shared
Thread model: posix
gcc version 4.7.0 (GCC)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
[not found] <bug-45053-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2012-04-13 22:37 ` rhabarber1848 at web dot de
@ 2013-02-07 8:37 ` amodra at gmail dot com
2013-02-07 8:41 ` amodra at gmail dot com
4 siblings, 0 replies; 13+ messages in thread
From: amodra at gmail dot com @ 2013-02-07 8:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
Alan Modra <amodra at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |amodra at gmail dot com
AssignedTo|unassigned at gcc dot |amodra at gmail dot com
|gnu.org |
--- Comment #12 from Alan Modra <amodra at gmail dot com> 2013-02-07 08:36:45 UTC ---
Some of the claims made in various comments are wrong, at least for current
gcc-4.7 svn rev 195829. Even the subject is wrong. libgcc_s.so *is* linked
with the crtsav/res objects. They are contained in libgcc.a, and libgcc.a is
used when linking libgcc_s.so. I have verified that libgcc_s.so built with -Os
due to --enable-target-optspace does need various _savegpr* and _restgpr*
functions.
Comment #4 shows the real problem nicely. Notice that the reference to
_savegpr_31 comes from crtend.o which the penultimate object on the linker
command line, *after* libgcc.a. So if no other object linked needs the
out-of-line register save functions they won't be extracted from libgcc.a.
$ nm crtbegin.o | grep gpr
U _restgpr_29_x
$ nm crtend.o | grep gpr
U _restgpr_31_x
U _savegpr_31
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
[not found] <bug-45053-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2013-02-07 8:37 ` amodra at gmail dot com
@ 2013-02-07 8:41 ` amodra at gmail dot com
4 siblings, 0 replies; 13+ messages in thread
From: amodra at gmail dot com @ 2013-02-07 8:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
--- Comment #13 from Alan Modra <amodra at gmail dot com> 2013-02-07 08:40:15 UTC ---
Created attachment 29382
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29382
Fix
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
@ 2010-07-24 13:23 ` mikpe at it dot uu dot se
2010-07-24 13:36 ` dv at vollmann dot ch
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: mikpe at it dot uu dot se @ 2010-07-24 13:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from mikpe at it dot uu dot se 2010-07-24 13:22 -------
The build on some targets including powerpc is supposed to create libgcc_s.so
as a linker script that inputs BOTH the real shared libgcc_s.so and the static
libgcc.a, as some symbols are only defined in the static libgcc. Please make
sure that you're preserving this linker script when installing gcc.
If you want to backport PR41175 to 4.4 then you also need to backport
config.gcc changes related to the powerpc linker script from r151568.
(ARM has the same issue. No I'm not responsible for this misdesign.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
2010-07-24 13:23 ` [Bug bootstrap/45053] " mikpe at it dot uu dot se
@ 2010-07-24 13:36 ` dv at vollmann dot ch
2010-07-24 19:36 ` mikpe at it dot uu dot se
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: dv at vollmann dot ch @ 2010-07-24 13:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dv at vollmann dot ch 2010-07-24 13:35 -------
Subject: Re: libgcc_s link command misses crtsavgpr_s
and crtresgpr_s for powerpc
On 07/24/10 15:22, mikpe at it dot uu dot se wrote:
> ------- Comment #2 from mikpe at it dot uu dot se 2010-07-24 13:22 -------
> The build on some targets including powerpc is supposed to create libgcc_s.so
> as a linker script that inputs BOTH the real shared libgcc_s.so and the static
> libgcc.a, as some symbols are only defined in the static libgcc. Please make
> sure that you're preserving this linker script when installing gcc.
>
> If you want to backport PR41175 to 4.4 then you also need to backport
> config.gcc changes related to the powerpc linker script from r151568.
>
> (ARM has the same issue. No I'm not responsible for this misdesign.)
>
>
This is not an issue of the linker script, as the linker script
doesn't give a DSO (correctly) access to hidden symbols in another
library of the same group.
You relly need to link those objects into libgcc_s, as those symbols
aren't fit for calling through dynamic symbol lookup.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
2010-07-24 13:23 ` [Bug bootstrap/45053] " mikpe at it dot uu dot se
2010-07-24 13:36 ` dv at vollmann dot ch
@ 2010-07-24 19:36 ` mikpe at it dot uu dot se
2010-08-05 14:38 ` paolo dot carlini at oracle dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: mikpe at it dot uu dot se @ 2010-07-24 19:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from mikpe at it dot uu dot se 2010-07-24 19:36 -------
Attempting to bootstrap 4.5.1-RC on powerpc-linux with --enable-target-optspace
fails near the end of stage1 while configuring libgomp:
configure:3658: checking for C compiler default output file name
configure:3680: /home/mikpe/objdir/./gcc/xgcc -B/home/mikpe/objdir/./gcc/
-B/tmp/install/powerpc-unknown-linux-gnu/bin/
-B/tmp/install/powerpc-unknown-linux-gnu/lib/ -isystem
/tmp/install/powerpc-unknown-linux-gnu/include -isystem
/tmp/install/powerpc-unknown-linux-gnu/sys-include -g -Os conftest.c >&5
/home/mikpe/objdir/./gcc/crtend.o: In function `__do_global_ctors_aux':
crtstuff.c:(.text+0xc): undefined reference to `_savegpr_31'
collect2: ld returned 1 exit status
libgcc.a was built and does define _savegpr_31, and libgcc_s.so is the expected
linker script, and both files are available in the build directory.
So yes, --enable-target-optspace appears broken.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-07-24 19:36 ` mikpe at it dot uu dot se
@ 2010-08-05 14:38 ` paolo dot carlini at oracle dot com
2010-08-11 4:29 ` ian at airs dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-08-05 14:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from paolo dot carlini at oracle dot com 2010-08-05 14:38 -------
Ian, is this a libgcc issue? Can you suggest the best wa to triage it? Thanks.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ian at airs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-08-05 14:38 ` paolo dot carlini at oracle dot com
@ 2010-08-11 4:29 ` ian at airs dot com
2010-08-11 7:27 ` paolo dot carlini at oracle dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: ian at airs dot com @ 2010-08-11 4:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from ian at airs dot com 2010-08-11 04:28 -------
Yes, this is a libgcc issue. This kind of target-specific issue is normally
handled by the relevant backend maintainers.
I'm surprised that it doesn't work, as libgcc/config/rs6000/t-ppccomm includes
crtsavgpr.S and crtresgpr.S in LIB2ADD_ST. I would expect that to include the
required functions. But I haven't tried it, and apparently something goes
wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
` (4 preceding siblings ...)
2010-08-11 4:29 ` ian at airs dot com
@ 2010-08-11 7:27 ` paolo dot carlini at oracle dot com
2010-08-11 7:31 ` paolo dot carlini at oracle dot com
2010-08-11 10:56 ` dv at vollmann dot ch
7 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-08-11 7:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from paolo dot carlini at oracle dot com 2010-08-11 07:26 -------
Thanks for your feedback Ian. Now, I'm not sure which target maintainer to
suggest for powerpc-linux... David Edelsohn?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
` (5 preceding siblings ...)
2010-08-11 7:27 ` paolo dot carlini at oracle dot com
@ 2010-08-11 7:31 ` paolo dot carlini at oracle dot com
2010-08-11 10:56 ` dv at vollmann dot ch
7 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-08-11 7:31 UTC (permalink / raw)
To: gcc-bugs
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-08-11 07:30:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug bootstrap/45053] libgcc_s link command misses crtsavgpr_s and crtresgpr_s for powerpc
2010-07-24 12:42 [Bug bootstrap/45053] New: " gcc-bugzilla at gcc dot gnu dot org
` (6 preceding siblings ...)
2010-08-11 7:31 ` paolo dot carlini at oracle dot com
@ 2010-08-11 10:56 ` dv at vollmann dot ch
7 siblings, 0 replies; 13+ messages in thread
From: dv at vollmann dot ch @ 2010-08-11 10:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dv at vollmann dot ch 2010-08-11 10:56 -------
Subject: Re: libgcc_s link command misses crtsavgpr_s
and crtresgpr_s for powerpc
@Ian:
> I'm surprised that it doesn't work, as libgcc/config/rs6000/t-ppccomm includes
> crtsavgpr.S and crtresgpr.S in LIB2ADD_ST. I would expect that to include the
> required functions.
Maybe the problem is that the functions are only referenced if you use
-Os. So if there's some automatism going on that collects all the
required symbols, this automatism needs to use -Os for target-optspace.
But I have no real idea how the build process works, so this is just
guessing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
^ permalink raw reply [flat|nested] 13+ messages in thread