From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3090 invoked by alias); 22 Dec 2011 13:08:01 -0000 Received: (qmail 3078 invoked by uid 22791); 22 Dec 2011 13:07:58 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Dec 2011 13:07:45 +0000 Received: by eaal1 with SMTP id l1so7923728eaa.20 for ; Thu, 22 Dec 2011 05:07:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.205.129.137 with SMTP id hi9mr3255482bkc.90.1324559263767; Thu, 22 Dec 2011 05:07:43 -0800 (PST) Received: by 10.205.122.141 with HTTP; Thu, 22 Dec 2011 05:07:43 -0800 (PST) In-Reply-To: <4EE8D87B.2010209@wippies.com> References: <4EE88569.7000704@wippies.com> <4EE8D87B.2010209@wippies.com> Date: Thu, 22 Dec 2011 17:36:00 -0000 Message-ID: Subject: Re: aix cross(?)compiler From: =?UTF-8?Q?J=C4=99drzej_Dudkiewicz?= To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg00213.txt.bz2 On Wed, Dec 14, 2011 at 6:10 PM, Kai Ruottu wrote: > 14.12.2011 13:42, J=C4=99drzej 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=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/lto-wr= apper Target: i386-pc-solaris2.11 Configured with: /builds/hudson/workspace/nightly/build/i386/components/gcc45/gcc-4.5.2/conf= igure CC=3D/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/cc CXX=3D/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/CC --prefix=3D/usr/gcc/4.5 --mandir=3D/usr/gcc/4.5/share/man --bindir=3D/usr/gcc/4.5/bin --libdir=3D/usr/gcc/4.5/lib --sbindir=3D/usr/gcc/4.5/sbin --enable-languages=3Dc,c++,fortran,objc --enable-shared --with-gmp-include=3D/usr/include/gmp --with-mpfr-include=3D/usr/include/mpfr --prefix=3D/usr/gcc/4.5 --mandir=3D/usr/gcc/4.5/share/man --infodir=3D/usr/gcc/4.5/share/info --libexecdir=3D/usr/gcc/4.5/lib CFLAGS=3D'-g -O2 ' Thread model: posix gcc version 4.5.2 (GCC) This is how I built binutils: ../../src/binutils-2.22/configure --prefix=3D/opt/xgcc/aix-4.3/binutils --target=3Drs6000-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/s= pecs Configured with: ../gcc-3.3.2/configure --with-as=3D/usr/bin/as --with-ld=3D/usr/bin/ld --disable-nls --enable-languages=3Dc,c++ --prefix=3D/opt/freeware --enable-threads --disable-shared Thread model: aix gcc version 3.3.2 I tried building binutils using "--target=3Dpowerpc-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=3D/opt/xgcc/aix-4.3/binutils/bin:$PATH ../../src/gcc-4.6.0/configure --prefix=3D/opt/xgcc/aix-4.3/gcc-4.6.0 --enable-static --with-build-sysroot=3D../../src/sysroot --with-headers=3D../../src/sysroot/usr/include --with-gnu-as --with-gnu-ld --enable-languages=3Dc,c++ --disable-shared --disable-nls --target=3Drs6000-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=3D../../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=3D../../src/sysroot -g -O2 conftest.c >&5 collect2: library libg not found configure:3692: $? =3D 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. --=20 J=C4=99drzej 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.