can not build host-m4 on machine with glibc-2.28 installed
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"?" == ? ? <[email protected]> writes:
Hello,
Please mail the buildroot mailing list and not individual contributors, thanks!
Quoted 10 lines
Hi,
I found that failure and do some hacking.(1) m4 source,
lib/freadahead.c: It use the internal symbols to guess the C runtime lib's type.(2) glibc-2.28 removed the header file
/usr/include/bits/libio.h. In fact,libio.hseems an internal header. The content of it has been moved into <glibc source>/libio/libio.h, which is not installed.
Quoted 4 lines
Anyone can help me out? M4 has not released new version since 1.4.18(2016-12-31).
Allan,
It seems that that bug will hit our lovely ArchLinux!
What is the build failure you are seeing exactly? Looking around, it seems linuxfromscratch has some workarounds for building against glibc-2.28, perhaps we can do the same?
http://www.linuxfromscratch.org/lfs/view/development/chapter05/m4.html
Signature · 1 line
Bye, Peter Korsgaard
Hello,
Quoted 17 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"?" == ? ? <[email protected]> writes:
Please mail the buildroot mailing list and not individual contributors, thanks!
Quoted 11 lines
Hi,
I found that failure and do some hacking.(1) m4 source,
lib/freadahead.c: It use the internal symbols to guess the C runtime lib's type.(2) glibc-2.28 removed the header file
/usr/include/bits/libio.h. In fact,libio.hseems an internal header. The content of it has been moved into <glibc source>/libio/libio.h, which is not installed.Anyone can help me out? M4 has not released new version since 1.4.18(2016-12-31).
Quoted 8 lines
Quoted 2 lines
Allan,
It seems that that bug will hit our lovely ArchLinux!What is the build failure you are seeing exactly? Looking around, it seems linuxfromscratch has some workarounds for building against glibc-2.28, perhaps we can do the same?
http://www.linuxfromscratch.org/lfs/view/development/chapter05/m4.html
I don't have a build log at hand, but the gnulib sources would complain e.g. that ?freadahead()? is unimplemented for the current target platform, and its source would ?#error?. I have a crappy local patch which patches a few files from gnulib to the most recent version available in the repository. I also have a similar one for Bison, but they are a bit crappy and should be done properly, updating all gnulib bits that the packages use instead of just the bare minimum to make things work (see the attached patches, you can drop them in a local patches directory).
Also: gnulib is horrible, and I am baffled that it's still being used in 2018... I refuse to think that something like M4 or Bison (which basically process some input text and generate some output text) needs functions from gnulib which rely on the internals of the system C library. It was quite disheartening for me to find out this ~_~
Regards,
-Adri?n
-------------- next part --------------
lib/fseterr.c +10 -5
@@ -1,5 +1,5 @@/* Set the error indicator of a stream. -Copyright (C) 2007-2015 Free Software Foundation, Inc. +Copyright (C) 2007-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */#include <config.h>
@@ -23,21 +23,26 @@#include "stdio-impl.h" +/* This file is not used on systems that have the __fseterr function, +namely musl libc. */ +void fseterr (FILE *fp) {/* Most systems provide FILE as a struct and the necessary bitmask in <stdio.h>, because they need it for implementing getc() and putc() as fast macros. */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ ==1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ ==1 +/* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_flags |= _IO_ERR_SEEN; -#elif defined __sferror || defined __DragonFly__/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ +#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ fp_->_flags |= __SERR;#elif defined __EMX__/* emx+gcc */ fp->_flags |= _IOERR;#elif defined __minix/* Minix */ fp->_flags |= _IOERR; -#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */ +#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_flag |= _IOERR;#elif defined __UCLIBC__/* uClibc */ fp->__modeflags |= __FLAG_ERROR;
lib/fseterr.h +2 -2
@@ -1,5 +1,5 @@/* Set the error indicator of a stream. -Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */#ifndef _FSETERR_H#define _FSETERR_H
-------------- next part --------------
lib/freadahead.c +14 -5
@@ -1,5 +1,5 @@/* Retrieve information about a FILE stream. -Copyright (C) 2007-2016 Free Software Foundation, Inc. +Copyright (C) 2007-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */#include <config.h>
@@ -22,17 +22,26 @@#include <stdlib.h> #include "stdio-impl.h" +#if defined __DragonFly__ +/* Defined in libc, but not declared in <stdio.h>. */ +extern size_t __sreadahead (FILE *); +#endif + +/* This file is not used on systems that have the __freadahead function, +namely musl libc. */ +size_t freadahead (FILE *fp) { -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ ==1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ ==1 +/* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_write_ptr > fp->_IO_write_base)return 0 ;return (fp->_IO_read_end - fp->_IO_read_ptr) + (fp->_flags & _IO_IN_BACKUP ? fp->_IO_save_end - fp->_IO_save_base :0 );#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ if ((fp_->_flags & __SWR) !=0 || fp_->_r <0 )return 0 ;# if defined __DragonFly__
@@ -53,7 +62,7 @@if ((fp_->_flags & _IOWRITING) !=0 )return 0 ;return fp_->_count; -#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */ +#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ if ((fp_->_flag & _IOWRT) !=0 )return 0 ;return fp_->_cnt;
lib/freadahead.h +2 -2
@@ -1,5 +1,5 @@/* Retrieve information about a FILE stream. -Copyright (C) 2007-2016 Free Software Foundation, Inc. +Copyright (C) 2007-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */#include <stddef.h> #include <stdio.h>
lib/fseeko.c +15 -13
@@ -1,9 +1,9 @@/* An fseeko() function that, together with fflush(), is POSIX compliant. -Copyright (C) 2007-2016 Free Software Foundation, Inc. +Copyright (C) 2007-2018 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful,
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along - with this program; if not, see <http://www.gnu.org/licenses/>. */ + with this program; if not, see <https://www.gnu.org/licenses/>. */#include <config.h>
@@ -33,9 +33,9 @@#endif #if _GL_WINDOWS_64_BIT_OFF_T# undef fseeko -# if HAVE__FSEEKI64 /* msvc, mingw64 */ +# if HAVE__FSEEKI64 &&HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */ # define fseeko _fseeki64 -# else /* mingw */ +# else /* mingw before msvcrt8.0 */ # define fseeko fseeko64# endif #endif
@@ -47,12 +47,13 @@#endif /* These tests are based on fpurge.c. */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 + /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_read_end == fp->_IO_read_ptr && fp->_IO_write_ptr == fp->_IO_write_base && fp->_IO_save_base == NULL) #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ # if defined __SL64 && defined __SCLE /* Cygwin */ if ((fp->_flags & __SL64) == 0) {
@@ -80,7 +81,7 @@#elif defined __minix/* Minix */ if (fp_->_ptr == fp_->_buf && (fp_->_ptr == NULL || fp_->_count == 0)) -#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */ +#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ if (fp_->_ptr == fp_->_base && (fp_->_ptr == NULL || fp_->_cnt == 0))#elif defined __UCLIBC__/* uClibc */
@@ -117,18 +118,19 @@if (pos ==-1 ) {#if defined __sferror || defined __DragonFly__ || defined __ANDROID__ -/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ fp_->_flags &= ~__SOFF;#endif return -1 ; } -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ ==1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ ==1 +/* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_flags &= ~_IO_EOF_SEEN; fp->_offset = pos;#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >=600000000 ) +/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ +# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >=600000000 ) || defined __minix/* fp_->_offset is typed as an integer. */ fp_->_offset = pos;# else
@@ -150,7 +152,7 @@ fp_->_flags &= ~__SEOF;#elif defined __EMX__/* emx+gcc */ fp->_flags &= ~_IOEOF; -#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */ +#elif defined _IOERR/* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_flag &= ~_IOEOF;#elif defined __MINT__/* Atari FreeMiNT */ fp->__offset = pos;
lib/glthread/lock.c +176 -12
226 lines not on this page · raw message
lib/glthread/lock.h +68 -10
126 lines not on this page · raw message
lib/glthread/threadlib.c +3 -3
@@ -1,9 +1,9 @@/* Multithreading primitives. -Copyright (C) 2005-2016 Free Software Foundation, Inc. +Copyright (C) 2005-2018 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful,
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. */ + along with this program; if not, see <https://www.gnu.org/licenses/>. *//* Written by Bruno Haible <[email protected]>, 2005. */
lib/glthread/tls.c +2 -2
@@ -1,5 +1,5 @@/* Thread-local storage in multithreaded situations. -Copyright (C) 2005-2016 Free Software Foundation, Inc. +Copyright (C) 2005-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. *//* Written by Bruno Haible <[email protected]>, 2005. */
lib/glthread/tls.h +4 -4
@@ -1,5 +1,5 @@/* Thread-local storage in multithreaded situations. -Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc. +Copyright (C) 2005, 2007-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. *//* Written by Bruno Haible <[email protected]>, 2005. */
@@ -76,8 +76,8 @@# endif # if !PTHREAD_IN_USE_DETECTION_HARD -# pragma weak pthread_cancel -# define pthread_in_use () (pthread_cancel != NULL) +# pragma weak pthread_mutexattr_gettype +# define pthread_in_use () (pthread_mutexattr_gettype != NULL)# endif # else
lib/stdio-impl.h +73 -11
157 lines not on this page · raw message
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180808/d07acc70/attachment.asc>
Hi Adrian,
Quoted 44 lines · Adrian Perez de Castro
Hello,
Quoted 17 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"?" == ? ? <[email protected]> writes:
Please mail the buildroot mailing list and not individual contributors, thanks!
Quoted 11 lines
Hi,
I found that failure and do some hacking.(1) m4 source,
lib/freadahead.c: It use the internal symbols to guess the C runtime lib's type.(2) glibc-2.28 removed the header file
/usr/include/bits/libio.h. In fact,libio.hseems an internal header. The content of it has been moved into <glibc source>/libio/libio.h, which is not installed.Anyone can help me out? M4 has not released new version since 1.4.18(2016-12-31).
Quoted 8 lines
Quoted 2 lines
Allan,
It seems that that bug will hit our lovely ArchLinux!What is the build failure you are seeing exactly? Looking around, it seems linuxfromscratch has some workarounds for building against glibc-2.28, perhaps we can do the same?
http://www.linuxfromscratch.org/lfs/view/development/chapter05/m4.html
I don't have a build log at hand, but the gnulib sources would complain e.g. that ?freadahead()? is unimplemented for the current target platform, and its source would ?#error?. I have a crappy local patch which patches a few files from gnulib to the most recent version available in the repository. I also have a similar one for Bison, but they are a bit crappy and should be done properly, updating all gnulib bits that the packages use instead of just the bare minimum to make things work (see the attached patches, you can drop them in a local patches directory).
Also: gnulib is horrible, and I am baffled that it's still being used in 2018... I refuse to think that something like M4 or Bison (which basically process some input text and generate some output text) needs functions from gnulib which rely on the internals of the system C library. It was quite disheartening for me to find out this ~_~
Quoted 3 lines
Regards,
-Adri?n
I've tested your m4 patch and it works for me (Arch Linux).
Best regards,
J?rg Krause