path64/compiler — Issue #136: inconsistent behavior  / segfaults with ipa
Author: BinaryKhaos
Created: 2012-02-28 06:26:15+00:00
State: open

I am trying to further evaluate path64 and thus have setup a dedicated environment (Gentoo chroot) for it to compile the whole system (w/o glibc, gcc, binutils). While doing so, I have run into the following issues:

> # cat /usr/lib64/path64/etc/compiler.defaults
> -O2 -march=nehalem -msse4_2 -LNO:opt=1 -ipa

Actually for this bug it doesn't matter if there is anything else besides -ipa in the compiler.defaults.

> test.c:
int main()
{ return 0; }

> # pathcc test.c -o test
pathcc ERROR: execute '/usr/lib64/path64/lib/1.0.0/x8664/ipa_link' failed: Died due to segmentation fault

> # pathcc -ipa test.c -o test
> /usr/lib64/crt1.o: In function `_start':
> (.text+0x20): undefined reference to `main'
> /usr/lib64/path64/lib/1.0.0/x8664/64/crtbegin.o:(.text+0x8f): undefined reference to `__CTOR_LIST_END__'
> /usr/lib64/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
> (.text+0xd): undefined reference to `__init_array_end'
> /usr/lib64/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
> (.text+0x14): undefined reference to `__init_array_start'
> /usr/lib64/path64/lib/1.0.0/x8664/ipa_link: test: hidden symbol `__init_array_end' isn't defined
> /usr/lib64/path64/lib/1.0.0/x8664/ipa_link: final link failed: Nonrepresentable section on output
> INTERNAL ERROR: pathcc returned non-zero status 1

The problem disappears once you remove the -ipa flag from the compiler.defaults file which in turn has its share of problems. Packages, that use libtool will filter the flags they will pass through during linking and thus, -ipa won't make it to the command line, so path64 complains that it cannot link ipa compiled object files without the ipa flag.

Right now it seems to me that there is no way to safely use ipa system wide because a lot of packages use libtool (and will thus fail) and there seems to be no working workaround.