This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Offloading not relocatable


On Wed, Sep 17, 2014 at 06:11:25PM +0200, Jakub Jelinek wrote:
> On Wed, Sep 17, 2014 at 04:21:42PM +0200, Jakub Jelinek wrote:
> > >From -v dump, that sounds like a bug in mkoffload, which has been found
> > properly relatively to the gcc driver or whatever.
> > 
> > /usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmic-linux-gnu/mkoffload @/tmp/ccS6Q83l
> > collect2: error trying to exec '/usr/local/bin/x86_64-intelmic-linux-gnu-g++': execvp: No such file or directory
> > lto-wrapper: fatal error: /usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmic-linux-gnu/mkoffload terminated with signal 11 [Segmentation fault], core dumped
> > compilation terminated.
> > /usr/bin/ld: lto-wrapper failed
> > collect2: error: ld returned 1 exit status
> > 
> 
> In the same setup, I've added (as root)
> #!/bin/sh
> exec /usr/src/gcc-git/objinst/usr/local/bin/x86_64-intelmic-linux-gnu-g++ "$@"
> script to /usr/local/bin/x86_64-intelmic-linux-gnu-g++ .
> But things don't work in that case either, the error is now:
> /usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmic-linux-gnu/mkoffload @/tmp/cc0nIjXd
> x86_64-intelmic-linux-gnu-g++: error trying to exec 'cc1plus': execvp: No such file or directory
> lto-wrapper: fatal error: /usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmic-linux-gnu/mkoffload terminated with signal 11 [Segmentation fault], core dumped
> compilation terminated.
> /usr/bin/ld: lto-wrapper failed
> collect2: error: ld returned 1 exit status
> 
> which presumably means that some undesirable vars from host environment
> were kept by mkoffload in the environment for the offloading compiler
> and that has the undesirable effect of affecting how the offloading
> compiler driver works.  Because, if I invoke
> /usr/local/bin/x86_64-intelmic-linux-gnu-g++ manually, it can find cc1plus
> just fine.

unset GCC_EXEC_PREFIX
in the /usr/local/bin/x86_64-intelmic-linux-gnu-g++ script somewhat helps,
presumably mkoffload shouldn't export GCC_EXEC_PREFIX env var when
calling the driver, as it should be driver's business to find everything
else on its own.

/usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmic-linux-gnu/mkoffload @/tmp/ccySFivX
x86_64-intelmic-linux-gnu-g++: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.
lto-wrapper: fatal error: /usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmic-linux-gnu/mkoffload terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
/usr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status

is the next error though.
find `pwd` -name \*lto\*.so\*
/usr/src/gcc-git/objinst/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/liblto_plugin.so
/usr/src/gcc-git/objinst/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/liblto_plugin.so.0.0.0
/usr/src/gcc-git/objinst/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/liblto_plugin.so.0
/usr/src/gcc-git/objinst/usr/local/libexec/gcc/x86_64-intelmic-linux-gnu/5.0.0/liblto_plugin.so
/usr/src/gcc-git/objinst/usr/local/libexec/gcc/x86_64-intelmic-linux-gnu/5.0.0/liblto_plugin.so.0.0.0
/usr/src/gcc-git/objinst/usr/local/libexec/gcc/x86_64-intelmic-linux-gnu/5.0.0/liblto_plugin.so.0
strace tells me it has searched (far before that the host compiler's lto plugin has been found
just fine):
[pid  9491] access("/usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/local/libexec/gcc/x86_64-intelmic-linux-gnu/5.0.0/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/local/libexec/gcc/x86_64-intelmic-linux-gnu/5.0.0/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/../../../../../../x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  9491] access("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/accel/x86_64-intelmic-linux-gnu/../../../../../../x86_64-unknown-linux-gnu/bin/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]