Closed mattgodbolt closed 3 years ago
Example of the problem:
$ echo 'void main(){}' | bin/x86_64-conda_cos6-linux-gnu-gcc -fsanitize=address -x c -
/tmp/moo/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libstdc++.so.6, needed by /tmp/moo/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/lib/../lib/libasan.so, not found (try using -rpath or -rpath-link)
but it the rpath
is actually set:
$ patchelf --set-rpath '$ORIGIN' lib/libasan.so
$ echo 'void main(){}' | bin/x86_64-conda_cos6-linux-gnu-gcc -fsanitize=address -x c -
$
it compiles without error. It seems the recipe goes out of its way to disable conda's default rpath
patching: https://github.com/conda-forge/ctng-compilers-feedstock/blob/7a4f650a775b7248246631a4f94726e50d2df35f/recipe/meta.yaml#L317 - there's not a clear reason why this is not enabled (though there's some other things that are enabled for binary relocation, and indeed some patchelf
things going on too)
I'm not sure why binary_relocation
is disabled. Let's try enabling them.
Fixed in #74
Confirmed fixed! Thank you so much!
Issue: all the lib*.so files installed by libgcc-ng, and libgomp, have an unpatched
RPATH
which means (for example), linking againstlibasan.so
can yield linker errors (e.g. unable to find thelibstdc++.so.6
thatlibasan
requires, as it doesn't look in$ORIGIN
etc).Environment (
conda list
):Details about
conda
and system (conda info
):