Hi Paul,
Code for what target exactly are you trying to generate? Is it AArch32 or AArch64+ILP32? The first one is your normal 32-bit-mode-of-execution code. The second one is 64-bit-mode-of-execution with int, long and pointer types set to 32-bit. These are two very different things. To generate code for AArch32 you need to use arm-linux-gnueabi[hf] compiler, and for the second one you need to use aarch64-linux-gnu compiler with -mabi=ilp32 switch (which is still work-in-progress).
Unlike compilers for x86_64-linux-gnu and i686-linux-gnu, which are the same compiler under different names, compilers for aarch64-linux-gnu and arm-linux-gnueabi[hf] are completely different. Therefore there is presently very little chance of having -m32 option for aarch64-linux-gnu compiler.
Does this answer your questions?
-- Maxim Kuvyrkov www.linaro.org
On Nov 13, 2015, at 12:24 AM, Paul Sokolovsky paul.sokolovsky@linaro.org wrote:
Hello Maxim,
I hit the situation well described in https://gcc.gnu.org/ml/gcc-help/2015-02/msg00029.html , and wonder if there's any updates to your answer since February?
I'm playing with Ubuntu 15.04, on Dragonboard (15.09 Linaro release). Grepping thru output of apt-cache search, I found gcc-4.9-multilib-arm-linux-gnueabi, installed it, which pulled armel and armhf toochains, but didn't change linking behavior of "gcc -mabi=ilp32". Trying to use a arm-linux-gnueabi-gcc-4.9 crosscompiler, it builds executable, but it errors out with "./a.out: No such file or directory" (missing dynamic linker?).
Btw, I had a suspicion that current gcc on that Ubuntu version (gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2), when used with -mapi=ilp32, defines uint64_t to be 4 bytes, and indeed it's true:
#include <stdint.h>
int main() { printf("sizeof(uint64_t)=%d\n", sizeof(uint64_t)); }
gcc -mabi=ilp32 -S uint64.c
... add w0, w0, :lo12:.LC0 mov w1, 4 bl printf ...
Thanks, Paul
P.S. Any chance we could hope for -m32 switch, familiar from x86_64?
-- Best Regards, Paul
Linaro.org | Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro http://twitter.com/#%21/linaroorg - http://www.linaro.org/linaro-blog