Re: libpthread fails to build as an add-on

2014-03-23 Thread Manolis Ragkousis
As Ludovic wrote

  Actually libc's configure doesn't use the normal AC_CONFIG_SUBDIRS
  mechanism, and instead runs add-on configure scripts by itself, without
  arguments AFAICS.

The part responsible for this is in the attached file and specifically the
part:
  libc_add_on_frag=$libc_add_on_srcdir/configure

I was thinking of modifying the configure script so it would use the
AC_CONFIG_SUBDIRS mechanism and configure all the addons with the flags
passed in the glibc configure.
Then I would apply the patch in a patch-phase before configure gets called
in guix.
What do you think?

Manolis
  # Now source each add-on's configure fragment.
  # The fragments can use $srcdir/$libc_add_on to find themselves,
  # and test $add_ons_automatic to see if they were explicitly requested.
  # A fragment can clear (or even change) $libc_add_on to affect
  # whether it goes into the list to be actually used in the build.
  use_add_ons=
  for libc_add_on in $add_ons; do
# Test whether such a directory really exists.
# It can be absolute, or relative to $srcdir, or relative to the build dir.
case $libc_add_on in
/*)
  libc_add_on_srcdir=$libc_add_on
  ;;
*)
  test -d $srcdir/$libc_add_on || {
if test -d $libc_add_on; then
  libc_add_on=`pwd`/$libc_add_on
else
  as_fn_error $? add-on directory \$libc_add_on\ does not exist 
$LINENO 5
fi
  }
  libc_add_on_srcdir=$srcdir/$libc_add_on
  ;;
esac

libc_add_on_frag=$libc_add_on_srcdir/configure 
libc_add_on_canonical=
libc_add_on_config_subdirs=
if test -r $libc_add_on_frag; then
  { $as_echo $as_me:${as_lineno-$LINENO}: running configure fragment for 
add-on $libc_add_on 5
$as_echo $as_me: running configure fragment for add-on $libc_add_on 6;}
  libc_add_on_canonical=unknown
  libc_add_on_subdirs=
  . $libc_add_on_frag
  test -z $libc_add_on || {
configured_add_ons=$configured_add_ons $libc_add_on
if test x$libc_add_on_canonical = xunknown; then
  as_fn_error $? fragment must set \$libc_add_on_canonical $LINENO 5
fi
for d in $libc_add_on_subdirs; do
  case $libc_add_on in
  /*) subdir_srcdir=$libc_add_on ;;
  *) subdir_srcdir=\$(..)$libc_add_on ;;
  esac
  case $d in
  .)
d=${libc_add_on_canonical:-$libc_add_on}
;;
  /*)
subdir_srcdir=$d
;;
  *)
subdir_srcdir=$subdir_srcdir/$d
;;
  esac
  d=`echo $d | sed 's@/*$@@;s@^.*/@@'`
  add_on_subdirs=$add_on_subdirs $d
  test $subdir_srcdir = \$(..)$d || config_vars=$config_vars
$d-srcdir = $subdir_srcdir
done
for d in $libc_add_on_config_subdirs; do
  case $d in
  /*) as_fn_error $? fragment uses absolute path in 
\$libc_add_on_config_subdirs $LINENO 5 ;;
  esac
  if test ! -d $libc_add_on_srcdir/$d; then
as_fn_error $? fragment wants to configure missing directory $d 
$LINENO 5
  fi
  case $libc_add_on in
  /*) as_fn_error $? relative path required for add-on using 
\$libc_add_on_config_subdirs $LINENO 5 ;;
  esac
  subdirs=$subdirs $libc_add_on/$d
done
  }
fi
if test -n $libc_add_on; then
  if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2 /dev/null`
then
  { $as_echo $as_me:${as_lineno-$LINENO}: checking add-on $libc_add_on for 
preconfigure fragments 5
$as_echo_n checking add-on $libc_add_on for preconfigure fragments...  6; }
  for frag in $frags; do
name=`echo $frag | sed 's@/[^/]*$@@;s@^.*/@@'`
echo $ECHO_N $name $ECHO_C 6
. $frag
  done
  { $as_echo $as_me:${as_lineno-$LINENO}: result:  5
$as_echo  6; }
fi
  use_add_ons=$use_add_ons $libc_add_on
  add_ons_pfx=$add_ons_pfx $libc_add_on/
  test -z $libc_add_on_canonical ||
  add_ons_sfx=$add_ons_sfx /$libc_add_on_canonical
fi
  done
  # Use echo to strip excess whitespace.
  add_ons=`echo $use_add_ons`
fi


Re: libpthread fails to build as an add-on

2014-03-23 Thread Manolis Ragkousis
In the debian package I saw there are 2 patches that add this.

  +libc_add_on_canonical=libpthread
  +libc_add_on_subdirs=.

How does this change the configure process?


Re: libpthread fails to build as an add-on

2014-03-23 Thread Ludovic Courtès
Manolis Ragkousis manolis...@gmail.com skribis:

 In the debian package I saw there are 2 patches that add this.

  +libc_add_on_canonical=libpthread
  +libc_add_on_subdirs=.

 How does this change the configure process?

Libc’s top-level configure file expects these two variables to be set by
the add-on’s ‘configure’ script:

--8---cut here---start-8---
libc_add_on_frag=$libc_add_on_srcdir/configure
libc_add_on_canonical=
libc_add_on_config_subdirs=
if test -r $libc_add_on_frag; then
  AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
  libc_add_on_canonical=unknown
  libc_add_on_subdirs=
  . $libc_add_on_frag # ← here, runs libpthread/configure
  test -z $libc_add_on || {
configured_add_ons=$configured_add_ons $libc_add_on
if test x$libc_add_on_canonical = xunknown; then
  AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
fi
--8---cut here---end---8---

So when libpthread is built as an add-on, libpthread/configure must set
them, AFAIU.

HTH,
Ludo’.



libpthread fails to build as an add-on

2014-03-20 Thread Ludovic Courtès
(Hurd people: this is about a configure error when cross-compiling glibc
with libpthread as an add-on.)

Manolis Ragkousis manolis...@gmail.com skribis:

 when building glibc with libpthread as an addon I get this

 configure: running configure fragment for add-on libpthread
 configure: WARNING: you should use --build, --host, --target
 configure: WARNING: you should use --build, --host, --target
 checking build system type... Invalid configuration `dummy': machine
 `dummy' not recognized
 configure: error:
 /gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin/bash
 ../source/scripts/config.sub dummy failed

 Normally the flags passed to glibc's configure should be passed to
 libpthread as well. Why isn't it happening?

Actually libc’s configure doesn’t use the normal AC_CONFIG_SUBDIRS
mechanism, and instead runs add-on configure scripts by itself, without
arguments AFAICS.

[...]

 It was created by GNU C Library configure (see version.h), which was
 generated by GNU Autoconf 2.68.  Invocation command line was

   $ ../source/configure dummy readelf

(This is libpthread’s config.log, right?)

I don’t understand where those arguments come from.

Ideas?

Thanks,
Ludo’.



Re: libpthread fails to build as an add-on

2014-03-20 Thread Manolis Ragkousis
  (This is libpthread's config.log, right?)

It's the config.log generated in the build folder of glibc.
There is no config.log file generated  from libpthread.

Manolis


starting phase `configure'
source directory: 
/tmp/nix-build-glibc-hurd-cross-i686-pc-gnu-2.18.drv-4/source (relative from 
build: ../source)
build directory: /tmp/nix-build-glibc-hurd-cross-i686-pc-gnu-2.18.drv-4/build
configure flags: 
(CONFIG_SHELL=/gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin/bash 
SHELL=/gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin/bash 
--prefix=/gnu/store/38sz5a5r2mimzg31jg2wdvk1f173iphx-glibc-hurd-cross-i686-pc-gnu-2.18
 --enable-fast-install --target=i686-pc-gnu --without-cvs 
--enable-add-ons=libpthread --build=i686-pc-gnu --disable-profile 
--disable-multi-arch --disable-sanity-checks 
libc_cv_localedir=/gnu/store/17kg9lw4laxglif9kdcgy6vc2yz366yx-glibc-hurd-cross-i686-pc-gnu-2.18-locales/share/locale
 BASH_SHELL=/gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin/bash)
checking build system type... i686-pc-gnu
checking host system type... i686-pc-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for readelf... readelf
checking for sysdeps preconfigure fragments... x86_64 
configure: running configure fragment for add-on libpthread
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
checking build system type... Invalid configuration `dummy': machine `dummy' 
not recognized
configure: error: /gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin/bash 
../source/scripts/config.sub dummy failed
phase `configure' failed after 0 seconds
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ../source/configure dummy readelf

## - ##
## Platform. ##
## - ##

hostname = localhost
uname -m = x86_64
uname -r = 3.13.6-1-ARCH
uname -s = Linux
uname -v = #1 SMP PREEMPT Fri Mar 7 22:47:48 CET 2014

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch  = unknown
/usr/bin/arch -k   = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo  = unknown
/bin/machine   = unknown
/usr/bin/oslevel   = unknown
/bin/universe  = unknown

PATH: 
/gnu/store/6bg25h0pzgscds0br7dzs7lf3vqskl96-gcc-cross-hurd-sans-libc-i686-pc-gnu-4.8.2/bin
PATH: 
/gnu/store/nkrr16lw55p75483z2an0c67nnqdm4l5-binutils-cross-i686-pc-gnu-2.23.2/bin
PATH: /gnu/store/m2qn6kv6n00ris4l9mwfl7wadxrbll6g-mig-cross-1.4/bin
PATH: /gnu/store/qdd0hz0sclms1rz3ss01f75r3ys8r58z-perl-5.16.1/bin
PATH: /gnu/store/bvw355kwjr21kcfckzlm22ag03xamj27-autoconf-wrapper-2.69/bin
PATH: /gnu/store/yvfsm45m5g8m2ikj8gvnq6260azwbrbk-automake-1.14.1/bin
PATH: /gnu/store/nr4xwiv2v7n97ib29dpf8gi2562y5294-libtool-2.4.2-bin/bin
PATH: /gnu/store/x26nnlh6azmnd0ibdyfwafdc6rkzx17w-bash-light-4.2/bin
PATH: /gnu/store/f4v605p9fva9kjragznh3l28nfpzmcqp-tar-1.27.1/bin
PATH: /gnu/store/7267cq3clzcbgd1k7s5rg0i0vp2yklpl-gzip-1.6/bin
PATH: /gnu/store/a1ir9y0bgaazp6n58y3qbhmfymjq3yxq-bzip2-1.0.6/bin
PATH: /gnu/store/1zs7xnaby6vl49195sid1klx3gk03mwd-xz-5.0.4/bin
PATH: /gnu/store/2ly72pfnmg28ps7jdj83516gvbn6371j-diffutils-3.3/bin
PATH: /gnu/store/1qdk13ly4c5iqqz7nay0x4fn6ls5r1b9-patch-2.7.1/bin
PATH: /gnu/store/gjl05yl9lvgjhznz5v985mys861svp34-coreutils-8.21/bin
PATH: /gnu/store/sj5ivydxwm1943y2g06vhwfwpn9hc1a1-sed-4.2.2/bin
PATH: /gnu/store/v2q2595q6n4gs32j15ga65bgy0yqg76g-grep-2.15/bin
PATH: /gnu/store/r534qbhj6jni2x30q4rgl8ry8rilarak-findutils-4.4.2/bin
PATH: /gnu/store/3j4pxqg9rskk9365m6jqi59pvcyq1d82-gawk-4.1.0/bin
PATH: /gnu/store/pwm61di9kpfks4acn0k6kp2rwa0wjl5j-make-4.0/bin
PATH: /gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin
PATH: /gnu/store/r7lpkp8d2df74rw24ndcivxvjzdgxn8d-ld-wrapper-0/bin
PATH: /gnu/store/xbryfykc21adgrq3z56g4c6xvv2lb645-binutils-2.23.2/bin
PATH: /gnu/store/z8qifq9172ad17a7mxg9w8jq51axwwqr-gcc-4.8.2/bin
PATH: /gnu/store/5v11czsqd9x9xqvsww9dk7h5i47laym0-glibc-2.18/bin
PATH: /gnu/store/5v11czsqd9x9xqvsww9dk7h5i47laym0-glibc-2.18/sbin


## --- ##
## Core tests. ##
## --- ##

configure:2338: checking build system type
configure:2349: error: 
/gnu/store/281n6ma5jxy9sb3nwc09mzpqx43vczr6-bash-4.2/bin/bash 
../source/scripts/config.sub dummy failed

##  ##
## Cache variables. ##
##  ##

ac_cv_build=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=