Package: src:pam
Version: 1.1.8-3.7
Severity: normal
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

Hi,
After the latest upload of flex, cross-compiling pam fails with:

> libtool: link: gcc -o padout parse_l.o parse_y.o  
> /usr/lib/aarch64-linux-gnu/libfl.so
> /usr/lib/aarch64-linux-gnu/libfl.so: error adding symbols: File in wrong 
> format

This is because pam uses libtool configured for the host architecture to build
padout, but since flex now ships a libfl.la, libtool expands this out to
/usr/lib/$DEB_HOST_MULTIARCH/libfl.so as specified in libfl.la. The attached
patch fixes this by introducing a separate configure script for the doc/specs
subdirectory, which is configured with the host arch set to the build arch and
generates its own libtool for the subdirectory's host architecture i.e. the
real build architecture. This has been tested for both a native amd64 build as
well as an arm64 cross-build from amd64.

Regards,
James
diff -u pam-1.1.8/debian/patches-applied/series 
pam-1.1.8/debian/patches-applied/series
--- pam-1.1.8/debian/patches-applied/series
+++ pam-1.1.8/debian/patches-applied/series
@@ -29,0 +30 @@
+libtool-build-arch.patch
only in patch2:
unchanged:
--- pam-1.1.8.orig/debian/autoreconf
+++ pam-1.1.8/debian/autoreconf
@@ -0,0 +1,4 @@
+# Since a custom macro is used for the subdirectory configuration rather than
+# AC_CONFIG_SUBDIRS, we don't get any autodetection in autoreconf...
+.
+doc/specs
only in patch2:
unchanged:
--- pam-1.1.8.orig/debian/patches-applied/libtool-build-arch.patch
+++ pam-1.1.8/debian/patches-applied/libtool-build-arch.patch
@@ -0,0 +1,222 @@
+--- a/configure.in
++++ b/configure.in
+@@ -599,6 +599,8 @@ AC_SUBST([HAVE_KEY_MANAGEMENT], $HAVE_KE
+ 
+ AM_CONDITIONAL([HAVE_KEY_MANAGEMENT], [test "$have_key_syscalls" = 1])
+ 
++PAM_CONFIG_SUBDIRS_FOR_BUILD([doc/specs])
++
+ dnl Files to be created from when we run configure
+ AC_CONFIG_FILES([Makefile libpam/Makefile libpamc/Makefile 
libpamc/test/Makefile \
+       libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
+@@ -628,7 +630,7 @@ AC_CONFIG_FILES([Makefile libpam/Makefil
+       modules/pam_umask/Makefile \
+       modules/pam_unix/Makefile modules/pam_userdb/Makefile \
+       modules/pam_warn/Makefile modules/pam_wheel/Makefile \
+-      modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \
++      modules/pam_xauth/Makefile doc/Makefile \
+       doc/man/Makefile doc/sag/Makefile doc/adg/Makefile \
+       doc/mwg/Makefile examples/Makefile tests/Makefile \
+       xtests/Makefile])
+--- /dev/null
++++ b/doc/specs/configure.in
+@@ -0,0 +1,29 @@
++dnl Process this file with autoconf to produce a configure script.
++AC_INIT([Linux-PAM], 1.1.8)
++AM_INIT_AUTOMAKE([foreign])
++LT_INIT([disable-static])
++AC_PREREQ([2.61])
++
++dnl This gets called from the root configure script with our host equal to its
++dnl build arch, as we want to build a native padout.
++AC_CANONICAL_HOST
++
++dnl Checks for programs.
++AC_USE_SYSTEM_EXTENSIONS
++AC_PROG_CC
++AC_PROG_YACC
++AM_PROG_LEX
++AC_PROG_INSTALL
++AC_PROG_LN_S
++AC_PROG_MAKE_SET
++AM_PROG_CC_C_O
++PAM_LD_AS_NEEDED
++PAM_LD_NO_UNDEFINED
++PAM_LD_O1
++
++dnl Largefile support
++AC_SYS_LARGEFILE
++
++dnl Files to be created from when we run configure
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
+--- /dev/null
++++ b/m4/config-subdirs-for-build.m4
+@@ -0,0 +1,146 @@
++# config-subdirs-for-build.m4
++
++dnl TODO
++AC_DEFUN([PAM_CONFIG_SUBDIRS_FOR_BUILD],
++  [
++    # Remove --cache-file, --srcdir, and --disable-option-checking arguments
++    # so they do not pile up. Also remove --host/--target as we will be
++    # overriding them, and various arch-dependent --foodir options.
++    ac_sub_configure_args=
++    ac_prev=
++    eval "set x $ac_configure_args"
++    shift
++    for ac_arg
++    do
++      if test -n "$ac_prev"; then
++        ac_prev=
++        continue
++      fi
++      case $ac_arg in
++      -cache-file | --cache-file | --cache-fil | --cache-fi \
++      | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
++        ac_prev=cache_file ;;
++      -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
++      | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
++      | --c=*)
++        ;;
++      --config-cache | -C)
++        ;;
++      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
++        ac_prev=srcdir ;;
++      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
++        ;;
++      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
++        ac_prev=prefix ;;
++      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | 
--p=*)
++        ;;
++      --disable-option-checking)
++        ;;
++      -host | --host | --hos | --ho)
++        ac_prev=host_alias ;;
++      -host=* | --host=* | --hos=* | --ho=*)
++        ;;
++      -target | --target | --targe | --targ | --tar | --ta | --t)
++        ac_prev=target_alias ;;
++      -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | 
--t=*)
++        ;;
++      -bindir | --bindir | --bindi | --bind | --bin | --bi)
++        ac_prev=bindir ;;
++      -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
++        ;;
++      -includedir | --includedir | --includedi | --included | --include \
++      | --includ | --inclu | --incl | --inc)
++        ac_prev=includedir ;;
++      -includedir=* | --includedir=* | --includedi=* | --included=* | 
--include=* \
++      | --includ=* | --inclu=* | --incl=* | --inc=*)
++        ;;
++      -libdir | --libdir | --libdi | --libd)
++        ac_prev=libdir ;;
++      -libdir=* | --libdir=* | --libdi=* | --libd=*)
++        ;;
++      -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
++      | --libexe | --libex | --libe)
++        ac_prev=libexecdir ;;
++      -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | 
--libexec=* \
++      | --libexe=* | --libex=* | --libe=*)
++        ;;
++      *)
++        case $ac_arg in
++        CC=* | CFLAGS=* | LDFLAGS=* | host_alias=* | target_alias=* \
++        | \'CC=* | \'CFLAGS=* | \'LDFLAGS=* | \'host_alias=* | 
\'target_alias=*)
++          continue ;;
++        *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
++        esac
++        AS_VAR_APPEND([ac_sub_configure_args], [" '$ac_arg'"]) ;;
++      esac
++    done
++
++    # Always prepend --prefix to ensure using the same prefix
++    # in subdir configurations.
++    ac_arg="--prefix=$prefix"
++    case $ac_arg in
++    *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
++    esac
++    ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
++
++    # Pass --silent
++    if test "$silent" = yes; then
++      ac_sub_configure_args="--silent $ac_sub_configure_args"
++    fi
++
++    # Always prepend --disable-option-checking to silence warnings, since
++    # different subdirs can have different --enable and --with options.
++    ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
++
++    m4_foreach([VAR], [CC],
++      [
++        if test -n "$[]VAR[]_FOR_BUILD"; then
++          ac_sub_configure_args="$ac_sub_configure_args 
'VAR=$[]VAR[]_FOR_BUILD'"
++        fi
++      ]
++    )
++    m4_foreach([VAR], [CFLAGS, LDFLAGS],
++      [
++        if test -n "$BUILD_[]VAR"; then
++          ac_sub_configure_args="$ac_sub_configure_args 
'VAR=$[]VAR[]_FOR_BUILD'"
++        fi
++      ]
++    )
++
++    ac_popdir=`pwd`
++    ac_dir=`pwd`/$1
++    case $srcdir in
++      .)  # We are building in place.
++        ac_srcdir=. ;;
++      [[\\/]]* | ?:[[\\/]]* )  # Absolute name.
++        ac_srcdir=$srcdir$1; ;;
++      *) # Relative name.
++        ac_srcdir=$ac_top_build_prefix$srcdir$1 ;;
++    esac
++
++    ac_msg="=== configuring in $1 ($ac_dir)"
++    AC_MSG_NOTICE([$ac_msg])
++
++    cd "$ac_dir"
++
++    ac_sub_configure=$ac_srcdir/configure
++
++    case $cache_file in
++    [[\\/]]* | ?:[[\\/]]* )
++      # Absolute path; could point to our tree, but that requires more complex
++      # checking, so just disable caching.
++      ;;
++    *)
++      # Relative path; leave alone so it's different for the subdir.
++      ac_sub_configure_args="$ac_sub_configure_args 
--cache-file='$cache_file'" ;;
++    esac
++
++    AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args 
--srcdir=$ac_srcdir])
++    # The eval makes quoting arguments work.
++    eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
++         --srcdir=\"\$ac_srcdir\"" ||
++      AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
++
++    cd "$ac_popdir"
++  ]
++)
+--- a/doc/specs/Makefile.am
++++ b/doc/specs/Makefile.am
+@@ -1,6 +1,7 @@
+ #
+ # Copyright (c) 2005, 2006, 2010 Thorsten Kukuk <ku...@suse.de>
+ #
++# Builds for the build arch; see configure.in in the current directory.
+ 
+ CLEANFILES = draft-morgan-pam-current.txt *~
+ 
+@@ -11,10 +12,6 @@ draft-morgan-pam-current.txt: padout dra
+ 
+ AM_YFLAGS = -d
+ 
+-CC = @CC_FOR_BUILD@
+-CFLAGS = @BUILD_CFLAGS@
+-LDFLAGS = @BUILD_LDFLAGS@
+-
+ BUILT_SOURCES = parse_y.h
+ 
+ noinst_PROGRAMS = padout

Reply via email to