public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/31033]  New: Collect2 will not allow shared gcc with cross compiler
@ 2007-03-04  7:53 kstemen at centeris dot com
  2007-03-20 21:40 ` [Bug c/31033] " dje at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: kstemen at centeris dot com @ 2007-03-04  7:53 UTC (permalink / raw)
  To: gcc-bugs

First off, here's what I passed to the gcc configure script:
CC=gcc
CC="$CC" CFLAGS="" CXXFLAGS="" CPPFLAGS="" ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info \
        --enable-shared --enable-threads=posix --enable-checking=release \
        --with-system-zlib --disable-libunwind-exceptions \
        --prefix=/usr --exec-prefix=/usr \
        --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc \
        --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 \
        --libexecdir=/usr/libexec --localstatedir=/var \
        --sharedstatedir=/usr/com --mandir=/usr/share/man \
        --infodir=/usr/share/info \
        --without-long-double-128 \
        --enable-languages=c \
        --host=x86_64-redhat-linux --build=x86_64-redhat-linux \
        --target=powerpc-ibm-aix5.3.0 --with-cpu=default32 \
        --with-gnu-as --with-gnu-ld --enable-libssp=no \
        --with-sysroot=/usr/powerpc-ibm-aix5.3.0/sys-root

If I try to compile hello world on the resultant compiler with the following
options, it works (and runs on AIX):
[kyle@ryoko ~]$ powerpc-ibm-aix5.3.0-gcc -c hello.c 
[kyle@ryoko ~]$ powerpc-ibm-aix5.3.0-gcc hello.o -o hello
[kyle@ryoko ~]$ ls -l hello
-rwxrwxr-x 1 kyle kyle 282114 Mar  3 23:41 hello

Howerver, if I try to compile it with a shared libgcc, it fails:
[kyle@ryoko ~]$ powerpc-ibm-aix5.3.0-gcc -c hello.c 
[kyle@ryoko ~]$ powerpc-ibm-aix5.3.0-gcc -shared-libgcc hello.o -o hello
collect2: init function found in object
/usr/lib64/gcc/powerpc-ibm-aix5.3.0/4.1.1/../../../../powerpc-ibm-aix5.3.0/lib/libgcc_s.a

I have tracked the error message down to the collect2 program. It comes from
collect2.c. Collect2 will run nm on all of the libraries. If it finds a symbol
that starts with "GLOBAL__FI_", it will report that error, but only if collect2
is built as a cross compiler.

This shows that the native gcc in the AIX Toolbox works despite the same
export:
[kyle@ryoko ~]$ powerpc-ibm-aix5.3.0-nm
/usr/lib64/gcc/powerpc-ibm-aix5.3.0/4.1.1/../../../../powerpc-ibm-aix5.3.0/lib/libgcc_s.a
| grep GLOBAL__FI_
0000000010000238 T ._GLOBAL__FI_shr_o
0000000020000ae8 d _GLOBAL__FI_shr_o
0000000020000ae8 D _GLOBAL__FI_shr_o
[kyle@ryoko ~]$ scp hello.o testuser@aix64build:
testuser@localhost's password: 
hello.o                                       100% 1040     1.0KB/s   00:00    
[testuser@aix64build ~]$ nm
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/libgcc_s.a | grep
GLOBAL__FI_
._GLOBAL__FI_shr_o   T   268463976
_GLOBAL__FI_shr_o    D   536873824
_GLOBAL__FI_shr_o    d   536873824          12
[testuser@aix64build ~]$ gcc -shared-libgcc hello.o -o hello
[testuser@aix64build ~]$ ls -l hello
-rwxr-xr-x   1 testuser staff         17487 Mar 03 23:49 hello


-- 
           Summary: Collect2 will not allow shared gcc with cross compiler
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kstemen at centeris dot com
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: powerpc-ibm-aix5.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug c/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
@ 2007-03-20 21:40 ` dje at gcc dot gnu dot org
  2007-03-20 21:48 ` kstemen at centeris dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dje at gcc dot gnu dot org @ 2007-03-20 21:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dje at gcc dot gnu dot org  2007-03-20 21:40 -------
What tools are you using for the cross-compiler?  Cross-compiling to AIX is not
supported because the rest of the GNU crosstools are incomplete for AIX 5.


-- 

dje at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at gcc dot gnu dot org
 GCC target triplet|powerpc-ibm-aix5.3.0        |powerpc-ibm-aix5.3.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug c/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
  2007-03-20 21:40 ` [Bug c/31033] " dje at gcc dot gnu dot org
@ 2007-03-20 21:48 ` kstemen at centeris dot com
  2007-03-20 21:59 ` [Bug other/31033] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kstemen at centeris dot com @ 2007-03-20 21:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kstemen at centeris dot com  2007-03-20 21:45 -------
I'm trying to create rpms of cross compilers. I looked on the crosstools
website, but it doesn't look like it supports that. So I am more or less
building the cross compiler from scratch.

I noticed that C++ is unsupported when cross compiling to AIX. I attempted to
fix it, but I got stuck on this bug. 

If it would help you, I can give you the options I used to configure binutils,
and a list of the AIX libraries in my AIX sysroot.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug other/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
  2007-03-20 21:40 ` [Bug c/31033] " dje at gcc dot gnu dot org
  2007-03-20 21:48 ` kstemen at centeris dot com
@ 2007-03-20 21:59 ` pinskia at gcc dot gnu dot org
  2007-03-20 22:10 ` kstemen at centeris dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-20 21:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-03-20 21:59 -------
>If it would help you, I can give you the options I used to configure binutils,
> and a list of the AIX libraries in my AIX sysroot.

Does not matter, binutils does not support AIX 5.3 features.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |other


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug other/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
                   ` (2 preceding siblings ...)
  2007-03-20 21:59 ` [Bug other/31033] " pinskia at gcc dot gnu dot org
@ 2007-03-20 22:10 ` kstemen at centeris dot com
  2007-03-20 22:15 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kstemen at centeris dot com @ 2007-03-20 22:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kstemen at centeris dot com  2007-03-20 22:10 -------
Tell me what binutils doesn't support and I'll file a bug on binutils. I
already filed a bug about the default rpath in the cross compiler version of
gnu ld for AIX 5.3.0.0, and they fixed it. They didn't say anything about not
supporting AIX.

If cross-compiling to AIX 5 is not supported, why don't you say that in the AIX
specific notes at http://gcc.gnu.org/install/specific.html#x-ibm-aix instead of
letting people waste their time trying to get it to work? From all the
searching I've done online to get parts of it to work, this is the first time
I'm hearing that it's unsupported.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug other/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
                   ` (3 preceding siblings ...)
  2007-03-20 22:10 ` kstemen at centeris dot com
@ 2007-03-20 22:15 ` pinskia at gcc dot gnu dot org
  2007-03-20 22:19 ` kstemen at centeris dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-20 22:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-03-20 22:15 -------
"The native as and ld are recommended for bootstrapping on AIX 4 and required
for bootstrapping on AIX 5L. The GNU Assembler reports that it supports WEAK
symbols on AIX 4, which causes GCC to try to utilize weak symbol functionality
although it is not supported. The GNU Assembler and Linker do not support AIX
5L sufficiently to bootstrap GCC. The native AIX tools do interoperate with
GCC."

It is there already.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug other/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
                   ` (4 preceding siblings ...)
  2007-03-20 22:15 ` pinskia at gcc dot gnu dot org
@ 2007-03-20 22:19 ` kstemen at centeris dot com
  2007-03-20 22:41 ` dje at gcc dot gnu dot org
  2007-03-21 15:50 ` dje at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: kstemen at centeris dot com @ 2007-03-20 22:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from kstemen at centeris dot com  2007-03-20 22:19 -------
That says you can't bootstrap GCC on AIX 5L with GNU ld and as. It doesn't say
you can't build a cross compiler with them, and it doesn't say you can't use
them after GCC is bootstrapped.

In fact, I have looked at collect2's source code and using GNU ld and as would
probably work on native AIX after GCC is bootstrapped.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug other/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
                   ` (5 preceding siblings ...)
  2007-03-20 22:19 ` kstemen at centeris dot com
@ 2007-03-20 22:41 ` dje at gcc dot gnu dot org
  2007-03-21 15:50 ` dje at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: dje at gcc dot gnu dot org @ 2007-03-20 22:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dje at gcc dot gnu dot org  2007-03-20 22:41 -------
If GNU Binutils and Linker do not support AIX 5L sufficiently to bootstrap GCC,
then you should infer that does not support AIX 5L sufficiently for anything
"interesting", like shared libraries.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

* [Bug other/31033] Collect2 will not allow shared gcc with cross compiler
  2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
                   ` (6 preceding siblings ...)
  2007-03-20 22:41 ` dje at gcc dot gnu dot org
@ 2007-03-21 15:50 ` dje at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: dje at gcc dot gnu dot org @ 2007-03-21 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dje at gcc dot gnu dot org  2007-03-21 15:49 -------
This is not a GCC bug.  Binutils was updated to support AIX 4.3.3, but has not
been maintained, improved, or updated for AIX 5.  It can do simple things, but
does not fully support more advanced features.  For instance, some aspects of
shared object creation are not complete.


-- 

dje at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31033


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

end of thread, other threads:[~2007-03-21 15:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-04  7:53 [Bug c/31033] New: Collect2 will not allow shared gcc with cross compiler kstemen at centeris dot com
2007-03-20 21:40 ` [Bug c/31033] " dje at gcc dot gnu dot org
2007-03-20 21:48 ` kstemen at centeris dot com
2007-03-20 21:59 ` [Bug other/31033] " pinskia at gcc dot gnu dot org
2007-03-20 22:10 ` kstemen at centeris dot com
2007-03-20 22:15 ` pinskia at gcc dot gnu dot org
2007-03-20 22:19 ` kstemen at centeris dot com
2007-03-20 22:41 ` dje at gcc dot gnu dot org
2007-03-21 15:50 ` dje at gcc dot gnu dot org

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