Mailinglist Archive: opensuse-buildservice (132 mails)

< Previous Next >
Re: [opensuse-buildservice] [RFC] Is there any plan to add ILP32 support for aarch64?
  • From: Bamvor Jian Zhang <bamvor.zhangjian@xxxxxxxxxx>
  • Date: Tue, 27 Jan 2015 19:03:09 +0800
  • Message-id: <54C7706D.4010900@huawei.com>
Hi, Jan

On 2015/1/26 18:37, Jan Engelhardt wrote:
In case of x32 and sparcv9, our gcc(64bit) already can produce these,
and is the one to use.
Yes. our gcc could compile ilp32 on aarch64. But it failed in linking:

# cat main.c
int main(){return 0;}
# gcc-4.9 -mabi=ilp32 main.c -o main.ilp32 -nostdlib -nostartfiles -v
--save-temps
...
/usr/lib64/gcc/aarch64-suse-linux/4.9/collect2 -plugin
/usr/lib64/gcc/aarch64-suse-linux/4.9/liblto_plugin.so
-plugin-opt=/usr/lib64/gcc/aarch64-suse-linux/4.9/lto-wrapper
-plugin-opt=-fresolution=main.res --build-id --eh-frame-hdr -dynamic-linker
/lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux -o main.ilp32
-L/usr/lib64/gcc/aarch64-suse-linux/4.9
-L/usr/lib64/gcc/aarch64-suse-linux/4.9/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64
-L/usr/lib64/gcc/aarch64-suse-linux/4.9/../../../../aarch64-suse-linux/lib
-L/usr/lib64/gcc/aarch64-suse-linux/4.9/../../.. main.o
/usr/lib64/gcc/aarch64-suse-linux/4.9/../../../../aarch64-suse-linux/bin/ld:
aarch64:ilp32 architecture of input file `main.o' is incompatible with aarch64
output
/usr/lib64/gcc/aarch64-suse-linux/4.9/../../../../aarch64-suse-linux/bin/ld:
warning: cannot find entry symbol _start; defaulting to 00000000004000d4
collect2: error: ld returned 1 exit status

It set the wrong ld.so(should be /lib/ld-linux-aarch64_ilp32.so.1), wrong elf
type(should be -maarch64linux32). And it also required libilp32 library with
compile without -nostdlib. I could make it right by forcing -maarch64linux32:
/usr/lib64/gcc/aarch64-suse-linux/4.9/collect2 -plugin
/usr/lib64/gcc/aarch64-suse-linux/4.9/liblto_plugin.so -plug
in-opt=/usr/lib64/gcc/aarch64-suse-linux/4.9/lto-wrapper
-plugin-opt=-fresolution=main.res --build-id --eh-frame-hdr -dynamic-linker
/lib/ld-linux-aarc h64.so.1 -X -EL -maarch64linux32 -o main.ilp32
-L/usr/lib64/gcc/aarch64-suse-linux/4.9
-L/usr/lib64/gcc/aarch64-suse-linux/4.9/../../../../lib64 -L/lib /../lib64
-L/usr/lib/../lib64
-L/usr/lib64/gcc/aarch64-suse-linux/4.9/../../../../aarch64-suse-linux/lib
-L/usr/lib64/gcc/aarch64-suse-linux/4.9/../../
.. main.o
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to
0000000000400098

And the dynamic linker could be fixed by "gcc/config/aarch64/aarch64-linux.h":
-#define GLIBC_DYNAMIC_LINKER
"/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#define GLIBC_DYNAMIC_LINKER
"/lib/ld-linux-aarch64%{mbig-endian:_be%{mabi=ilp32:_ilp32}}.so.1"

But I do not know how to pass the -maarch64linux32 for linker. Any suggestion?

Besides, when I install gcc49 on opensuse 13.2(aarch64), it reports the
libgcc_s1 conflict. Could I force installing the libgcc_s1_4.9.0 and
libgomp1-4.9.0(maybe and libitm)?
:/ # zypper in gcc49
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: gcc49-4.9.0+r211729-2.1.2.aarch64 requires libgcc_s1 >=
4.9.0+r211729-2.1.2, but this requirement cannot be provided
uninstallable providers:
libgcc_s1-gcc49-4.9.0+r211729-2.1.2.aarch64[openSUSE-13.2-repo-oss]
Solution 1: Following actions will be done:
deinstallation of libgcc_s1-4.8.3+r212056-2.2.1.aarch64
deinstallation of libgomp1-4.8.3+r212056-2.2.1.aarch64
Solution 2: do not install gcc49-4.9.0+r211729-2.1.2.aarch64
Solution 3: break gcc49-4.9.0+r211729-2.1.2.aarch64 by ignoring some of its
dependencies


The ILP32 ones work more like what ppc is to ppc64 than what
i586 is to x86_64.
agree.

regards

bamvor


--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups