This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: arm-unknown-linux-gnueabi ABI selection


On Sun, 31 Aug 2008, Michael Abbott wrote:
> > 2. I can't build a good toolchain (sizeof(enum)==1 is a disaster).
> I may have spotted a discrepancy, with CT_ARCH_ABI_CFLAGS where it looks 
> as if CT_ARCH_ABI_CFLAG was meant.  
...
> I'll make an update in an hour when the build is complete.

And ... it still doesn't work.


$ cd x-tools
$ cat test.c
enum test { TEST };
int size() { return sizeof(enum test); }
$ ./arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -O2 -S test.c
$ cat test.s
	.file	"test.c"
	.text
	.align	2
	.global	size
	.type	size, %function
size:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	@ link register save eliminated.
	mov	r0, #1
	@ lr needed for prologue
	bx	lr
	.size	size, .-size
	.ident	"GCC: (GNU) 4.2.4"
$


I'm out of ideas.

(The "mov r0, #1" line needs to be "mov r0, #4" to be compatible with int 
sized enums, as required, as far as I can tell, for Linux compatibility.)

Very odd: the -mabi=aapcs-linux flag occurs throughout the build log, but 
it hasn't made into the default flag for the compiler toolchain.  If I 
explicitly set the abi flag I get the right result:

$ ./arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
    -O2 -S -mabi=aapcs-linux  test.c
$ cat test.s | grep mov
	mov	r0, #4
$



--
For unsubscribe information see http://sourceware.org/lists.html#faq


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