But I got following errors while linking:
Code: Select all
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: /root/xulrunner-sdk/lib/libxpcomglue_s.a(nsThreadUtils.o): relocation R_X86_64_PC32 against `nsIThreadManager::COMTypeInfo<int>::kIID' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: final link failed: Bad value
But if I compile the same makefile on RedHat Enterprise Linux 6.2, it generates the .so xpcom component successfully.
Here is the link part of my makefile:
Code: Select all
LIBS := -lxpcomglue_s -lxpcom -lnspr4 -lmozalloc
g++ -L/root/xulrunner-sdk/lib -L/root/xulrunner-sdk/bin -pthread -Wl,-rpath-link,/root/xulrunner-sdk/bin -shared -o "libmyxpcom.so" $(OBJS) $(USER_OBJS) $(LIBS)
The problem is the g++ of SUSE Linux Enterprise 10 SP3 seems can't link to libxpcomglue_s.a, and required a dynamic library version "libxpcomglue_s.so", but the g++ of RedHat Enterprise Linux 6.2 doesn't have such problem, maybe its because the g++ version, I guess.
So what should I do in order to make the build pass? I can't update the g++ version on SUSE Linux Enterprise 10 SP3 due to our customer requirement. Should I make a full build of xulrunner-sdk source code on SUSE Linux Enterprise 10 SP3? Will there be a dynamic library version "libxpcomglue_s.so" generated after I perform a full build? Or how can I configure the build option so that I can build a "libxpcomglue_s.so" out of xulrunner-sdk source code?