public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem building cross-compiler for AIX 6.1
@ 2012-05-31 19:28 John M Collins
  2012-05-31 21:09 ` Jonathan Wakely
  2012-06-01 20:10 ` David Summers
  0 siblings, 2 replies; 5+ messages in thread
From: John M Collins @ 2012-05-31 19:28 UTC (permalink / raw)
  To: gcc-help

Please CC me as I'm not subscribed thanks

I am trying to build a cross-compiler with gcc-4.7.0 from Ubuntu Linux
to AIX6.1

I have build the binutils (2.22) OK

I have copied the include files and /usr/lib contents from AIX6.1 to
/home/crossenv/powerpc-ibm-aix6.1/include and .../lib

I am running:

../gcc-4.7.0/configure --target=powerpc-ibm-aix6.1
--prefix=/home/crossenv --disable-nls --enable-languages=c,c++
make all-gcc
make install-gcc
make all-target-libgcc

However it gets as far as the following on the last step

/bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
../../.././gcc/pthread
/usr/bin/install -c -m 644 libgcc_eh.a ../../.././gcc/pthread/
chmod 644 ../../.././gcc/pthread/libgcc_eh.a
/home/crossenv/powerpc-ibm-aix6.1/bin/ranlib
../../.././gcc/pthread/libgcc_eh.a
/bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
../../.././gcc/pthread; /usr/bin/install -c -m 644 pthread/libgcc_s.a
../../.././gcc/pthread/
/usr/bin/install: cannot stat `pthread/libgcc_s.a': No such file or
directory

I don't need threads straightaway, can I bypass this just to get off the
ground?

Thanks for any help people can give.

-- 
John Collins

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

* Re: Problem building cross-compiler for AIX 6.1
  2012-05-31 19:28 Problem building cross-compiler for AIX 6.1 John M Collins
@ 2012-05-31 21:09 ` Jonathan Wakely
  2012-05-31 22:02   ` John M Collins
  2012-06-01 20:10 ` David Summers
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Wakely @ 2012-05-31 21:09 UTC (permalink / raw)
  To: John M Collins; +Cc: gcc-help

On 31 May 2012 20:28, John M Collins wrote:
> Please CC me as I'm not subscribed thanks
>
> I am trying to build a cross-compiler with gcc-4.7.0 from Ubuntu Linux
> to AIX6.1
>
> I have build the binutils (2.22) OK
>
> I have copied the include files and /usr/lib contents from AIX6.1 to
> /home/crossenv/powerpc-ibm-aix6.1/include and .../lib
>
> I am running:
>
> ../gcc-4.7.0/configure --target=powerpc-ibm-aix6.1
> --prefix=/home/crossenv --disable-nls --enable-languages=c,c++

I'm no cross-compiler expert but shouldn't there be a --with-sysroot in there?

> make all-gcc
> make install-gcc
> make all-target-libgcc
>
> However it gets as far as the following on the last step
>
> /bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
> ../../.././gcc/pthread
> /usr/bin/install -c -m 644 libgcc_eh.a ../../.././gcc/pthread/
> chmod 644 ../../.././gcc/pthread/libgcc_eh.a
> /home/crossenv/powerpc-ibm-aix6.1/bin/ranlib
> ../../.././gcc/pthread/libgcc_eh.a
> /bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
> ../../.././gcc/pthread; /usr/bin/install -c -m 644 pthread/libgcc_s.a
> ../../.././gcc/pthread/
> /usr/bin/install: cannot stat `pthread/libgcc_s.a': No such file or
> directory
>
> I don't need threads straightaway, can I bypass this just to get off the
> ground?

You could try configuring GCC with --disable-threads

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

* Re: Problem building cross-compiler for AIX 6.1
  2012-05-31 21:09 ` Jonathan Wakely
@ 2012-05-31 22:02   ` John M Collins
  0 siblings, 0 replies; 5+ messages in thread
From: John M Collins @ 2012-05-31 22:02 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

On 31/05/12 22:08, Jonathan Wakely wrote:
> On 31 May 2012 20:28, John M Collins wrote:
>> Please CC me as I'm not subscribed thanks
>>
>> I am trying to build a cross-compiler with gcc-4.7.0 from Ubuntu Linux
>> to AIX6.1
>>
>> I have build the binutils (2.22) OK
>>
>> I have copied the include files and /usr/lib contents from AIX6.1 to
>> /home/crossenv/powerpc-ibm-aix6.1/include and .../lib
>>
>> I am running:
>>
>> ../gcc-4.7.0/configure --target=powerpc-ibm-aix6.1
>> --prefix=/home/crossenv --disable-nls --enable-languages=c,c++
> I'm no cross-compiler expert but shouldn't there be a --with-sysroot in there?
>
>> make all-gcc
>> make install-gcc
>> make all-target-libgcc
>>
>> However it gets as far as the following on the last step
>>
>> /bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
>> ../../.././gcc/pthread
>> /usr/bin/install -c -m 644 libgcc_eh.a ../../.././gcc/pthread/
>> chmod 644 ../../.././gcc/pthread/libgcc_eh.a
>> /home/crossenv/powerpc-ibm-aix6.1/bin/ranlib
>> ../../.././gcc/pthread/libgcc_eh.a
>> /bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
>> ../../.././gcc/pthread; /usr/bin/install -c -m 644 pthread/libgcc_s.a
>> ../../.././gcc/pthread/
>> /usr/bin/install: cannot stat `pthread/libgcc_s.a': No such file or
>> directory
>>
>> I don't need threads straightaway, can I bypass this just to get off the
>> ground?
> You could try configuring GCC with --disable-threads
>
I just tried that but it gave just the same error in the same place.

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

* Re: Problem building cross-compiler for AIX 6.1
  2012-05-31 19:28 Problem building cross-compiler for AIX 6.1 John M Collins
  2012-05-31 21:09 ` Jonathan Wakely
@ 2012-06-01 20:10 ` David Summers
  1 sibling, 0 replies; 5+ messages in thread
From: David Summers @ 2012-06-01 20:10 UTC (permalink / raw)
  To: gcc-help

With my experience, a few posts down.

First pass of gcc in a cross compiler, you have to disable both threads 
and shared. Problem is that both depend on files that you only create 
when you compile your target C library, and you can only compile that 
when you've a basic compiler working.

So first compile with --disable-shared --disable-threads

Then do your C lib

Then recompile with shared and threads enabled, and making sure you are 
pointing things to the new files created by the C lib ....

Hope this helps,

David.

On 31/05/12 20:28, John M Collins wrote:
> Please CC me as I'm not subscribed thanks
>
> I am trying to build a cross-compiler with gcc-4.7.0 from Ubuntu Linux
> to AIX6.1
>
> I have build the binutils (2.22) OK
>
> I have copied the include files and /usr/lib contents from AIX6.1 to
> /home/crossenv/powerpc-ibm-aix6.1/include and .../lib
>
> I am running:
>
> ../gcc-4.7.0/configure --target=powerpc-ibm-aix6.1
> --prefix=/home/crossenv --disable-nls --enable-languages=c,c++
> make all-gcc
> make install-gcc
> make all-target-libgcc
>
> However it gets as far as the following on the last step
>
> /bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
> ../../.././gcc/pthread
> /usr/bin/install -c -m 644 libgcc_eh.a ../../.././gcc/pthread/
> chmod 644 ../../.././gcc/pthread/libgcc_eh.a
> /home/crossenv/powerpc-ibm-aix6.1/bin/ranlib
> ../../.././gcc/pthread/libgcc_eh.a
> /bin/bash ../../../../gcc-4.7.0/libgcc/../mkinstalldirs
> ../../.././gcc/pthread; /usr/bin/install -c -m 644 pthread/libgcc_s.a
> ../../.././gcc/pthread/
> /usr/bin/install: cannot stat `pthread/libgcc_s.a': No such file or
> directory
>
> I don't need threads straightaway, can I bypass this just to get off the
> ground?
>
> Thanks for any help people can give.
>


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

* Re: Problem building cross-compiler for AIX 6.1
@ 2012-06-02 18:34 John M Collins
  0 siblings, 0 replies; 5+ messages in thread
From: John M Collins @ 2012-06-02 18:34 UTC (permalink / raw)
  To: gcc-help

> With my experience, a few posts down.
>
> First pass of gcc in a cross compiler, you have to disable both
> threads and shared. Problem is that both depend on files that you only
> create when you compile your target C library, and you can only
> compile that when you've a basic compiler working.
>
> So first compile with --disable-shared --disable-threads
>
> Then do your C lib
>
> Then recompile with shared and threads enabled, and making sure you
> are pointing things to the new files created by the C lib ....
>
> Hope this helps,
>
> David.

Thanks I tried that and I seemed to have a working C compiler which
compiled a "hello world" program without complaint but then when I
copied it to the AIX 6.1 machine the binary wouldn't work - it
complained about a missing "shr.o" in libc.a.

I then tried compiling it with -static but the link phase failed with

/home/crossenv/lib/gcc/powerpc-ibm-aix6.1/4.7.0/../../../../powerpc-ibm-aix6.1/bin/ld:
internal error ../../binutils-2.22/ld/ldlang.c 6147
collect2: error: ld returned 1 exit status

Seems to be an assertion fail in "collect2".

I tried asking about that in the binutils mailing list but no one has
replied yet.

This thing seems to be fighting me all the way, I can't get GCC to build
native on AIX 6.1

-- 
John Collins

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

end of thread, other threads:[~2012-06-02 18:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-31 19:28 Problem building cross-compiler for AIX 6.1 John M Collins
2012-05-31 21:09 ` Jonathan Wakely
2012-05-31 22:02   ` John M Collins
2012-06-01 20:10 ` David Summers
2012-06-02 18:34 John M Collins

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