public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jędrzej Dudkiewicz" <jedrzej.dudkiewicz@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Re: aix cross(?)compiler
Date: Thu, 22 Dec 2011 17:36:00 -0000	[thread overview]
Message-ID: <CABJqhQPTsy2Vc3qExgLcz0BiwtLd5FX3S4btV4Wy2uVG0eu13Q@mail.gmail.com> (raw)
In-Reply-To: <4EE8D87B.2010209@wippies.com>

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.

      reply	other threads:[~2011-12-22 13:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  8:36 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABJqhQPTsy2Vc3qExgLcz0BiwtLd5FX3S4btV4Wy2uVG0eu13Q@mail.gmail.com \
    --to=jedrzej.dudkiewicz@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).