-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/18/2012 12:58 PM, Leonid Isaev wrote:
On Sat, 18 Feb 2012 12:43:07 -0600 "David C. Rankin" <drankinatty@suddenlinkmail.com> wrote:
Guys
The update to shadow has caused problems and I needed to rebuild shadow 4.1.4.3-5. I have run into the DSO error regarding libattr. I know I need to update the Makefile.am or patch the Makefile after the ./configure, but I'm not having any luck. The error is:
/bin/sh ../libtool --tag=CC --mode=link gcc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -lcrypt -o useradd useradd.o ../libmisc/libmisc.a ../lib/libshadow.la -lpam -lpam_misc -lacl libtool: link: gcc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z -Wl,relro -Wl,--hash-style=gnu -o .libs/useradd useradd.o ../libmisc/libmisc.a ../lib/.libs/libshadow.so -lcrypt -lpam -lpam_misc -lacl /usr/bin/ld: ../libmisc/libmisc.a(copydir.o): undefined reference to symbol 'attr_copy_fd@@ATTR_1.1' /usr/bin/ld: note: 'attr_copy_fd@@ATTR_1.1' is defined in DSO /lib/libattr.so.1 so try adding it to the linker command line /lib/libattr.so.1: could not read symbols: Invalid operation collect2: ld returned 1 exit status
I think I need the explicit -llibattr in the CFLAGS line of the Makefile, but trying to patch it after ./configure isn't working. How do I properly handle this?
See the diff here: http://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/shadow&id=f0072b844c5bc17797c6b483acfec170a5024163
Thank you Leonid! That was the help I needed. I particularly liked Aaron or Dave's comments in the existing PKGBUILD: # #Ugh, force this to build shared libraries, for god's sake # sed -i "s/noinst_LTLIBRARIES/lib_LTLIBRARIES/g" lib/Makefile.am The primary fix was the new Makefile.am update: # avoid transitive linking issues with binutils 2.22 sed -i '/^user\(mod\|add\)_LDADD/s|$| -lattr|' src/Makefile.am I don't know if there is any interest is fixing the pkgbuild for the old version or if this is the type of thing that just becomes an AUR package. I incorporated the clean-ups that are in the shadow 5 package. The diff for the existing 4.1.4.3-5 PKGBUILD needed in order to rebuild it on Arch is: - --- shadow/PKGBUILD +++ shadow/PKGBUILD 2012-02-18 14:27:01.108051179 -0600 @@ -17,7 +17,7 @@ etc/pam.d/{chfn,chgpasswd,groupmems,chsh} etc/default/useradd) options=('!libtool') - -install=shadow.install +install='shadow.install' #http://pkg-shadow.alioth.debian.org/releases/shadow-$pkgver.tar.bz2 # shadow 4.1.4.3 is just shadow 4.1.4.2 with shadow_CVE-2011-0721.patch applied source=(ftp://ftp.archlinux.org/other/shadow/shadow_4.1.4.2+svn3283.orig.tar.gz @@ -42,14 +42,16 @@ '9db9e62ad173f31e1039121c0124cf60826ffd7e' '0697a21f7519de30821da7772677035652df4ad2') + build() { cd "$srcdir/$pkgname-4.1.4.2+svn3283" - - #Ugh, force this to build shared libraries, for god's sake - - sed -i "s/noinst_LTLIBRARIES/lib_LTLIBRARIES/g" lib/Makefile.am + # avoid transitive linking issues with binutils 2.22 + sed -i '/^user\(mod\|add\)_LDADD/s|$| -lattr|' src/Makefile.am + libtoolize autoreconf - - export LDFLAGS="$LDFLAGS -lcrypt" + LDFLAGS+=" -lcrypt" patch -p1 -i "$srcdir/xstrdup.patch" patch -p1 -i "$srcdir/shadow_CVE-2011-0721.patch" @@ -60,10 +62,13 @@ sed -i '/^SUBDIRS/s/pam.d//' etc/Makefile.in ./configure \ - - --prefix=/usr --libdir=/lib \ - - --mandir=/usr/share/man --sysconfdir=/etc \ - - --enable-shared --disable-static \ - - --with-libpam --without-selinux + --prefix=/usr \ + --libdir=/lib \ + --mandir=/usr/share/man \ + --sysconfdir=/etc \ + --with-libpam \ + --without-selinux + make } @@ -87,11 +92,9 @@ install -Dm644 "$srcdir/login.defs" "$pkgdir/etc/login.defs" # PAM config - custom - - install -Dm644 "$srcdir/login" "$pkgdir/etc/pam.d/login" - - install -Dm644 "$srcdir/passwd" "$pkgdir/etc/pam.d/passwd" - - install -Dm644 "$srcdir/chgpasswd" "$pkgdir/etc/pam.d/chgpasswd" - - install -Dm644 "$srcdir/chpasswd" "$pkgdir/etc/pam.d/chpasswd" - - install -Dm644 "$srcdir/newusers" "$pkgdir/etc/pam.d/newusers" + install -dm644 "$pkgdir/etc/pam.d" + install -t "$pkgdir/etc/pam.d" -m644 "$srcdir"/{login,passwd,chgpasswd,chpasswd,newusers} + # PAM config - from tarball install -Dm644 etc/pam.d/groupmems "$pkgdir/etc/pam.d/groupmems" - -- David C. Rankin, J.D.,P.E. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9AC28ACgkQZMpuZ8CyrciEFACeP1UFWIJkNKR6SlBy9vFOT670 V3IAnRx3K3qoyfac31COpl7nbkKtqY2l =lyaZ -----END PGP SIGNATURE-----