- question one:
the following stuff appears a lot in the mozilla build process.
will it work?
*.o files are compiled with -fPIC and then combined into .a file
using “ar cr file.a *.o”.
(is this file.a a shared or static object?).
some new *.o files are compiled with -fPIC and
file.a is then used in the following way.
gcc -shared … -o newobj.so *.o /lib/file.a
is this allowed?
can “gcc -shared” create a shared object, which links to *.a file (static?)?
2) question two:
*.o files are compiled with -fPIC
can the shared obj be created without “-shared” option?
gcc -Wl,-soname,libmy.so.1 -o libmy.so *.o
I’ve seen this behavior (with -shared when linking) in some places.
is it allowed in qnx?
what are the diferences in libmy.so file, when you use or not use “-shared”?
- question three:
can the “-Wl,-rpath,…” be used to generate the shared obj to embbed
the lib search path? is it being honored by the OS? 6.1A? 6.2(bmw)?
- question four:
what is the reasoning to link to other libs while generating shared
objs (seen this a lot in mozilla build):
gcc -shared -Wl,-soname,libapp1.so.1 -o libapp1.so *.o -L/other/lib -lapp2 -lapp3 ?
in this example, do app2, app3 have to a shared lib also? or it can be
a static lib? (I tried it on linux, it seems app2/app3 can be a mix of
shared/static libs, but on qnx6, not allowed.
thanks in advance for any clarifications.
Frank