[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#862176: gcc-snapshot: needs packages from experimental, with -fsanitize=address



Control: reopen -1
Control: severity -1 minor
Control: retitle -1 gcc-snapshot: README.Debian is inaccurate concerning LD_LIBRARY_PATH

On 2017-05-10 00:00:10 +0200, Matthias Klose wrote:
> set LD_LIBRARY_PATH for running your binaries.

OK, I now understand (I didn't see that gcc-snapshot provided
/usr/lib/gcc-snapshot/lib/libasan.so.4), but this was not clear.
The /usr/share/doc/gcc-snapshot/README.Debian file first says:

------------------------------------------------------------------------
To use this snapshot, you should set the following environment variables:

        LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH
        PATH=/usr/lib/gcc-snapshot/bin:$PATH
------------------------------------------------------------------------

That way, things will work. But just after, it suggests an alternate
solution:

------------------------------------------------------------------------
You might also like to use a shell script to wrap up this 
funcationality, e.g. 
 
place in /usr/local/bin/gcc-snapshot and chmod +x it 
 
----------- snip ----------
#! /bin/sh
LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH
PATH=/usr/lib/gcc-snapshot/bin:$PATH
gcc "$@"
----------- snip ----------

Make the same for g++, g77, gij, gcj, cpp, ...
------------------------------------------------------------------------

This is the solution I'm currently using, but as you say, this may
not be sufficient. There should be some warning saying that under
some conditions, such as the use of the address sanitizer, the
LD_LIBRARY_PATH will also be needed for the generated binaries.
Or...

> closing this issue, there is no "propoer" solution.

I'm just thinking... Couldn't the use of a run path for
/usr/lib/gcc-snapshot/lib be a proper solution? i.e. give
a better wrapper as an example? For instance, on amd64,
the wrapper could be:

----------- snip ----------
#!/bin/sh
LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH
PATH=/usr/lib/gcc-snapshot/bin:$PATH
exec gcc -Wl,-rpath -Wl,/usr/lib/gcc-snapshot/lib \
         -Wl,-rpath -Wl,/usr/lib/gcc-snapshot/lib32 \
         -Wl,-rpath -Wl,/usr/lib/gcc-snapshot/libx32 "$@"
----------- snip ----------

This seems to work (I've tested on amd64 with and without -m32).
Wouldn't this be a better solution?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: