public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building Linux x86_64 to AIX PowerPC cross-compiler
@ 2022-06-14 16:18 Paul Lucas
  2022-06-14 18:33 ` fedor_qd
  2022-06-15 11:36 ` Kai Ruottu
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Lucas @ 2022-06-14 16:18 UTC (permalink / raw)
  To: gcc-help

Hi there -

I want to build a cross-compiler from Linux x86_64 (host) to AIX PowerPC (target).  Eventually, while building gcc, I get:

> collect2: fatal error: libgcc.a: cannot open as COFF file


While Linux uses ELF and AIX uses coff, I would have assumed that the binutils I built for the cross-compiler would have produced a linker that was able to link COFF files.

The configure for binutils was:

> configure --disable-gold --prefix=/aix-powerpc --disable-multilib --disable-nls --target=powerpc-ibm-aix7.1.0.0 --with-sysroot=/aix-powerpc --with-arch=powerpc --disable-werror --enable-plugins

where /aix-powerpc contains headers and libraries copied from a live AIX system.

Apparently back in 2016 on this same mailing list:

	https://gcc.gnu.org/legacy-ml/gcc-help/2016-10/msg00108.html

somebody was trying to build the same cross-compiler and got the same error.  Unfortunately, there’s no answer there. The only advice given was:

> Judicious use of "-v" can help spot calling the wrong linker, linking the wrong libraries, wrong header file include paths, etc.


Can anyone perhaps give a _little_ more help?

Thanks.

- Paul


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

* Re: Building Linux x86_64 to AIX PowerPC cross-compiler
  2022-06-14 16:18 Building Linux x86_64 to AIX PowerPC cross-compiler Paul Lucas
@ 2022-06-14 18:33 ` fedor_qd
  2022-06-15 11:36 ` Kai Ruottu
  1 sibling, 0 replies; 4+ messages in thread
From: fedor_qd @ 2022-06-14 18:33 UTC (permalink / raw)
  To: Paul Lucas; +Cc: gcc-help


Do you build cross binutils before gcc? Check them carefully.
Before build in shell use "export LDFLAGS+= -v " for verbose output.
--
Sent from Outlook Email App for Android аўторак, 14 чэрвеня 2022, 07:28PM +03:00 from Paul Lucas via Gcc-help  gcc-help@gcc.gnu.org :

>Hi there -
>
>I want to build a cross-compiler from Linux x86_64 (host) to AIX PowerPC (target).  Eventually, while building gcc, I get:
>
> collect2: fatal error: libgcc.a: cannot open as COFF file
>
>While Linux uses ELF and AIX uses coff, I would have assumed that the binutils I built for the cross-compiler would have produced a linker that was able to link COFF files.
>
>The configure for binutils was:
>
> configure --disable-gold --prefix=/aix-powerpc --disable-multilib --disable-nls --target=powerpc-ibm-aix7.1.0.0 --with-sysroot=/aix-powerpc --with-arch=powerpc --disable-werror --enable-plugins
>
>where /aix-powerpc contains headers and libraries copied from a live AIX system.
>
>Apparently back in 2016 on this same mailing list:
>
>https://gcc.gnu.org/legacy-ml/gcc-help/2016-10/msg00108.html
>
>somebody was trying to build the same cross-compiler and got the same error.  Unfortunately, there’s no answer there. The only advice given was:
>
> Judicious use of "-v" can help spot calling the wrong linker, linking the wrong libraries, wrong header file include paths, etc.
>
>
>Can anyone perhaps give a _little_ more help?
>
>Thanks.
>
>- Paul
>

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

* Re: Building Linux x86_64 to AIX PowerPC cross-compiler
  2022-06-14 16:18 Building Linux x86_64 to AIX PowerPC cross-compiler Paul Lucas
  2022-06-14 18:33 ` fedor_qd
@ 2022-06-15 11:36 ` Kai Ruottu
  2022-06-15 23:06   ` Brian Groose
  1 sibling, 1 reply; 4+ messages in thread
From: Kai Ruottu @ 2022-06-15 11:36 UTC (permalink / raw)
  To: Paul Lucas, gcc-help

Paul Lucas via Gcc-help kirjoitti 14.6.2022 klo 19.18:
> Hi there -
>
> I want to build a cross-compiler from Linux x86_64 (host) to AIX PowerPC (target).  Eventually, while building gcc, I get:
>
>> collect2: fatal error: libgcc.a: cannot open as COFF file
>
> While Linux uses ELF and AIX uses coff, I would have assumed that the binutils I built for the cross-compiler would have produced a linker that was able to link COFF files.
>
> The configure for binutils was:
>
>> configure --disable-gold --prefix=/aix-powerpc --disable-multilib --disable-nls --target=powerpc-ibm-aix7.1.0.0 --with-sysroot=/aix-powerpc --with-arch=powerpc --disable-werror --enable-plugins
> where /aix-powerpc contains headers and libraries copied from a live AIX system.


The GNU Install documents for target platforms :

https://gcc.gnu.org/install/specific.html#x-ibm-aix

are saying :

"The native |as| and |ld| are recommended for bootstrapping on AIX. The 
GNU Assembler, GNU Linker, and GNU Binutils version 2.20 is the minimum 
level that supports bootstrap on AIX 5. The GNU Assembler has not been 
updated to support AIX 6 or AIX 7. The native AIX tools do interoperate 
with GCC."

So it seems that AIX 6 and AIX 7 aren't supported in GNU binutils :(

The biggest problem in this issue probaly is that so few people can get 
the "headers and libraries copied from a live AIX system". Or IBM or 
something would provide them freely
for everyone wanting to make crosscompilers for AIX. Those who have AIX 
systems just produce native GNU tools and are happy. Others aren't 
interested to work with cross
tools they cannot make...
For instance the Sun Solaris2 headers and libraries have beem freely 
available just like the whole Sparc/x86 operating systems. So anyone 
could have procuded crosstools for these
platforms if having the required know-how for building GNU tools.

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

* Re: Building Linux x86_64 to AIX PowerPC cross-compiler
  2022-06-15 11:36 ` Kai Ruottu
@ 2022-06-15 23:06   ` Brian Groose
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Groose @ 2022-06-15 23:06 UTC (permalink / raw)
  To: Kai Ruottu; +Cc: Paul Lucas, gcc-help

On Wed, Jun 15, 2022 at 7:37 AM Kai Ruottu <kai.ruottu@wippies.com> wrote:
>
> Paul Lucas via Gcc-help kirjoitti 14.6.2022 klo 19.18:
> > Hi there -
> >
> > I want to build a cross-compiler from Linux x86_64 (host) to AIX PowerPC (target).  Eventually, while building gcc, I get:
> >
> >> collect2: fatal error: libgcc.a: cannot open as COFF file
> >
> > While Linux uses ELF and AIX uses coff, I would have assumed that the binutils I built for the cross-compiler would have produced a linker that was able to link COFF files.
> >
> > The configure for binutils was:
> >
> >> configure --disable-gold --prefix=/aix-powerpc --disable-multilib --disable-nls --target=powerpc-ibm-aix7.1.0.0 --with-sysroot=/aix-powerpc --with-arch=powerpc --disable-werror --enable-plugins
> > where /aix-powerpc contains headers and libraries copied from a live AIX system.
>
>
> The GNU Install documents for target platforms :
>
> https://gcc.gnu.org/install/specific.html#x-ibm-aix
>
> are saying :
>
> "The native |as| and |ld| are recommended for bootstrapping on AIX. The
> GNU Assembler, GNU Linker, and GNU Binutils version 2.20 is the minimum
> level that supports bootstrap on AIX 5. The GNU Assembler has not been
> updated to support AIX 6 or AIX 7. The native AIX tools do interoperate
> with GCC."
>
> So it seems that AIX 6 and AIX 7 aren't supported in GNU binutils :(
>
> The biggest problem in this issue probaly is that so few people can get
> the "headers and libraries copied from a live AIX system". Or IBM or
> something would provide them freely
> for everyone wanting to make crosscompilers for AIX. Those who have AIX
> systems just produce native GNU tools and are happy. Others aren't
> interested to work with cross
> tools they cannot make...
> For instance the Sun Solaris2 headers and libraries have beem freely
> available just like the whole Sparc/x86 operating systems. So anyone
> could have procuded crosstools for these
> platforms if having the required know-how for building GNU tools.

I had also tried to get a Linux x86_64 cross compiler targeting AIX 6.1 several
years ago and was never able to make it work, the issue was always binutils
and not gcc.  Even when I compiled native binutils and gcc on AIX 6.1 I ended
up using the AIX versions of as/ld/ar/etc since they worked more reliably than
the binutils versions.  I eventually gave up on a cross compiler and continued
to natively compile, though cross compilation would have been a much nicer and
more scalable system.

I recall bumping into the docs that Kai quoted here, which confirmed
that it just
wasn't going to work since there was effectively no assembler that worked.

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

end of thread, other threads:[~2022-06-15 23:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 16:18 Building Linux x86_64 to AIX PowerPC cross-compiler Paul Lucas
2022-06-14 18:33 ` fedor_qd
2022-06-15 11:36 ` Kai Ruottu
2022-06-15 23:06   ` Brian Groose

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