Cross compiling problem: relocation truncated to fit ...
Hi,
when cross compiling ia64 exec´s on an ia32 the cross-ld states
/usr/cross/lib/gcc-lib/ia64-gnu-linux-gnu/2.9-ia64-000216-final/crtbegin.o(. fini+0x2): relocation truncated to fit: PCREL21B fini
This is reproduceable. When making the same - admittedly quite huge - exec on an ia64 natively the make works
fine.
Any ideas? Just a stupid setup problem?
Thanks in advance
Willi
------------------
Willi Nüßer
SAP LinuxLab
[email protected]
Did you try the -relax option? If your linker still isn't able to build a big binary with that option specified, you need a newer linker. I do have a prebuilt version for NUE, but it will use different paths from your own cross environment.
--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Wilhelm
Willi> Hi, when cross compiling ia64 exec´s on an ia32 the cross-ld Willi> states
Willi> /usr/cross/lib/gcc-lib/ia64-gnu-linux-gnu/2.9-ia64-000216-final/crtbegin.o(. Willi> fini+0x2): relocation truncated to fit: PCREL21B fini This is Willi> reproduceable. When making the same - admittedly quite huge - Willi> exec on an ia64 natively the make works fine.
Willi> Any ideas? Just a stupid setup problem?
Willi> Thanks in advance
Willi> Willi
Willi> ------------------ Willi Nüßer SAP LinuxLab Willi> [email protected]
Willi> _______________________________________________ Linux-IA64 Willi> mailing list [email protected]
Willi> http://lists.linuxia64.org/lists/listinfo/linux-ia64
You have an out-of-range branch. Branches can only reach about 16MB directly, after that they need linker help.
If you have a recent enough toolchain, then -Wl,-relax will make this work. It should work automatically, but well, eventually it will. The recent TurboLinux distribution RPMS have the necessary patches. I don't believe any Red Hat distribution RPMS have it yet, but the next release will.
A 32-bit hosted cross compiler will generate worse code than a native compiler. This is because it is harder to optimize 64-bit values on a 32-bit machine, so there are some cases where we just give up and don't perform the optimization when on a 32-bit host. Thus the cross compiled application will be bigger, and more likely to have out-of-range branches. Don't cross compile unless you have to.
Jim