Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 21994

Asan : Issue with asan library loading

$
0
0

In our build system we have recently integrated ASAN tool (adding -fsanitize=address) to CFLAGS & also while linking , creating library .so files. Note:- We are using GCC 6.3 compiler.

We are able to successfully build our code. But while running it fails with following issue:

==52215==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

Here is my gcc command:-

/local/common/pkgs/gcc/v6.3.0/bin/gcc -m32 -shared -o /local/testing/build/new_tool/asan_build/syn/verilog/libspd.so  -Wl,-rpath=\$ORIGIN/lib -Wl,-rpath=\$ORIGIN/../lib -W1,-rpath=/local/common/gcc/v6.3.0/lib  -fsanitize=address -L/local/testing/build/new_tool/asan_build/modules /local/testing/build/new_tool/asan_build/modules/silvpi.o /local/testing/build/new_tool/asan_build/modules/sypsv.o /local/testing/build/new_tool/asan_build/modules/cdnsv_tfs.o /local/testing/build/new_tool/asan_build/modules/libcore.o /local/testing/build/new_tool/asan_build/modules/vpi_user.o /local/testing/build/new_tool/asan_build/modules/libdenbase.a /local/testing/build/new_tool/asan_build/modules/libbdd.a  -L/local/testing/build/new_tool/asan_build/syn/lib -L/local/testing/build/new_tool/asan_build/modules -L/home/local/outer/Linux/lib /local/testing/build/new_tool/asan_build/modules/vhpimodelfunc.o /local/testing/build/new_tool/asan_build/modules/vipcommonlib.a  -lm -lc -ldenbase -lbdd -ldenbase -lviputil -llocalCommonMT_sh

I am able to build library libspd.so successfully. But when we try to run it fails with above error i mentioned.

i can see the dependent library list of libspd.so

ldd /local/testing/build/new_tool/asan_build/syn/verilog/libspd.so
    linux-gate.so.1 =>  (0x00279000)
    libasan.so.3 => /local/pkgs/gcc/v6.3.0/lib/libasan.so.3 (0xf7175000)
    libm.so.6 => /lib/libm.so.6 (0x0014e000)
    libc.so.6 => /lib/libc.so.6 (0xf6f83000)
    libcdsCommonMT_sh.so => /local/testing/build/new_tool/asan_build/verilog/../lib/liblocalCommonMT_sh.so (0x00178000)
    libdl.so.2 => /lib/libdl.so.2 (0x00197000)

Based on the error i tried to set LD_PRELOAD Variable to complete path of asan library i.e.setenv LD_PRELOAD /local/pkgs/gcc/v6.3.0/lib/libasan.so in one of my environment file where LD_LIBRARY_PATH was also set there. Then after i started running, Now it is failing with

error : ERROR: ld.so: object '/local/pkgs/gcc/v6.3.0/lib/libasan.so' from LD_PRELOAD cannot be preloaded: ignored.

Not sure whats going wrong here. How can i resolve this issue?

Any idea? Thanks and regards!


Viewing all articles
Browse latest Browse all 21994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>