On Nov 18, 2015, at 5:31 PM, Paul Sokolovsky paul.sokolovsky@linaro.org wrote:
On Sun, 15 Nov 2015 14:10:15 +0300 Maxim Kuvyrkov maxim.kuvyrkov@linaro.org wrote:
Hi Paul,
Code for what target exactly are you trying to generate? Is it AArch32 or AArch64+ILP32?
In a reply to Wookey, I elaborated what I tried to do: I had a crash running 64-bit app on Dragonboard, and followed usual cause for diagnosing it by trying to build it in 32-bit mode - by re-applying x86_64 knowledge (and knowledge that ARMv8 is compatible with ARMv7).
While *personally* I'd find it important to know the difference between AArch32 or AArch64+ILP32, wearing a "random 96boards user" hat, I don't really have to, and the only thing I might care is how to build, and run (even if I have just a binary) a 32-bit application. (And then it apparently should be AArch32, to exactly allow a user pick a 32-bit binary they already have, and run it on ARMv8 system).
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?
As for details of internal compiler structuring, it does. But as for 96boards user, it doesn't - there're still no clear, easy, tested instructions how to build/run 32-bit apps. I don't know if you'd consider more or less direct "user support" of 96boards to be your responsibility, but fairly speaking, that's my main concern. That's why I cc: dev@lists.96boards.org - to let the core 96boards team anticipate what kind of questions users may have when they get boards in their hands and see if anything can be done about that (subject to priorities, as of course there're many things to do).
OK, so the answer for a normal user is to use arm-linux-gnueabihf-gcc for compiling 32-bit code and aarch64-linux-gnu-gcc for compiling 64-bit code. There is no option for AArch32/AArch64 similar to x86_64's -m32. The -mabi=ilp32 option of aarch64-linux-gnu-gcc is an advanced topic and should not be used by normal users.
-- Maxim Kuvyrkov www.linaro.org