public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* aix cross(?)compiler
@ 2011-12-14  8:36 Jędrzej Dudkiewicz
  2011-12-14  9:45 ` Jonathan Wakely
  2011-12-14 11:16 ` Kai Ruottu
  0 siblings, 2 replies; 15+ messages in thread
From: Jędrzej Dudkiewicz @ 2011-12-14  8:36 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm building gcc 4.6.2 (C and C++) on AIX 5.2 to compile for AIX
4.3.3. I copied libraries and /usr/ccs/bin (as, nm, ld and others)
from 4.3.3 to sysroot/ directory on AIX 5.2. I have build 32-bit
versions of gmp, mpc and fmpr libraries and installed them in
xgcc/libs directory (details in "configure" call below). This is how I
run configure:

AS_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/as \
LD_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ld \
STRIP_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/strip \
RANLIB_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ranlib \
AR_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ar \
NM_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/nm \
../src/gcc-4.6.2/configure \
         --prefix=/opt/xgcc/gcc-4.6.2 \
         --target=powerpc-ibm-aix4.3.3.0 \
         --with-mpfr=/opt/xgcc/libs/mpfr-3.1.0 \
         --with-mpc=/opt/xgcc/libs/mpc-0.8.2 \
         --with-gmp=/opt/xgcc/libs/gmp-5.0.2 \
         --enable-languages=c,c++ \
         --enable-threads \
         --enable-static \
         --disable-shared \
         --disable-ns \
         --enable-version-specific-runtime-libs \
         --with-build-sysroot=/home/jd/xcomp/sysroot \
         --with-as=/home/jd/xcomp/sysroot/usr/ccs/bin/as \
         --with-ld=/home/jd//xcomp/sysroot/usr/ccs/bin/ld \
         --with-headers=/home/jd/xcomp/sysroot/usr/include

Halfway throught compilation I receive the following error (make rerun
to reproduce):

make[4]: Entering directory
`/home/jd/xcomp/build/powerpc-ibm-aix4.3.3.0/pthread/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/home/jd/xcomp/build/./gcc/xgcc -B/home/jd/xcomp/build/./gcc/
-B/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/bin/
-B/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/lib/ -isystem
/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/include -isystem
/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/sys-include
--sysroot=/home/jd/xcomp/sysroot   -g -O2 -pthread -O2  -g -O2
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include  -mlong-double-128 -g
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-fno-stack-protector   -I. -I. -I../../.././gcc
-I../../../../src/gcc-4.6.2/libgcc
-I../../../../src/gcc-4.6.2/libgcc/.
-I../../../../src/gcc-4.6.2/libgcc/../gcc
-I../../../../src/gcc-4.6.2/libgcc/../include  -DHAVE_CC_TLS
-DUSE_EMUTLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF
unwind-dw2.dep -fexceptions -c
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind-dw2.c
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind-dw2.c: In function
'uw_init_context_1':
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind-dw2.c:1461:5: warning:
missing initializer [-Wmissing-field-initializers]
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind-dw2.c:1461:5: warning:
(near initialization for 'once_regsizes.__ptonce_mutex')
[-Wmissing-field-initializers]
In file included from
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind-dw2.c:1582:0:
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind.inc: In function
'_Unwind_ForcedUnwind_Phase2':
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind.inc:189:1: error:
unrecognizable insn:
(insn 34 33 35 8 (set (mem/v:DI (plus:DI (reg/f:SI 1 1)
                (const_int 20 [0x14])) [0 S8 A8])
        (reg:SI 2 2)) ../../../../src/gcc-4.6.2/libgcc/../gcc/unwind.inc:163 -1
     (nil))
../../../../src/gcc-4.6.2/libgcc/../gcc/unwind.inc:189:1: internal
compiler error: in extract_insn, at recog.c:2109
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [unwind-dw2.o] Error 1
make[4]: Leaving directory
`/home/jd/xcomp/build/powerpc-ibm-aix4.3.3.0/pthread/libgcc'
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/home/jd/xcomp/build/powerpc-ibm-aix4.3.3.0/libgcc'
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/home/jd/xcomp/build/powerpc-ibm-aix4.3.3.0/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/jd/xcomp/build'
make: *** [all] Error 2

I'm building using custom-built gcc 4.5.2:

[root@aix5_2 build]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/freeware/era-gcc-4.5.2/libexec/gcc/powerpc-ibm-aix5.3.0.0/4.5.2/lto-wrapper
Target: powerpc-ibm-aix5.3.0.0
Configured with: /jd/gccbuild/aix-4.5.2/gcc-4.5.2/configure
--with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++
--prefix=/opt/freeware/era-gcc-4.5.2/ --enable-threads
--enable-version-specific-runtime-libs --disable-shared
--program-suffix=-4.5.2 --disable-nls
Thread model: aix
gcc version 4.5.2 (GCC)

I'm more than willing to submit a full bug report with preprocessed
sources if appropriate, but first I'd like to know answers to the
following:

1) Am I building everything the right way,
2) What command should I use to get the preprocessed source: is it
enough to add "-E" and change "-o unwind-dw2.o" to "-o
preprocessed_source.c" in the compilation command?

TIA,
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

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

* Re: aix cross(?)compiler
  2011-12-14  8:36 aix cross(?)compiler Jędrzej Dudkiewicz
@ 2011-12-14  9:45 ` Jonathan Wakely
  2011-12-14 10:12   ` Jędrzej Dudkiewicz
  2012-01-21 18:19   ` Paul Smith
  2011-12-14 11:16 ` Kai Ruottu
  1 sibling, 2 replies; 15+ messages in thread
From: Jonathan Wakely @ 2011-12-14  9:45 UTC (permalink / raw)
  To: Jędrzej Dudkiewicz; +Cc: gcc-help

2011/12/14 Jędrzej Dudkiewicz:
>
> 1) Am I building everything the right way,

The process is much simpler if you let GCC build the GMP, MPFR and MPC
libs, instead of installing them separately. See
http://advogato.org/person/redi/diary/253.html

> 2) What command should I use to get the preprocessed source: is it
> enough to add "-E" and change "-o unwind-dw2.o" to "-o
> preprocessed_source.c" in the compilation command?

See the link in the error message for instructions:

> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.

That explains how to use -save-temps

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

* Re: aix cross(?)compiler
  2011-12-14  9:45 ` Jonathan Wakely
@ 2011-12-14 10:12   ` Jędrzej Dudkiewicz
  2011-12-14 11:09     ` Jonathan Wakely
  2012-01-21 18:19   ` Paul Smith
  1 sibling, 1 reply; 15+ messages in thread
From: Jędrzej Dudkiewicz @ 2011-12-14 10:12 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

2011/12/14 Jonathan Wakely <jwakely.gcc@gmail.com>:
> 2011/12/14 Jędrzej Dudkiewicz:
>>
>> 1) Am I building everything the right way,
>
> The process is much simpler if you let GCC build the GMP, MPFR and MPC
> libs, instead of installing them separately. See
> http://advogato.org/person/redi/diary/253.html

It's simpler, but results in errors. On AIX, by default, GCC is built
as 32-bit binary but aforementioned libraries are built in 64-bit
mode. Most probably it's possible to do everything in one shot, but I
have a habit of scripting everything, so building these libraries in
32-bit mode is as easy as running one script.

>> 2) What command should I use to get the preprocessed source: is it
>> enough to add "-E" and change "-o unwind-dw2.o" to "-o
>> preprocessed_source.c" in the compilation command?
>
> See the link in the error message for instructions:
>
>> Please submit a full bug report,
>> with preprocessed source if appropriate.
>> See <http://gcc.gnu.org/bugs.html> for instructions.
>
> That explains how to use -save-temps

Ah. Thanks!
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

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

* Re: aix cross(?)compiler
  2011-12-14 10:12   ` Jędrzej Dudkiewicz
@ 2011-12-14 11:09     ` Jonathan Wakely
  2011-12-14 11:29       ` Jędrzej Dudkiewicz
  0 siblings, 1 reply; 15+ messages in thread
From: Jonathan Wakely @ 2011-12-14 11:09 UTC (permalink / raw)
  To: Jędrzej Dudkiewicz; +Cc: gcc-help

2011/12/14 Jędrzej Dudkiewicz:
> 2011/12/14 Jonathan Wakely <jwakely.gcc@gmail.com>:
>> 2011/12/14 Jędrzej Dudkiewicz:
>>>
>>> 1) Am I building everything the right way,
>>
>> The process is much simpler if you let GCC build the GMP, MPFR and MPC
>> libs, instead of installing them separately. See
>> http://advogato.org/person/redi/diary/253.html
>
> It's simpler, but results in errors. On AIX, by default, GCC is built
> as 32-bit binary but aforementioned libraries are built in 64-bit
> mode. Most probably it's possible to do everything in one shot, but I
> have a habit of scripting everything, so building these libraries in
> 32-bit mode is as easy as running one script.

If you put the libraries in the GCC source tree they should be built
for the same architecture as GCC, if they are not, please report a
bug.

Are you installing dynamic libraries for gmp, mpfr and mpc?  If you
are, it's not as simple as running one script, because you need to
ensure they can be found by the dynamic linker at runtime.

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

* Re: aix cross(?)compiler
  2011-12-14  8:36 aix cross(?)compiler Jędrzej Dudkiewicz
  2011-12-14  9:45 ` Jonathan Wakely
@ 2011-12-14 11:16 ` Kai Ruottu
  2011-12-14 11:42   ` Jędrzej Dudkiewicz
  1 sibling, 1 reply; 15+ messages in thread
From: Kai Ruottu @ 2011-12-14 11:16 UTC (permalink / raw)
  To: gcc-help

14.12.2011 10:36, Jędrzej Dudkiewicz kirjoitti:
> Hi,
>
> I'm building gcc 4.6.2 (C and C++) on AIX 5.2 to compile for AIX
> 4.3.3. I copied libraries and /usr/ccs/bin (as, nm, ld and others)
> from 4.3.3 to sysroot/ directory on AIX 5.2.
>
> AS_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/as \
> LD_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ld \
> STRIP_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/strip \
> RANLIB_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ranlib \
> AR_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ar \
> NM_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/nm \

This makes the build to differ from the normal cross GCC case
where GNU binutils are used as the target binutils. Here the
native AIX 4.3.3 binutils are used on a AIX 5.2 cross host
as the target binutils. So my stupid question is whether this
choice should work at all?

>           --with-as=/home/jd/xcomp/sysroot/usr/ccs/bin/as \
>           --with-ld=/home/jd//xcomp/sysroot/usr/ccs/bin/ld \

These AIX 4.3.3 'as' and 'ld' seemingly don't crash on AIX 5.2
but :

> /home/jd/xcomp/build/./gcc/xgcc -B/home/jd/xcomp/build/./gcc/
> -B/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/bin/
> -B/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/lib/ -isystem
> /opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/include -isystem
> /opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/sys-include
> --sysroot=/home/jd/xcomp/sysroot

what about the native AIX 4.3.3 'ld' understanding where the
target library stuff is?  What the libgcc configure understood
about the target libraries?

If behaving normally, building GNU binutils for the AIX 5.2
$host and targeting to the AIX 4.3.3 $target and configuring
them using '--with-sysroot=' to search from $sysroot for the
AIX 4.3.3, there wouldn't be these suspicicions and stupid
questions... And any crash in the build would be a clear bug
but it is hard to say what this case really is.

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

* Re: aix cross(?)compiler
  2011-12-14 11:09     ` Jonathan Wakely
@ 2011-12-14 11:29       ` Jędrzej Dudkiewicz
  2011-12-14 12:07         ` Jonathan Wakely
  0 siblings, 1 reply; 15+ messages in thread
From: Jędrzej Dudkiewicz @ 2011-12-14 11:29 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

2011/12/14 Jonathan Wakely <jwakely.gcc@gmail.com>:
> 2011/12/14 Jędrzej Dudkiewicz:
>> 2011/12/14 Jonathan Wakely <jwakely.gcc@gmail.com>:
>>> 2011/12/14 Jędrzej Dudkiewicz:
>>>>
>>>> 1) Am I building everything the right way,
>>>
>>> The process is much simpler if you let GCC build the GMP, MPFR and MPC
>>> libs, instead of installing them separately. See
>>> http://advogato.org/person/redi/diary/253.html
>>
>> It's simpler, but results in errors. On AIX, by default, GCC is built
>> as 32-bit binary but aforementioned libraries are built in 64-bit
>> mode. Most probably it's possible to do everything in one shot, but I
>> have a habit of scripting everything, so building these libraries in
>> 32-bit mode is as easy as running one script.
>
> If you put the libraries in the GCC source tree they should be built
> for the same architecture as GCC, if they are not, please report a
> bug.

I can try it, but last time I tried it wasn't working. Note that here:

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

it is written:

Because GCC on AIX is built as a 32-bit executable by default,
(although it can generate 64-bit programs) the GMP and MPFR libraries
required by gfortran must be 32-bit libraries. Building GMP and MPFR
as static archive libraries works better than shared libraries.

My impression is that if you were right, this wouldn't be mentioned.
On the other hand it seems that not only gfortran requires them, so
maybe this whole part is wrong.

> Are you installing dynamic libraries for gmp, mpfr and mpc?  If you
> are, it's not as simple as running one script, because you need to
> ensure they can be found by the dynamic linker at runtime.

No, as in quoted text above: "Building GMP and MPFR as static archive
libraries works better than shared libraries".
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

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

* Re: aix cross(?)compiler
  2011-12-14 11:16 ` Kai Ruottu
@ 2011-12-14 11:42   ` Jędrzej Dudkiewicz
  2011-12-14 17:10     ` Kai Ruottu
  0 siblings, 1 reply; 15+ messages in thread
From: Jędrzej Dudkiewicz @ 2011-12-14 11:42 UTC (permalink / raw)
  To: gcc-help

On Wed, Dec 14, 2011 at 12:15 PM, Kai Ruottu <kai.ruottu@wippies.com> wrote:
 > 14.12.2011 10:36, Jędrzej Dudkiewicz kirjoitti:
 >>
 >> Hi,
 >>
 >> I'm building gcc 4.6.2 (C and C++) on AIX 5.2 to compile for AIX
 >> 4.3.3. I copied libraries and /usr/ccs/bin (as, nm, ld and others)
 >> from 4.3.3 to sysroot/ directory on AIX 5.2.
 >>
 >> AS_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/as \
 >> LD_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ld \
 >> STRIP_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/strip \
 >> RANLIB_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ranlib \
 >> AR_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/ar \
 >> NM_FOR_TARGET=/home/jd/xcomp/sysroot/usr/ccs/bin/nm \
 >
 >
 > This makes the build to differ from the normal cross GCC case
 > where GNU binutils are used as the target binutils. Here the
 > native AIX 4.3.3 binutils are used on a AIX 5.2 cross host
 > as the target binutils. So my stupid question is whether this
 > choice should work at all?

Well, it must :), otherwise building it is quite probably impossible,
 as it seems that GNU binutils do not fully support AIX - but I can't
 say for sure, as I were unable to find a definite list of supported
 systems. I tried building using GNU binutils, but 'as' refused to
 compile source code, claiming that it does not know about instruction
 fmul, if my memory serves well.

 >>          --with-as=/home/jd/xcomp/sysroot/usr/ccs/bin/as \
 >>          --with-ld=/home/jd//xcomp/sysroot/usr/ccs/bin/ld \
 >
 >
 > These AIX 4.3.3 'as' and 'ld' seemingly don't crash on AIX 5.2
 > but :

Well, RedHat 7.3 binaries do not crash on Fedora 16 for a reason :)

 >> /home/jd/xcomp/build/./gcc/xgcc -B/home/jd/xcomp/build/./gcc/
 >> -B/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/bin/
 >> -B/opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/lib/ -isystem
 >> /opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/include -isystem
 >> /opt/xgcc/gcc-4.6.2/powerpc-ibm-aix4.3.3.0/sys-include
 >> --sysroot=/home/jd/xcomp/sysroot
 >
 >
 > what about the native AIX 4.3.3 'ld' understanding where the
 > target library stuff is?  What the libgcc configure understood
 > about the target libraries?

I have no idea how to check it or what should I do to make it
 understand it - any hints or pointers to required literature? My
 understanding was that "--sysroot" forces gcc to provide 'ld' with
 required information.

 > If behaving normally, building GNU binutils for the AIX 5.2
 > $host and targeting to the AIX 4.3.3 $target and configuring
 > them using '--with-sysroot=' to search from $sysroot for the
 > AIX 4.3.3, there wouldn't be these suspicicions and stupid
 > questions... And any crash in the build would be a clear bug
 > but it is hard to say what this case really is.

If there is a list of systems supported by GNU binutils, I will
 happily consult it and if my system is listed as supported, I'll
 report errors as soon as I reproduce them.


--
 Jędrzej Dudkiewicz

 I really hate this damn machine, I wish that they would sell it.
 It never does just what I want, but only what I tell it.

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

* Re: aix cross(?)compiler
  2011-12-14 11:29       ` Jędrzej Dudkiewicz
@ 2011-12-14 12:07         ` Jonathan Wakely
  0 siblings, 0 replies; 15+ messages in thread
From: Jonathan Wakely @ 2011-12-14 12:07 UTC (permalink / raw)
  To: Jędrzej Dudkiewicz; +Cc: gcc-help

2011/12/14 Jędrzej Dudkiewicz :
>
> I can try it, but last time I tried it wasn't working. Note that here:
>
> http://gcc.gnu.org/install/specific.html#x-ibm-aix
>
> it is written:
>
> Because GCC on AIX is built as a 32-bit executable by default,
> (although it can generate 64-bit programs) the GMP and MPFR libraries
> required by gfortran must be 32-bit libraries. Building GMP and MPFR
> as static archive libraries works better than shared libraries.
>
> My impression is that if you were right, this wouldn't be mentioned.

Well that text is necessary if you build those libs yourself. If you
let GCC build them it should do the right thing automatically.  If it
doesn't that's a bug.

> On the other hand it seems that not only gfortran requires them, so
> maybe this whole part is wrong.

It's certainly out of date as not only gfortran needs them, and MPC is
also needed now.

>> Are you installing dynamic libraries for gmp, mpfr and mpc?  If you
>> are, it's not as simple as running one script, because you need to
>> ensure they can be found by the dynamic linker at runtime.
>
> No, as in quoted text above: "Building GMP and MPFR as static archive
> libraries works better than shared libraries".

OK, by only building static libs you avoid the main problems caused by
building them separately from GCC.

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

* Re: aix cross(?)compiler
  2011-12-14 11:42   ` Jędrzej Dudkiewicz
@ 2011-12-14 17:10     ` Kai Ruottu
  2011-12-22 17:36       ` Jędrzej Dudkiewicz
  0 siblings, 1 reply; 15+ messages in thread
From: Kai Ruottu @ 2011-12-14 17:10 UTC (permalink / raw)
  To: gcc-help

14.12.2011 13:42, Jędrzej Dudkiewicz kirjoitti:

> Well, it must :), otherwise building it is quite probably impossible,
>   as it seems that GNU binutils do not fully support AIX - but I can't
>   say for sure, as I were unable to find a definite list of supported
>   systems. I tried building using GNU binutils, but 'as' refused to
>   compile source code, claiming that it does not know about instruction
>   fmul, if my memory serves well.

Hard to say what the GNU binutils really support or not but trying them
is always possible. So I tried the binutils-2.20.51 :

[root@localhost build]# rs6000-ibm-aix4.3-as --version
GNU assembler (Linux/GNU Binutils) 2.20.51.0.8.20100412
Copyright 2010 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `rs6000-ibm-aix4.3'.

and then gcc-4.6.2.  Of course it crashed during the libgcc build :

/home/src/gcc-4.6.2/build/./gcc/xgcc -B/home/src/gcc-4.6.2/build/./gcc/ 
-B/usr/local/rs6000-ibm-aix4.3/bin/ -B/usr/local/rs6000-ibm-aix4.3/lib/ 
-isystem /usr/local/rs6000-ibm-aix4.3/include -isystem 
/usr/local/rs6000-ibm-aix4.3/sys-include    -g -Os -pthread -O2  -g -Os 
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings 
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition  -isystem ./include  -mlong-double-128 -g 
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED 
-fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc 
-I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc 
-I../../../../libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o 
unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep -fexceptions -c 
../../../../libgcc/../gcc/unwind-dw2.c
In file included from ../../../../libgcc/../gcc/gthr-aix.h:30:0,
                  from ../../.././gcc/gthr-default.h:1,
                  from ../../../../libgcc/../gcc/gthr.h:162,
                  from ../../../../libgcc/../gcc/unwind-dw2.c:37:
../../../../libgcc/../gcc/gthr-posix.h:44:1: error: unknown type name 
'pthread_t'
../../../../libgcc/../gcc/gthr-posix.h:45:1: error: unknown type name 
'pthread_key_t'
../../../../libgcc/../gcc/gthr-posix.h:46:1: error: unknown type name 
'pthread_once_t'
../../../../libgcc/../gcc/gthr-posix.h:47:1: error: unknown type name 
'pthread_mutex_t'
../../../../libgcc/../gcc/gthr-posix.h:48:1: error: unknown type name 
'pthread_mutex_t'
../../../../libgcc/../gcc/gthr-posix.h:49:1: error: unknown type name 
'pthread_cond_t'

when I hadn't those AIX 4.3 target headers :-( My configure options
can be seen in the following :

[root@localhost build]# gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=gcc/xgcc
Target: rs6000-ibm-aix4.3
Configured with: ../configure --build=i686-linux-gnu 
--host=i686-linux-gnu --target=rs6000-ibm-aix4.3 --with-gnu-as 
--with-gnu-ld --enable-languages=c,c++ --disable-threads --disable-nls
Thread model: aix
gcc version 4.6.2 (GCC)

The '--disable-threads' didn't seem to have any influence!

The 'gmp', 'mpfr' and 'mpc' sources were built with the gcc-4.6.2
sources...

Are the AIX 4.3 etc C-libraries freely available somewhere nowadays?
Years ago I tried to find them but then IBM hadn't put them freely
available like SGI with Irix stuff and Sun with Solaris2 stuff :-(

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

* Re: aix cross(?)compiler
  2011-12-14 17:10     ` Kai Ruottu
@ 2011-12-22 17:36       ` Jędrzej Dudkiewicz
  0 siblings, 0 replies; 15+ messages in thread
From: Jędrzej Dudkiewicz @ 2011-12-22 17:36 UTC (permalink / raw)
  To: gcc-help

On Wed, Dec 14, 2011 at 6:10 PM, Kai Ruottu <kai.ruottu@wippies.com> wrote:
> 14.12.2011 13:42, Jędrzej Dudkiewicz kirjoitti:
> Hard to say what the GNU binutils really support or not but trying them
> is always possible. So I tried the binutils-2.20.51 :
>
> [root@localhost build]# rs6000-ibm-aix4.3-as --version
> GNU assembler (Linux/GNU Binutils) 2.20.51.0.8.20100412
> Copyright 2010 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or later.
> This program has absolutely no warranty.
> This assembler was configured for a target of `rs6000-ibm-aix4.3'.

I tried it just now, this time on Solaris 11 (host:
i386-pc-solaris2.11), I'm using gcc provided by Oracle:

root@sol11x86:~/xcomp/build/gcc-4.6.0# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/lto-wrapper
Target: i386-pc-solaris2.11
Configured with:
/builds/hudson/workspace/nightly/build/i386/components/gcc45/gcc-4.5.2/configure
CC=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/cc
CXX=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/CC --prefix=/usr/gcc/4.5
--mandir=/usr/gcc/4.5/share/man --bindir=/usr/gcc/4.5/bin
--libdir=/usr/gcc/4.5/lib --sbindir=/usr/gcc/4.5/sbin
--enable-languages=c,c++,fortran,objc --enable-shared
--with-gmp-include=/usr/include/gmp
--with-mpfr-include=/usr/include/mpfr --prefix=/usr/gcc/4.5
--mandir=/usr/gcc/4.5/share/man --infodir=/usr/gcc/4.5/share/info
--libexecdir=/usr/gcc/4.5/lib CFLAGS='-g -O2 '
Thread model: posix
gcc version 4.5.2 (GCC)

This is how I built binutils:

../../src/binutils-2.22/configure --prefix=/opt/xgcc/aix-4.3/binutils
--target=rs6000-ibm-aix4.3

Note, that gcc on AIX reports as:

Reading specs from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --with-as=/usr/bin/as
--with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++
--prefix=/opt/freeware --enable-threads --disable-shared
Thread model: aix
gcc version 3.3.2

I tried building binutils using "--target=powerpc-ibm-aix4.3.3.0", but
results were identical to what I see now, so my guess is that it
doesn't really matter.

Ok, so binutils are built and installed. Now, gcc. I'm building gcc
4.6.0, as 4.6.2 reports an error almost identical to one in my first
message. This time mpc, mpfr and gmp are in gcc source directory. Here
we go:

export PATH=/opt/xgcc/aix-4.3/binutils/bin:$PATH

../../src/gcc-4.6.0/configure --prefix=/opt/xgcc/aix-4.3/gcc-4.6.0
--enable-static --with-build-sysroot=../../src/sysroot
--with-headers=../../src/sysroot/usr/include --with-gnu-as
--with-gnu-ld --enable-languages=c,c++ --disable-shared --disable-nls
--target=rs6000-ibm-aix4.3 --disable-multilib

During compilation there was an error saying that there is no
directory /src/sysroot/usr/include where headers for target system are
supposed to be - my guess is that I should have provided (is it proper
english?) an absolute path, but creating link gcc/src pointing to
../../../src helped - let's say that it's equal to providing absolute
path.

Finally, compilation failed with the following:

Checking multilib configuration for libgomp...
Configuring in rs6000-ibm-aix4.3/libgomp
configure: loading cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for --enable-generated-files-in-srcdir... no
checking build system type... i386-pc-solaris2.11
checking host system type... rs6000-ibm-aix4.3
checking target system type... rs6000-ibm-aix4.3
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for rs6000-ibm-aix4.3-strip... rs6000-ibm-aix4.3-strip
checking for a thread-safe mkdir -p... /usr/bin/gmkdir -p
checking for gawk... gawk
checking whether gmake sets $(MAKE)... yes
checking for rs6000-ibm-aix4.3-gcc...
/root/xcomp/build/gcc-4.6.0/./gcc/xgcc
-B/root/xcomp/build/gcc-4.6.0/./gcc/
-B/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/bin/
-B/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/lib/ -isystem
/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/include -isystem
/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/sys-include
--sysroot=../../src/sysroot
checking for C compiler default output file name...
configure: error: in `/root/xcomp/build/gcc-4.6.0/rs6000-ibm-aix4.3/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.
gmake[1]: *** [configure-target-libgomp] Error 1
gmake[1]: Leaving directory `/root/xcomp/build/gcc-4.6.0'
gmake: *** [all] Error 2

First thing that is weird is that it states "Checking multilib
configuration for libgomp..." with "--disable-multilib" passed to
configure - this means, that I probably don't understand what it does
:)

Anyway, config.log in rs6000-ibm-aix4.3/libgomp contains this (it's
the last error in this file):

configure:3666: checking for C compiler default output file name
configure:3688: /root/xcomp/build/gcc-4.6.0/./gcc/xgcc
-B/root/xcomp/build/gcc-4.6.0/./gcc/
-B/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/bin/
-B/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/lib/ -isystem
/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/include -isystem
/opt/xgcc/aix-4.3/gcc-4.6.0/rs6000-ibm-aix4.3/sys-include
--sysroot=../../src/sysroot   -g -O2   conftest.c  >&5
collect2: library libg not found
configure:3692: $? = 1
configure:3729: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU OpenMP Runtime Library"
| #define PACKAGE_TARNAME "libgomp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU OpenMP Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgomp/"
| #define PACKAGE "libgomp"
| #define VERSION "1.0"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3735: error: in
`/root/xcomp/build/gcc-4.6.0/rs6000-ibm-aix4.3/libgomp':
configure:3738: error: C compiler cannot create executables

Again, my questions are: am I doing it right but it's simply hard to
build crosscompiler for this platform, or am I missing some vital part
of the process?

> Are the AIX 4.3 etc C-libraries freely available somewhere nowadays?
> Years ago I tried to find them but then IBM hadn't put them freely
> available like SGI with Irix stuff and Sun with Solaris2 stuff :-(

I tried looking for them but i failed miserably. So it's possible that
they are either well hidden or not available at all.
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

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

* Re: aix cross(?)compiler
  2011-12-14  9:45 ` Jonathan Wakely
  2011-12-14 10:12   ` Jędrzej Dudkiewicz
@ 2012-01-21 18:19   ` Paul Smith
  2012-01-21 18:28     ` Marc Glisse
  2012-01-21 18:51     ` aix cross(?)compiler Jonathan Wakely
  1 sibling, 2 replies; 15+ messages in thread
From: Paul Smith @ 2012-01-21 18:19 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Jędrzej Dudkiewicz, gcc-help

On Wed, 2011-12-14 at 09:45 +0000, Jonathan Wakely wrote:
> 2011/12/14 Jędrzej Dudkiewicz:
> >
> > 1) Am I building everything the right way,
> 
> The process is much simpler if you let GCC build the GMP, MPFR and MPC
> libs, instead of installing them separately. See
> http://advogato.org/person/redi/diary/253.html

Unfortunately this method is broken, at least in GCC 4.6.2.

I filed a bug (with patch):
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51935

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

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

* Re: aix cross(?)compiler
  2012-01-21 18:19   ` Paul Smith
@ 2012-01-21 18:28     ` Marc Glisse
  2012-01-21 18:37       ` Newer MPFR versions (was: Re: aix cross(?)compiler) Paul Smith
  2012-01-21 18:51     ` aix cross(?)compiler Jonathan Wakely
  1 sibling, 1 reply; 15+ messages in thread
From: Marc Glisse @ 2012-01-21 18:28 UTC (permalink / raw)
  To: Paul Smith; +Cc: gcc-help

On Sat, 21 Jan 2012, Paul Smith wrote:

> On Wed, 2011-12-14 at 09:45 +0000, Jonathan Wakely wrote:
>> 2011/12/14 JĂŞdrzej Dudkiewicz:
>>>
>>> 1) Am I building everything the right way,
>>
>> The process is much simpler if you let GCC build the GMP, MPFR and MPC
>> libs, instead of installing them separately. See
>> http://advogato.org/person/redi/diary/253.html
>
> Unfortunately this method is broken, at least in GCC 4.6.2.

It advises to use ./contrib/download_prerequisites, which doesn't download 
the latest versions of gmp/mpfr/mpc but versions that are known to work.

> I filed a bug (with patch):
>    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51935

Dup of 50461.
A good patch would detect the appropriate path depending on the version of 
mpfr.
If we were to require mpfr-3.1+ for in-tree builds, at least 
download_prerequisites and the documentation should be updated.

-- 
Marc Glisse

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

* Newer MPFR versions (was: Re: aix cross(?)compiler)
  2012-01-21 18:28     ` Marc Glisse
@ 2012-01-21 18:37       ` Paul Smith
  0 siblings, 0 replies; 15+ messages in thread
From: Paul Smith @ 2012-01-21 18:37 UTC (permalink / raw)
  To: gcc-help

On Sat, 2012-01-21 at 18:48 +0100, Marc Glisse wrote:
> Dup of 50461.

Hm.  My bugzilla search fu is apparently not good enough.

> A good patch would detect the appropriate path depending on the
> version of mpfr. 

Sure; I added a new patch to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51935
to support both old and new versions.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

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

* Re: aix cross(?)compiler
  2012-01-21 18:19   ` Paul Smith
  2012-01-21 18:28     ` Marc Glisse
@ 2012-01-21 18:51     ` Jonathan Wakely
  2012-01-21 22:24       ` Paul Smith
  1 sibling, 1 reply; 15+ messages in thread
From: Jonathan Wakely @ 2012-01-21 18:51 UTC (permalink / raw)
  To: psmith; +Cc: Jędrzej Dudkiewicz, gcc-help

2012/1/21 Paul Smith:
> On Wed, 2011-12-14 at 09:45 +0000, Jonathan Wakely wrote:
>> 2011/12/14 Jędrzej Dudkiewicz:
>> >
>> > 1) Am I building everything the right way,
>>
>> The process is much simpler if you let GCC build the GMP, MPFR and MPC
>> libs, instead of installing them separately. See
>> http://advogato.org/person/redi/diary/253.html
>
> Unfortunately this method is broken, at least in GCC 4.6.2.

No, it isn't.  As Marc pointed out, you didn't follow the method.

Those instructions are now in the GCC wiki at
http://gcc.gnu.org/wiki/InstallingGCC

Feel free to improve them, but I suggest actually following them
before saying it doesn't work.

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

* Re: aix cross(?)compiler
  2012-01-21 18:51     ` aix cross(?)compiler Jonathan Wakely
@ 2012-01-21 22:24       ` Paul Smith
  0 siblings, 0 replies; 15+ messages in thread
From: Paul Smith @ 2012-01-21 22:24 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Jędrzej Dudkiewicz, gcc-help

On Sat, 2012-01-21 at 18:27 +0000, Jonathan Wakely wrote:
> > Unfortunately this method is broken, at least in GCC 4.6.2.
> 
> No, it isn't.  As Marc pointed out, you didn't follow the method.
> 
> Those instructions are now in the GCC wiki at
> http://gcc.gnu.org/wiki/InstallingGCC
> 
> Feel free to improve them, but I suggest actually following them
> before saying it doesn't work.

I can't use the script because I must use locally archived versions of
all the packages: I can't download them.

However you're right, I should have examined the script more carefully
and reproduced its behavior more exactly inside my environment.

I'll drop back to older versions for now.  Note the patch attached to
the bug I filed will allow GCC configure to work with both older and
newer versions (at least insofar as configure and compile goes: I didn't
verify that no new bugs were introduced in the newer MPFR).  Might be
worthwhile including in 4.6.3.  Or not.

Cheers!

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

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

end of thread, other threads:[~2012-01-21 18:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14  8:36 aix cross(?)compiler Jędrzej Dudkiewicz
2011-12-14  9:45 ` Jonathan Wakely
2011-12-14 10:12   ` Jędrzej Dudkiewicz
2011-12-14 11:09     ` Jonathan Wakely
2011-12-14 11:29       ` Jędrzej Dudkiewicz
2011-12-14 12:07         ` Jonathan Wakely
2012-01-21 18:19   ` Paul Smith
2012-01-21 18:28     ` Marc Glisse
2012-01-21 18:37       ` Newer MPFR versions (was: Re: aix cross(?)compiler) Paul Smith
2012-01-21 18:51     ` aix cross(?)compiler Jonathan Wakely
2012-01-21 22:24       ` Paul Smith
2011-12-14 11:16 ` Kai Ruottu
2011-12-14 11:42   ` Jędrzej Dudkiewicz
2011-12-14 17:10     ` Kai Ruottu
2011-12-22 17:36       ` Jędrzej Dudkiewicz

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