[Scons-users] Force scons to use local libraries over system libraries

暗黑聖飢魔 kugwa2000 at gmail.com
Sat Aug 29 10:03:25 EDT 2020


Hi, is it possible to change the library path search order, so that scons
searches a specific path before the system path?

We try to build an open source project called gem5, which uses scons as its
build system. We need to link gem5 with *libz 1.2.9*. The problem is that
there is already a */usr/lib/libz.so*, whose version is the incompatible
*1.2.8*. Unfortunately, we don't have permission to update the system
libraries.

We have already tried adding the following statement to SConstruct:

    main.Prepend(LIBPATH=['*/path/to/our/libz*'])

but in the build log, we find "*/path/to/our/libz*" is still searched after
"*/usr/lib*":

    scons build/ARM/gem5.opt --verbose
    ...
    g++ -o build/ARM/marshal \
        -L/usr/lib/python2.7/config-x86_64-linux-gnu \
        -L*/usr/lib* \
        -Xlinker \
        -export-dynamic \
        -Wl,-O1 \
        -Wl,-Bsymolic-functions \
        -z origin build/ARM/python/marshar.o \
        -Lbuild/nomail \
        -Lbuild/libfdt \
        -Lbuild/libelf \
        -Lbuild/iostream3 \
        -Lbuild/fputils \
        -Lbuild/drampower \
        -L*/path/to/our/libz* \
        -Lbuild/googletest \
        -lpthread -lm -lpython2.7 *-lz* -lrt -llz4 ...... -ldrampower
-lfputils -liostream3 -lelf -lfdt -lnomali -lpng

It seems the "*/usr/lib*" is specified by scons itself instead of gem5's
scons scripts. Is it possible to bring our "*/path/to/our/libz*" before
that?

Thanks,
Hsuan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200829/6a2d7caf/attachment.html>


More information about the Scons-users mailing list