Make error building enigmail for Debian Lenny AMD64

This forum is for discussions regarding Enigmail alpha and beta versions (Nightly Builds). The versions discussed in this forum are not stable and should not be used in production.

Make error building enigmail for Debian Lenny AMD64

Postby andyr » 26th Nov 2008 18:18

I'm trying to build enigmail for Debian Lenny AMD64 using the same procedure I used to build for Seamonkey on Ubuntu 8.10 but am getting the following error :
Code: Select all
make[2]: Entering directory `/home/andyr/src/iceape/iceape-1.1.12/mailnews/extensions/enigmail/build'
rm -f libenigmime.so
c++  -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -g -O2 -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -O2 -fno-strict-aliasing -g -fPIC -shared -Wl,-z,defs -Wl,-h,libenigmime.so -o libenigmime.so  nsEnigModule.o    -Wl,--as-needed   -Wl,--whole-archive ../src/libenigmime_s.a ../ipc/src/libipc_s.a  -Wl,--no-whole-archive -L../../../../dist/bin -L../../../../dist/lib -L../../../../dist/bin -lxpcom -lxpcom_core  -L../../../../dist/lib -lxpcom_compat -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl   -Wl,--version-script -Wl,../../../../build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm   
nsEnigModule.o: In function `NSGetModule':
/home/andyr/src/iceape/iceape-1.1.12/mailnews/extensions/enigmail/build/nsEnigModule.cpp:178: undefined reference to `NS_NewGenericModule2(nsModuleInfo const*, nsIModule**)'
/usr/bin/ld: nsEnigModule.o: relocation R_X86_64_PC32 against `NS_NewGenericModule2(nsModuleInfo const*, nsIModule**)' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libenigmime.so] Error 1
make[2]: Leaving directory `/home/andyr/src/iceape/iceape-1.1.12/mailnews/extensions/enigmail/build'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/home/andyr/src/iceape/iceape-1.1.12/mailnews/extensions/enigmail'
make: *** [all] Error 2

Any clues as to what I need to do?
andyr
New user
New user
 
Posts: 3
Joined: 8th Nov 2008 19:05

Re: Make error building enigmail for Debian Lenny AMD64

Postby patrick » 27th Nov 2008 13:39

Which version of gcc do you use?
User avatar
patrick
Developer
Developer
 
Posts: 517
Joined: 13th Nov 2005 22:16
Location: Zurich, Switzerland

Re: Make error building enigmail for Debian Lenny AMD64

Postby dkadashev » 27th Nov 2008 16:11

I have a similar issue. Enigmail build fails on Debian Lenny AMD64:
Code: Select all
rm -f libipc.so
c++  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions  -fPIC -shared -Wl,-z,defs -Wl,-h,libipc.so -o libipc.so  nsIPCModule.o     -lpthread   -Wl,-rpath-link,../../../../../mozilla/dist/bin:/usr/lib:/usr/local/lib:/lib  -Wl,--whole-archive ../src/libipc_s.a  -Wl,--no-whole-archive -L../../../../../mozilla/dist/bin -L../../../../../mozilla/dist/lib -L../../../../../mozilla/dist/bin -lxpcom -lxpcom_core  ../../../../../mozilla/dist/lib/libxpcomglue_s.a -L../../../../../mozilla/dist/bin -lxpcom `../../../../../mozilla/nsprpub/config/nspr-config --prefix=../../../../../mozilla/dist --libdir=../../../../../mozilla/dist/lib --libs`   -Wl,--version-script -Wl,/home/builder/mozilla/comm-central/mozilla/build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm   
/usr/bin/ld: ../src/libipc_s.a(nsPipeTransport.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
../src/libipc_s.a(nsPipeTransport.o): could not read symbols: Bad value
collect2: ld returned 1 exit status


Full build log can be found at http://swsoft.nsu.ru/~kadashev/home2/nightly-builds/logs/enigmail-2008-11-27.log
I'm building enigmail for Thunderbird trunk. Thunderbird build log can be found at http://swsoft.nsu.ru/~kadashev/home2/nightly-builds/logs/thunderbird-2008-11-27.log

My configuration:
Debian Lenny AMD64,
gcc: 4.3.2 (Debian 4.3.2-1)
ld: 2.18.0.20080103
dkadashev
New user
New user
 
Posts: 3
Joined: 27th Nov 2008 16:00

Re: Make error building enigmail for Debian Lenny AMD64

Postby patrick » 27th Nov 2008 16:33

In this case, I should point you to this bug: http://bugs.gentoo.org/show_bug.cgi?id=246421

It seems that gcc 4.3.2 on amd64 doesn't work correctly with Thunderbird/Enigmail and Linux.
User avatar
patrick
Developer
Developer
 
Posts: 517
Joined: 13th Nov 2005 22:16
Location: Zurich, Switzerland

Re: Make error building enigmail for Debian Lenny AMD64

Postby andyr » 27th Nov 2008 20:00

I'm going to install 4.2 and try the build again. However, as the packages built by Debian are built using 4.3 should I expect that my build of enigmail (assuming a successful build) will experience problems with the Debian released Iceweasel?
andyr
New user
New user
 
Posts: 3
Joined: 8th Nov 2008 19:05

Re: Make error building enigmail for Debian Lenny AMD64

Postby dkadashev » 28th Nov 2008 04:54

I've already tried to use gcc-4.2 and gcc-4.1. And binutils 2.19. It didn't help.

There are some similar bugs in Gentoo and Debian BTS. And there are some patches in Debian version of enigmail (v0.95). I've tried applying Debian visibility patch, and it didn't help.

I'm quite busy now and can't give much time to this issue. But I'll try to find a solution later.
dkadashev
New user
New user
 
Posts: 3
Joined: 27th Nov 2008 16:00

Re: Make error building enigmail for Debian Lenny AMD64

Postby dkadashev » 1st May 2009 14:10

The problem is that static libraries, which are built w/o -fPIC by default, are used to build dynamic objects (which need -fPIC). This can work on i386, but can't on amd64. Attached patch (which forces using of -fPIC for libenigmime and libipc) fixes problem. It's not the best solution (since it possibly have performance impact), but it works.

One question: when I'm building xpi, I'm getting the following message: "cp: cannot stat `components/libipc.so': No such file or directory". But built package works well. Is it OK, or it needs fixing?

I can't attach patch (getting message "The extension patch is not allowed"), so here it goes:
Code: Select all
diff -ur enigmail.orig/ipc/src/Makefile.in enigmail/ipc/src/Makefile.in
--- enigmail.orig/ipc/src/Makefile.in   2009-05-01 09:08:14.000000000 +0700
+++ enigmail/ipc/src/Makefile.in        2009-05-01 09:20:03.000000000 +0700
@@ -40,6 +40,7 @@
MODULE         = ipc
LIBRARY_NAME   = ipc_s
USE_STATIC_LIBS = 1
+FORCE_USE_PIC  = 1

# extract major and minor version of mozilla

diff -ur enigmail.orig/src/Makefile.in enigmail/src/Makefile.in
--- enigmail.orig/src/Makefile.in       2009-05-01 09:08:14.000000000 +0700
+++ enigmail/src/Makefile.in    2009-05-01 09:08:19.000000000 +0700
@@ -41,6 +41,7 @@
MODULE         = enigmime
LIBRARY_NAME   = enigmime_s
USE_STATIC_LIBS = 1
+FORCE_USE_PIC  = 1

# extract major and minor version of mozilla

dkadashev
New user
New user
 
Posts: 3
Joined: 27th Nov 2008 16:00

Re: Make error building enigmail for Debian Lenny AMD64

Postby patrick » 3rd May 2009 18:43

Thanks, I'll try the patch on 32-bit platforms.

Regarding the error about libipc.so: it's not needed/created unless you build IPC without Enigmail.

Edit: The Windows and Linux 32-bit builds have succeeded; I have added the patch to CVS.
User avatar
patrick
Developer
Developer
 
Posts: 517
Joined: 13th Nov 2005 22:16
Location: Zurich, Switzerland


Return to Development Discussions