When compiling with some-gcc which needs /some-gcc-lib/libxyz.so.1, a way to
compile gcc-python-plugin is to write a wrapper some-gcc.sh:
...
export LD_LIBRARY_PATH=/some-gcc-lib:$LD_LIBRARY_PATH
some-gcc "$@"
...
and use "make CC=some-gcc.sh", which works fine.
However, when we try without wrapper:
...
export LD_LIBRARY_PATH=/some-gcc-lib:$LD_LIBRARY_PATH
make CC=some-gcc
...
we run into:
...
some-gcc/../../lib64/gcc/x86_64-linux/8/cc1: error while loading shared \
libraries: libxyz.so.1: cannot open shared object file: No such file or \
directory
...
because this overwrites LD_LIBRARY_PATH, rather than prepending:
...
LD_LIBRARY_PATH=gcc-c-api CC=some-gcc python run-test-suite.py
...
Fix INVOCATION_ENV_VARS in Makefile to prepend to LD_LIBRARY_PATH.
When compiling with some-gcc which needs /some-gcc-lib/libxyz.so.1, a way to compile gcc-python-plugin is to write a wrapper some-gcc.sh: ... export LD_LIBRARY_PATH=/some-gcc-lib:$LD_LIBRARY_PATH some-gcc "$@" ... and use "make CC=some-gcc.sh", which works fine.
However, when we try without wrapper: ... export LD_LIBRARY_PATH=/some-gcc-lib:$LD_LIBRARY_PATH make CC=some-gcc ... we run into: ... some-gcc/../../lib64/gcc/x86_64-linux/8/cc1: error while loading shared \ libraries: libxyz.so.1: cannot open shared object file: No such file or \ directory ... because this overwrites LD_LIBRARY_PATH, rather than prepending: ... LD_LIBRARY_PATH=gcc-c-api CC=some-gcc python run-test-suite.py ...
Fix INVOCATION_ENV_VARS in Makefile to prepend to LD_LIBRARY_PATH.