This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Offloading not relocatable
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 17 Sep 2014 16:42:11 +0200
- Subject: Re: Offloading not relocatable
- Authentication-results: sourceware.org; auth=none
- References: <20140917142141 dot GI17454 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Sep 17, 2014 at 04:21:42PM +0200, Jakub Jelinek wrote:
> So, I'd say that mkoffload should be using similar stuff like the gcc.c
> driver uses to find cc1 relative to the location of the gcc binary.
E.g. strace can tell where gcc driver is looking for cc1:
mv /usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/cc1{,.xx}
strace -e access,stat /usr/src/gcc-git/objinst/usr/local/bin/gcc -fopenmp -o target-1.s target-1.c -S
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/src/gcc-git/objinst/usr/local/bin/", X_OK) = 0
access("/usr/src/gcc-git/objinst/usr/local/bin/", X_OK) = 0
access("target-1.c", F_OK) = 0
access("/usr/src/gcc-git/objinst/usr/local/bin/", X_OK) = 0
access("/usr/src/gcc-git/objinst/usr/local/bin/", X_OK) = 0
access("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../x86_64-unknown-linux-gnu/lib/x86_64-unknown-linux-gnu/5.0.0/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../x86_64-unknown-linux-gnu/lib/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/lib/gcc/x86_64-unknown-linux-gnu/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/src/gcc-git/objinst/usr/local/bin/", X_OK) = 0
stat("/usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/cc1", 0x7fff73be0aa0) = -1 ENOENT (No such file or directory)
stat("/usr/src/gcc-git/objinst/usr/local/bin/../libexec/gcc/cc1", 0x7fff73be0aa0) = -1 ENOENT (No such file or directory)
stat("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu/5.0.0/cc1", 0x7fff73be0aa0) = -1 ENOENT (No such file or directory)
stat("/usr/src/gcc-git/objinst/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../x86_64-unknown-linux-gnu/bin/cc1", 0x7fff73be0aa0) = -1 ENOENT (No such file or directory)
gcc: error trying to exec 'cc1': execvp: No such file or directory
mkoffload should make similar attempts to find the offloading compiler
driver. It should try (relative to mkoffload binary) probably:
../../../../../bin/x86_64-intelmic-linux-gnu-g++
(why does it try g++ and not gcc btw?), then perhaps:
./x86_64-intelmic-linux-gnu-g++
(so that one can e.g. put a symlink next to mkoffload and point it wherever needed)
and perhaps as last fallback, try to execute x86_64-intelmic-linux-gnu-g++
from PATH env var.
Jakub