dslm4515 / Musl-LFS

Linux From Scratch using Musl as Libc
GNU General Public License v3.0
170 stars 21 forks source link

Autoreconf Fails on Coreutils-8.32 #35

Closed dslm4515 closed 3 years ago

dslm4515 commented 3 years ago

Regenerating the configure script fails with autoreconf -vfi under chroot environment:

autoreconf: Entering directory `.'
autoreconf: running: autopoint --force
autoreconf: running: aclocal --force -I m4
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/setlocale_null.m4:7: gl_FUNC_SETLOCALE_NULL is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/mbrtowc.m4:8: gl_FUNC_MBRTOWC is expanded from...
m4/mbrlen.m4:7: gl_FUNC_MBRLEN is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/mbrtowc.m4:8: gl_FUNC_MBRTOWC is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/pthread_h.m4:7: gl_PTHREAD_H is expanded from...
m4/pthread-cond.m4:7: gl_PTHREAD_COND is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/pthread_h.m4:7: gl_PTHREAD_H is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/sched_yield.m4:7: gl_FUNC_SCHED_YIELD is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/yield.m4:7: gl_YIELD is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
autoreconf: configure.ac: tracing
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/setlocale_null.m4:7: gl_FUNC_SETLOCALE_NULL is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/mbrtowc.m4:8: gl_FUNC_MBRTOWC is expanded from...
m4/mbrlen.m4:7: gl_FUNC_MBRLEN is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/mbrtowc.m4:8: gl_FUNC_MBRTOWC is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/pthread_h.m4:7: gl_PTHREAD_H is expanded from...
m4/pthread-cond.m4:7: gl_PTHREAD_COND is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/pthread_h.m4:7: gl_PTHREAD_H is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/sched_yield.m4:7: gl_FUNC_SCHED_YIELD is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/yield.m4:7: gl_YIELD is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/setlocale_null.m4:7: gl_FUNC_SETLOCALE_NULL is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/mbrtowc.m4:8: gl_FUNC_MBRTOWC is expanded from...
m4/mbrlen.m4:7: gl_FUNC_MBRLEN is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/mbrtowc.m4:8: gl_FUNC_MBRTOWC is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/pthread_h.m4:7: gl_PTHREAD_H is expanded from...
m4/pthread-cond.m4:7: gl_PTHREAD_COND is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/pthread_h.m4:7: gl_PTHREAD_H is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/sched_yield.m4:7: gl_FUNC_SCHED_YIELD is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: gl_PTHREADLIB is m4_require'd but not m4_defun'd
m4/yield.m4:7: gl_YIELD is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure:8407: error: possibly undefined macro: gl_ANYTHREADLIB_EARLY
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:15551: error: possibly undefined macro: gl_PTHREADLIB
configure:15639: error: possibly undefined macro: gl_WEAK_SYMBOLS
autoreconf: /usr/bin/autoconf failed with exit status: 1

Host System: Truple: i686-linux-musl Distro: MLFS-7.00

dslm4515 commented 3 years ago

But yet if I try it under the host, and not in the chroot:

$ autoreconf -vfi
autoreconf: Entering directory `.'
autoreconf: running: autopoint --force
Copying file build-aux/config.rpath
Copying file m4/extern-inline.m4
Copying file m4/glibc2.m4
Copying file m4/intdiv0.m4
Copying file m4/intl.m4
Copying file m4/intldir.m4
Copying file m4/intmax.m4
Copying file m4/printf-posix.m4
Copying file m4/uintmax_t.m4
Copying file po/Makefile.in.in
Copying file po/Makevars.template
autoreconf: running: aclocal -I /usr/share/aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
dslm4515 commented 3 years ago

Recompiled libtool without this prepended to the configure script:

lt_cv_shlibpath_overrides_runpath=yes

Then recompile autoconf and automake.

Now coreutils builds fine without running autoreconf -fvi first. Although, autoreconf -fvi still fails.

dslm4515 commented 3 years ago

Just noticed that in the coreutils source, gl_PTHREADLIB appears in the m4 directory:

$ grep gl_PTHREADLIB m4/*
m4/mbrtowc.m4:  AC_REQUIRE([gl_PTHREADLIB])
m4/pthread_h.m4:  AC_REQUIRE([gl_PTHREADLIB])
m4/sched_yield.m4:  AC_REQUIRE([gl_PTHREADLIB])
m4/setlocale_null.m4:  AC_REQUIRE([gl_PTHREADLIB])
m4/threadlib.m4:dnl gl_PTHREADLIB
m4/threadlib.m4:dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
m4/threadlib.m4:AC_DEFUN([gl_PTHREADLIB_BODY],
m4/threadlib.m4:AC_DEFUN([gl_PTHREADLIB],
m4/threadlib.m4:  gl_PTHREADLIB_BODY
m4/threadlib.m4:        gl_PTHREADLIB_BODY
m4/threadlib.m4:      gl_PTHREADLIB_BODY
m4/yield.m4:  AC_REQUIRE([gl_PTHREADLIB])

Perhaps, autoconf is skipping this directory?

dslm4515 commented 3 years ago

Rebuilt Toolchain with gettext-tiny instead of GNU'sgettext. There are a few warnings, but autoreconfexits with no errors:

autoreconf: Entering directory `.'                                                                                          
autoreconf: running: autopoint --force                                                                                      
cp: cannot stat '/usr/local/share/gettext-tiny/m4/*.m4': No such file or directory                                          
install: cannot stat '/usr/local/share/gettext-tiny/data/autopoint_Makefile.in': No such file or directory                  
install: cannot stat '/usr/local/share/gettext-tiny/data/autopoint_Makefile.in': No such file or directory                  
install: cannot stat '/usr/local/share/gettext-tiny/data/autopoint_Makefile.in': No such file or directory                  
install: cannot stat '/usr/local/share/gettext-tiny/data/Makevars.template': No such file or directory                      
autoreconf: running: aclocal --force -I m4                                                                                  
autoreconf: configure.ac: tracing                                                                                           
autoreconf: configure.ac: not using Libtool                                                                                 
autoreconf: running: /usr/bin/autoconf --force                                                                              
autoreconf: running: /usr/bin/autoheader --force                                                                            
autoreconf: running: automake --add-missing --copy --force-missing                                                          
autoreconf: Leaving directory `.'                                                          

Configure script also runs without errors.

dslm4515 commented 3 years ago

Error goes away if this symlink/directory does not exist /usr/local/share/gettext-tiny ... but these warning show up:

autoreconf: Entering directory `.'
autoreconf: running: autopoint --force
cp: cannot stat '/usr/local/share/gettext-tiny/m4/*.m4': No such file or directory
install: cannot stat '/usr/local/share/gettext-tiny/data/autopoint_Makefile.in': No such file or directory
install: cannot stat '/usr/local/share/gettext-tiny/data/autopoint_Makefile.in': No such file or directory
install: cannot stat '/usr/local/share/gettext-tiny/data/autopoint_Makefile.in': No such file or directory
install: cannot stat '/usr/local/share/gettext-tiny/data/Makevars.template': No such file or directory
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
dslm4515 commented 3 years ago

I might consider dropping gettext-tiny

dslm4515 commented 3 years ago

So far this issue hasn't popped up in my other builds, CMLFS