This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Linux --> AIX cross compiler questions


Tom Williams wrote:

> HI!  Well, I've made yet more progress in my attempt at building a Linux
> hosted AIX 4.3.1 cross compiler.  I built libgcc1.a on AIX and now I'm
> getting these errors:

 Very good/bad news for you ;-)

 For just pure curiosity I looked at the AIX 4.1 and AIX 4.3 targets. Both
don't even need 'libgcc1.a' at all, and shouldn't try to build it...

 The aix3.x & aix4.1 'tmake_file', 'gcc/config/rs6000/t-xnewas says:

--------- clip ------------

# Same as t-newas, except don't build libgcc1-test.  This is because
# the compiler emits code to call external functions to save the
# arguments that are in libc, but since libgcc1-test is linked without
# libc, they will show up as errors.
LIBGCC1_TEST =

# Do not build libgcc1.
LIBGCC1 =
CROSS_LIBGCC1 =

 < and so on >
----------------------------

 The AIX 4.3x 'tmake_file', 'gcc/config/t-xaix43' was missing from gcc-2.95
sources, but my intuition would say that the same
 'except don't build libgcc1-test'
rows should be added to the native-compiler version, 't-aix43', to get the 
't-xaix43'...

 Here is the AIX 4.3x entry in 'gcc-2.95/gcc/configure' :

-------------- clip --------------------
	rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
		tm_file=rs6000/aix43.h
		if test x$host != x$target
		then
			tmake_file=rs6000/t-xaix43
		else
			tmake_file=rs6000/t-aix43
		fi
		xmake_file=rs6000/x-aix43
		float_format=none
		use_collect2=yes
		;;
-------------- clip --------------------

 If configure doesn't say that a needed file is missing, it is a bug in 
gcc-2.95... My habit is to check the entries, and I saw easily that this
file was missing and I couldn't configure before I had it... 

 The 'tmake_file', describing the target additions, will be included into the 
'gcc/Makefile' after running configure... Just as the 'xmake_file', 
describing the host additions, 't-linux' in you case...

 So I suggest you too to add the 'gcc/config/rs6000/t-xaix43' by adding 
the rows

--------- clip ------------
# Same as t-newas, except don't build libgcc1-test.  This is because
# the compiler emits code to call external functions to save the
# arguments that are in libc, but since libgcc1-test is linked without
# libc, they will show up as errors.
LIBGCC1_TEST =

--------- clip ------------

to the beginning of a copy from 't-aix43', reconfigure and rebuild...

 I tried the 'ppc-aix4.1' and 'ppc-aix4.3' targets under Linux, using
newlib-headers to simulate the AIX-ones, and got the builds succeed in
the 'gcc' subdir, all the 'power', 'powerpc', 'soft-float', 'soft-float/power' 
and 'soft-float/powerpc' variations of 'libgcc.a' were generated for both ones.

 But the 'aix64' variation of 'libgcc.a' for aix4.3 didn't succeed, GNU as 
puked about the 'aix64' option, so I stripped it away from the 't-xaix43' 
multilib definitions (The '/aix64', the directory name and the equals-row)

 Other things to change for a cross-compiler:

 The absolute pathnames in LIB_SPEC and STARTFILE_SPEC must be changed to tell
the directory names where the aix4.3-target stuff resides... Although you never
would produce binaries with the profiling libraries etc. described there, at 
least you should write a note to yourself that these things don't work if you
don't fix the directory names...

> I built the binutils for AIX on Linux using binutils-2.9.1.

 I used the binutils-19990727 snapshot, but probably 2.9.1 works as well (or 
better) for AIX 4.x...
 
> After these errors, the build eventually stopped with these errors during
> the testing of libgcc1:
> 
> libgcc1-test.o: In function `main_without__main':
> libgcc1-test.c:13: undefined reference to `_savef28'
> libgcc1-test.c:20: undefined reference to `__quoss'
> libgcc1-test.c:21: undefined reference to `__divss'

 Just as was previously said, 'except don't build libgcc1-test', for a 
cross-compiler....

 Cheers, Kai
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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