* [gentoo-embedded] crossdev and ASAN
@ 2015-11-13 10:14 Joakim Tjernlund
2015-11-13 10:35 ` Joakim Tjernlund
0 siblings, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2015-11-13 10:14 UTC (permalink / raw
To: gentoo-embedded@lists.gentoo.org
cross toolchains cannot use ASAN today:
powerpc-g2.20-linux-gnu-gcc -fsanitize=address mmap.c
/usr/libexec/gcc/powerpc-g2.20-linux-gnu/ld: warning: libstdc++.so.6, needed by /usr/lib/gcc/powerpc-g2.20-
linux-gnu/4.9.3/libasan.so, not found (try using -rpath or -rpath-link)
Perhaps crossdev should install libstdc++ per default?
Jocke
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-embedded] crossdev and ASAN
2015-11-13 10:14 Joakim Tjernlund
@ 2015-11-13 10:35 ` Joakim Tjernlund
2015-11-13 12:16 ` Peter Stuge
0 siblings, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2015-11-13 10:35 UTC (permalink / raw
To: gentoo-embedded@lists.gentoo.org
On Fri, 2015-11-13 at 10:14 +0000, Joakim Tjernlund wrote:
> cross toolchains cannot use ASAN today:
> powerpc-g2.20-linux-gnu-gcc -fsanitize=address mmap.c
> /usr/libexec/gcc/powerpc-g2.20-linux-gnu/ld: warning: libstdc++.so.6, needed by /usr/lib/gcc/powerpc-g2.20-
> linux-gnu/4.9.3/libasan.so, not found (try using -rpath or -rpath-link)
>
> Perhaps crossdev should install libstdc++ per default?
>
> Jocke
hmm, there is a libstdc++.so.6 which will work to link with under:
/usr/lib64/gcc/powerpc-g2.20-linux-gnu/4.9.3/libstdc++.so.6
But powerpc-g2.20-linux-gnu-gcc cannot find it there, stracing gcc one can see:
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib/../lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/local/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/local/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib/../lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/local/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/lib32/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/powerpc-g2.20-linux-gnu/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/local/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 3860] open("/usr/powerpc-g2.20-linux-gnu/usr/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-embedded] crossdev and ASAN
2015-11-13 10:35 ` Joakim Tjernlund
@ 2015-11-13 12:16 ` Peter Stuge
0 siblings, 0 replies; 5+ messages in thread
From: Peter Stuge @ 2015-11-13 12:16 UTC (permalink / raw
To: gentoo-embedded
Joakim Tjernlund wrote:
> > cross toolchains cannot use ASAN today:
> > powerpc-g2.20-linux-gnu-gcc -fsanitize=address mmap.c
> > /usr/libexec/gcc/powerpc-g2.20-linux-gnu/ld: warning: libstdc++.so.6, needed by /usr/lib/gcc/powerpc-g2.20-
> > linux-gnu/4.9.3/libasan.so, not found (try using -rpath or -rpath-link)
>
> hmm, there is a libstdc++.so.6 which will work to link with under:
> /usr/lib64/gcc/powerpc-g2.20-linux-gnu/4.9.3/libstdc++.so.6
> But powerpc-g2.20-linux-gnu-gcc cannot find it there, stracing gcc
> one can see:
>
> [pid 3860] open("/usr/powerpc-g2.20-linux-gnu/...
Is /usr/powerpc-g2.20-linux-gnu the sysroot?
If yes, why is libstdc++.so.6 not in there?
If no, why is gcc looking there?
//Peter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-embedded] crossdev and ASAN
@ 2015-11-13 13:17 Joakim Tjernlund
2015-11-13 14:30 ` Jeremi Piotrowski
0 siblings, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2015-11-13 13:17 UTC (permalink / raw
To: gentoo-embedded@lists.gentoo.org
On Fri, 2015-11-13 at 13:16 +0100, Peter Stuge wrote:
> Joakim Tjernlund wrote:
> > > cross toolchains cannot use ASAN today:
> > > powerpc-g2.20-linux-gnu-gcc -fsanitize=address mmap.c
> > > /usr/libexec/gcc/powerpc-g2.20-linux-gnu/ld: warning: libstdc++.so.6, needed by /usr/lib/gcc/powerpc-
> > > g2.20-
> > > linux-gnu/4.9.3/libasan.so, not found (try using -rpath or -rpath-link)
> >
> > hmm, there is a libstdc++.so.6 which will work to link with under:
> > /usr/lib64/gcc/powerpc-g2.20-linux-gnu/4.9.3/libstdc++.so.6
> > But powerpc-g2.20-linux-gnu-gcc cannot find it there, stracing gcc
> > one can see:
> >
> > [pid 3860] open("/usr/powerpc-g2.20-linux-gnu/...
>
> Is /usr/powerpc-g2.20-linux-gnu the sysroot?
Yes
> If yes, why is libstdc++.so.6 not in there?
I think it is because cross-powerpc-g2.20-linux-gnu/glibc is special, it is not
the real/whole glibc, just the stuff needed x-compile.
But as there is and /usr/lib64/gcc/powerpc-g2.20-linux-gnu/4.9.3/libstdc++.so.6 gcc
shoudl look there? libasan.so.1 lives there also.
Speaking of libasan.so, it has an odd runpath:
0x0000001d (RUNPATH) Library runpath: [/usr/powerpc-g2.20-linux-gnu/lib/../lib]
My host has(amd64):
0x000000000000001d (RUNPATH) Library runpath: [/usr/lib/../lib64]
Jocke
> If no, why is gcc looking there?
>
>
> //Peter
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-embedded] crossdev and ASAN
2015-11-13 13:17 [gentoo-embedded] crossdev and ASAN Joakim Tjernlund
@ 2015-11-13 14:30 ` Jeremi Piotrowski
0 siblings, 0 replies; 5+ messages in thread
From: Jeremi Piotrowski @ 2015-11-13 14:30 UTC (permalink / raw
To: gentoo-embedded
On Fri, Nov 13, 2015 at 01:17:05PM +0000, Joakim Tjernlund wrote:
>
> I think it is because cross-powerpc-g2.20-linux-gnu/glibc is special, it is not
> the real/whole glibc, just the stuff needed x-compile.
cross-.../glibc is the real deal - it has everything needed for
x-compilation and at runtime. libstdc++ is part of cross-.../gcc, and I
guess mostly meant for development.
> But as there is and /usr/lib64/gcc/powerpc-g2.20-linux-gnu/4.9.3/libstdc++.so.6 gcc
> shoudl look there? libasan.so.1 lives there also.
g++ will look there because it will explicitly link against libstd++ in
all cases.
I guess the warning is trying to tell you that libstdc++ is not in the
default runtime lib search path _and_ that the library is an implicit
dependency of libasan. You'll see that if you add `-lstdc++` to the
compile command it won't mention a thing.
What's your use case anyway? If you want libstdc++ in the sysroot you
either cross-emerge gcc or just copy libstdc++ over. Or maybe static
linking?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-13 14:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 13:17 [gentoo-embedded] crossdev and ASAN Joakim Tjernlund
2015-11-13 14:30 ` Jeremi Piotrowski
-- strict thread matches above, loose matches on Subject: below --
2015-11-13 10:14 Joakim Tjernlund
2015-11-13 10:35 ` Joakim Tjernlund
2015-11-13 12:16 ` Peter Stuge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox