build xpcom component failed on SUSE Enterprise Linux 10 SP3

Discussion of third-party/unofficial Firefox/Thunderbird/SeaMonkey builds.
Post Reply
mazhaojia
Posts: 3
Joined: May 27th, 2013, 4:58 am

build xpcom component failed on SUSE Enterprise Linux 10 SP3

Post by mazhaojia »

Hi, I am using SUSE Linux Enterprise 10 SP3 and xulrunner sdk 12.0 to build my xpcom component.
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?
xunxun1982
Posts: 311
Joined: June 20th, 2011, 10:37 am

Re: build xpcom component failed on SUSE Enterprise Linux 10

Post by xunxun1982 »

Can you recompile the module /root/xulrunner-sdk/lib/libxpcomglue_s.a with adding CFLAGS+=-fPIC
mazhaojia
Posts: 3
Joined: May 27th, 2013, 4:58 am

Re: build xpcom component failed on SUSE Enterprise Linux 10

Post by mazhaojia »

Hi, xunxun1982, thank you very much for your reply.

Today I put all the source tarball of xulrunner-12.0 onto SUSE Linux Enterprise 10 sp3, trying to build it out, but unfortunately it didn't pass the configure phase. To build xulrunner it needs gtk+ 2.10, but SUSE Linux Enterpeise 10 sp3 only has gtk+ 2.8

Could you give me any hint or method about how to recompile the module /root/xulrunner-sdk/lib/libxpcomglue_s.a on SUSE Linux Enterpeise 10 sp3 ?
xunxun1982
Posts: 311
Joined: June 20th, 2011, 10:37 am

Re: build xpcom component failed on SUSE Enterprise Linux 10

Post by xunxun1982 »

@mazhaojia

Sorry, I don't have SUSE machine. Could you try to build gtk+2.10 first yourself, and recompile the xulrunner?
mazhaojia
Posts: 3
Joined: May 27th, 2013, 4:58 am

Re: build xpcom component failed on SUSE Enterprise Linux 10

Post by mazhaojia »

Anyway, thank you @xunxun1982 !
Post Reply