This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compile on AIX 5.3 for AIX 4.3 - is crosscompiler required?


2011/1/27 Ian Lance Taylor <iant@google.com>:
> JÄdrzej Dudkiewicz <jedrzej.dudkiewicz@gmail.com> writes:
>
>> my setup is as follows: I have one (relatively) fast IBM machine with
>> AIX 5.3, and veeery old one with AIX 4.3. The slower machine is The
>> Target - I must compile software for it. Testing software on 4.3
>> machine is acceptable, but compilation isn't - it has, if I recall
>> correctly, 128MB of RAM and 120MHz CPU and software is written in such
>> way, that change in one header usualy forces recompilation of half of
>> a project. So I'd like to compile on AIX 5.3 for AIX 4.3 - do I need a
>> cross-compiler? Or should I build with -march=... (or similar) set to
>> target's configuration and just link on older machine? Or it will work
>> only if I'm lucky? If I do need a cross-compiler, where should I
>> start?
>
> I guess the question is whether programs compiled for AIX 4.3 can run on
> AIX 5.3. ÂIf they can, then you don't need a cross-compiler. ÂWhat you
> need to do is copy all the header files and libraries over to your AIX
> 5.3 machine, and then build a compiler using the configure options
> --with-sysroot and --with-build-sysroot and set --build, --host and
> --target to CPU-aix4.3. ÂI don't know if it will work but it seems worth
> a try. ÂOh yeah, also copy over the assembler, linker, etc. ÂIn fact,
> heck, you could just build the compiler on AIX 4.3, then copy the whole
> environment over to AIX 5.3 and run it there. ÂBuilding the compiler
> will be slow, but using it won't be. ÂThat might be the easiest approach
> of all.

Thanks for an answer.

Yes, programs compiled on 4.3 do run on 5.3.

What do you mean by "copy the whole environment"? If I build with
--prefix=/opt/gcc-4.5.2, is it enough to copy that directory? I guess
not. So should I also copy /usr/include and /usr/bin/as, /usr/bin/ld
and so on, as you wrote earlier? Should I use any other options than
--prefix (any other that I would normaly use?)? Should I use all
options mentioned (--with-build-sysroot, --with-sysroot, --build,
--host, --target)?

Sorry for all these questions, but I'd rather not do something wrong,
as compilation of gcc on this machine will take at least two full
days, more like three - I'm not kidding, I did it once in the past on
a similar machine with gcc 3.4.6 - so fixing errors and repeating this
process will be quite painful.

And as we are at it - it seems that configure script from mpc does not
obey CONFIG_SHELL variable - I set it, as documentation recommends, to
bash, as default /bin/sh is terribly slow. I built gcc 4.5.2 on
mentioned AIX 5.3 and "configure" script from "mpc" (I'm almost sure
it was mpc, as I hadn't such problems with earlier versions of gcc,
which require only mpfr and gmp) run for almost two hours! Is there
some clever way to force usage of bash, or should I use brutal force
and link bash go /bin/sh or change "/bin/sh" to "/usr/bin/bash" in all
scripts?

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]