[pacman-dev] Unable to compile pacman in ubuntu-11.10
Talespin Kit
talespin_kit at yahoo.com
Fri Mar 30 08:12:11 EDT 2012
Finally managed to compile in ubuntu-11.10.
Seems the problem was the Makefile generated by the configure script for the **libalpm**
does not add the **libcrypto** as dependency in the LIBS variable.
Below is the steps.
I have used the git commit e6f72c61a098b52ea29e54b8eb4739a2ff81e6b0in
repo git://projects.archlinux.org/pacman.git
1) $ git clean -xfd; ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--enable-git-version --enable-debug --without-gpgme
2) cd lib/libalpm
3) In the Makefile replace line
LIBS = -lssl -larchive -lm
with
LIBS = -lssl -larchive -lm -lcrypto
4) cd ../../ && make
------
TalespinKit
________________________________
From: Dave Reisner <d at falconindy.com>
To: Talespin Kit <talespin_kit at yahoo.com>; Discussion list for pacman development <pacman-dev at archlinux.org>
Sent: Thursday, March 29, 2012 6:16 PM
Subject: Re: [pacman-dev] Unable to compile pacman in ubuntu-11.10
On Thu, Mar 29, 2012 at 08:17:51AM -0400, Dave Reisner wrote:
> On Thu, Mar 29, 2012 at 04:42:04AM -0700, Talespin Kit wrote:
> > Some improvement over the build by providing --without-gpgme arg to
> > ./configure script .
> >
> > The complete steps is mentioned below
> >
> >
> > $ git clean -xfd; ./autogen.sh && ./configure --without-gpgme && make
> >
> > ..........
> > make[3]: Leaving directory `/home/user/tmp/pacman/lib/libalpm'
> > make[2]: Leaving directory `/home/user/tmp/pacman/lib/libalpm'
> > Making all in src/util
> > make[2]: Entering directory `/home/user/tmp/pacman/src/util'
> > CC vercmp.o
> > CCLD vercmp
> > CC testpkg.o
> > CCLD testpkg
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `MD5_Init'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `MD5_Final'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Init'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Update'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `MD5_Update'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Final'
> >
> >
> > The actual command executed while tryint to linking is found by running dry make (make -n )
> >
> > cd pacman/src/util
> >
> > $ /bin/bash ../../libtool --silent --tag=CC --mode=link gcc -std=gnu99 -pedantic -D_GNU_SOURCE -g -O2 -Wall -o testpkg testpkg.o ../../lib/libalpm/.libs/libalpm.la -lssl -larchive -lm
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `MD5_Init'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `MD5_Final'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Init'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Update'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `MD5_Update'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Final'
> > collect2: ld returned 1 exit status
> >
> >
> > Now finding which library contains **MD5_Init** symbol using the below
> >
> > bash commands
> >
> > for i in `find /usr/lib -type f -name '*.so.*'`;
> > do
> > nm -D $i | grep MD5_Init;
> > if [ $? -eq 0 ];
> >
> > then
> >
> > echo $i;
> > fi;
> > done
> >
> >
> > Output:-
> >
> > ======
> > 00004320 T MD5_Init
> > /usr/lib/i386-linux-gnu/libgnutls-openssl.so.26.16.14
>
> No, that's the wrong library -- we link against openssl's libcrypto.
> Is libssl-dev installed?
>
> NB: I've yet to be able to build pacman successfully against anything
> involving gnutls, and i've even had build failures when libarchive
> linked to gnutls (though that may have been resolved by binutils 2.22).
>
> >
> > Now linking with the libgnutls-openssl library
> >
> >
> > $ /bin/bash ../../libtool --silent --tag=CC --mode=link gcc -std=gnu99 -pedantic -D_GNU_SOURCE -g -O2 -Wall -o testpkg testpkg.o ../../lib/libalpm/.libs/libalpm.la -lssl -larchive -lm -lgnutls-openssl
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Init'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Update'
> > ../../lib/libalpm/.libs/libalpm.so: undefined reference to `SHA256_Final'
> > collect2: ld returned 1 exit status
> >
> >
> > Only MD5_* symbols are able to find by ld.
> >
> > Problem with SHA256_* symbols. Finding the **SHA256_Init** symbol
> > using the above bash commands outputs.
> >
> > 00187db0 T SHA256_Init
> > /usr/lib/libgs.so.9.04
>
> This is ghostscript... I assure you we don't link against this. It
> should all be covered by openssl.
>
> >
> > Trying to link with the libgs.so.9.04 library gives the following error.
> >
> >
> > $ /bin/bash ../../libtool --silent --tag=CC --mode=link gcc -std=gnu99 -pedantic -D_GNU_SOURCE -g -O2 -Wall -o testpkg testpkg.o ../../lib/libalpm/.libs/libalpm.la -lssl -larchive -lm -lgnutls-openssl -lgs
> > /usr/bin/ld: cannot find -lgs
> > collect2: ld returned 1 exit status
> >
> >
> > No idea why the linker fails to find the libgs library.
> >
Ok, so I just compiled this on a 10.04 install...
$ ./configure --prefix=/usr --sysconfdir=/etc \
--localstatedir=/var --enable-git-version \
--enable-debug --without-gpgme
readelf shows the following linkages:
$ readelf -d ./lib/libalpm/.libs/libalpm.so
Dynamic section at offset 0x29d58 contains 27 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libcurl-gnutls.so.4]
0x0000000000000001 (NEEDED) Shared library: [libssl.so.0.9.8]
0x0000000000000001 (NEEDED) Shared library: [libarchive.so.2]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000e (SONAME) Library soname: [libalpm.so.7]
...
$ readelf -d ./src/pacman/.libs/pacman
Dynamic section at offset 0x18de0 contains 27 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libalpm.so.7]
0x0000000000000001 (NEEDED) Shared library: [libcurl-gnutls.so.4]
0x0000000000000001 (NEEDED) Shared library: [libssl.so.0.9.8]
0x0000000000000001 (NEEDED) Shared library: [libarchive.so.2]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
...
dave
More information about the pacman-dev
mailing list