[Scons-users] How to build a relocatable object file with Scons?

Yingshen Yu yingshen.yu at gmail.com
Wed Jan 31 05:53:32 EST 2018


Hi experts,

How can I build a relocatable object file with scons?

For example:
I have two source files: a.cpp and b.cpp, here are the manual ways to build
them into a relocatable object file.

g++ -c -fPIC -fvisibility=hidden a.cpp -o a.o
g++ -c -fPIC -fvisibility=hidden b.cpp -o a.o
ld -r a.o b.o -o final.o

I tried StaticLibrary, but it rans ar instead of ld,
I tried SharedLibrary, but it generates a shared library. (.dylib) on my
Mac.

Thanks!
-Jonny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180131/d426527b/attachment.html>


More information about the Scons-users mailing list