Yingshen Yu
2018-01-31 10:53:32 UTC
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
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