Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#12654 - [cryptsetup] fail to build/libcrypt

Attached to Project: Arch Linux
Opened by Baho Utot (baho-utot) - Saturday, 03 January 2009, 15:51 GMT
Last edited by Thomas Bächler (brain0) - Sunday, 07 June 2009, 13:24 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
cryptsetup build fails because of static library missing libgcrypt.a

From the cryptsetup makepkg build:

gcc -march=native -mtune=generic -O2 -pipe -fomit-frame-pointer -o cryptsetup -static cryptsetup.o -lpopt ../lib/.libs/libcryptsetup.a -ldevmapper -lgcrypt -lgpg-error -luuid
/usr/bin/ld: cannot find -lgcrypt

Needs to build static library in libgcrypt

Additional info:
* package version: current abs


Steps to reproduce:
run makepkg on abs cryptsetup

attached is a PKGBUILD patch for libgcrypt

This task depends upon

Closed by  Thomas Bächler (brain0)
Sunday, 07 June 2009, 13:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  Next version of libgcrypt includes the static lib again. We really should move to something else than klibc soon.
Comment by Jan de Groot (JGC) - Saturday, 03 January 2009, 16:34 GMT
Is it really needed to build the static version of cryptsetup? I see it's built both dynamic and static for initrd setups, but building things static against glibc makes these things huge.
Comment by Baho Utot (baho-utot) - Saturday, 03 January 2009, 16:56 GMT
It makes crypsetup build fail, I haven't been able to get cryptsetup to build if I don't build libgcrypt with both static and shared libs.

Even though cryptsetup is set to shared libs in the configure when watching the build you will see it build the shared libs first then build for static libs.

Here is the log entry from the build showing the static build

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../lib -DDATADIR=\""/usr/share"\" -DLOCALEDIR=\""/usr/share/locale"\" -DLIBDIR=\""/usr/lib"\" -DPREFIX=\""/usr"\" -DSYSCONFDIR=\""/usr/etc"\" -DVERSION=\""1.0.6"\" -D_GNU_SOURCE -march=i686 -mtune=generic -O2 -pipe -MT cryptsetup.o -MD -MP -MF ".deps/cryptsetup.Tpo" -c -o cryptsetup.o cryptsetup.c; \
then mv -f ".deps/cryptsetup.Tpo" ".deps/cryptsetup.Po"; else rm -f ".deps/cryptsetup.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link gcc -march=i686 -mtune=generic -O2 -pipe -o cryptsetup -all-static cryptsetup.o -lpopt ../lib/libcryptsetup.la
mkdir .libs

See the -all-static ?
This was from a build where I built the static libs from libgcrypt

Maybe there is another way but I haven't been successful otherwise.
Comment by Baho Utot (baho-utot) - Saturday, 03 January 2009, 17:00 GMT
From the cryptsetup PKGBUILD file:

cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr --enable-static
make || return 1
# include a static cryptsetup binary for initrd setups
install -D -m755 src/cryptsetup $startdir/pkg/sbin/cryptsetup.static || return 1
# install hook
install -D -m644 $startdir/src/encrypt_hook $startdir/pkg/lib/initcpio/hooks/encrypt
install -D -m644 $startdir/src/encrypt_install $startdir/pkg/lib/initcpio/install/encrypt

This is the bad boy.
See the static in configure?
I don't know if the static build is required
Comment by Thomas Bächler (brain0) - Sunday, 04 January 2009, 11:07 GMT
We cannot build this against klibc, I tried once and failed. I'd be glad to have stripped down klibc versions of cryptsetup and lvm that only support cryptsetup luksOpen/create and lvm vgscan/vgchange commands, but that is much work.

Right now, a static build is the only solution.
Comment by Jan de Groot (JGC) - Sunday, 04 January 2009, 12:15 GMT
At my job I implemented an automatic installer using initramfs. I had to switch to uclibc and busybox to get most commands available. lvm2 doesn't build with klibc, but it does build with uclibc. Wouldn't a copy of uclibc and linking these tools dynamic against it be more suitable than trying to patch everything to work with klibc? Linking these tools static against glibc and including them in the initramfs image makes them larger than when linking them to uclibc and including that as dynamic library.
Comment by Thomas Bächler (brain0) - Sunday, 04 January 2009, 14:42 GMT
I've been thinking about that myself. It would certainly be much easier to use uclibc instead of klibc and to compile the kinit stuff from klibc against uclibc.

Loading...