dslm4515 / musl-lfs Goto Github PK
View Code? Open in Web Editor NEWLinux From Scratch using Musl as Libc
License: GNU General Public License v3.0
Linux From Scratch using Musl as Libc
License: GNU General Public License v3.0
Where is mlfs udev rules?
I'm building Util-Linux for a Musl-LFS fork, Copacabana --- I think I've cited it here before, in some commits and contributions that I brought from it to Musl-LFS --- and, looking between both the Musl-LFS instructions and other distributions' build scripts for base system Util-Linux, I found the same header being sourcered and used.
The question is: why do we need ttydefaults.h
? I've tried to build Util-Linux without regenerating them and it built fine.
The Musl Libc does not have utmp functionality built-in like glibc.
Perhaps skarnet’s utmps should be built before coreutils? Without it, some commands like last
will report /dev/null/utmp is not a directory
Regarding the
Musl-LFS/doc/3-Chroot/022-Shadow
Line 13 in eb64786
Currently, the SHA_ROUNDS_MAX
in shadow and musl differ. The one in musl 1.2.3 is defined as
https://git.musl-libc.org/cgit/musl/tree/src/crypt/crypt_sha512.c?h=v1.2.3#n196
/* key limit is not part of the original design, added for DoS protection.
* rounds limit has been lowered (versus the reference/spec), also for DoS
* protection. runtime is O(klen^2 + klen*rounds) */
#define KEY_MAX 256
#define SALT_MAX 16
#define ROUNDS_DEFAULT 5000
#define ROUNDS_MIN 1000
#define ROUNDS_MAX 9999999
(7 digits), whereas the one expected by shadow 4.11.1 is
https://github.com/shadow-maint/shadow/blob/1bf5868e3378aef0f36ba3490852709d79729419/libmisc/salt.c#L63
#define SHA_ROUNDS_MAX 999999999
(9 digits), which means that shadow can potentially request the larger number of rounds than supported by musl.
Replacing libelf/elfutils with elftoolchain will eliminate the need for musl-obstack
Binutils could be moved from /usr to /opt/gnu as secondary binutils
OR
Create a script to switch between elftoolchain and binutils
Ever since GCC 10.x, there are now internal compiler errors randomly occurring during tool chain build and even during final system build.
For example, trying to build coreutils [for toolchain build] on a triple core x86_64 CPU with 8GB of DDR3 ram:
during RTL pass: cse2
lib/sha256.c: In function 'sha256_process_block':
lib/sha256.c:535:1: internal compiler error: Segmentation fault
535 | }
| ^
0xb1999f crash_signal
../../gcc/toplev.c:328
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [Makefile:10273: lib/sha256.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/mnt/mlfs/sources/coreutils-8.32'
make[1]: *** [Makefile:12910: all-recursive] Error 1
make[1]: Leaving directory '/mnt/mlfs/sources/coreutils-8.32'
make: *** [Makefile:7027: all] Error 2
GCC of this toolchain was build from GCC 10.2.1 snapshot source from Alpine Linux along with patches from Alpine Linux
Hi, somehow this happened.
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [Makefile:13205: configure-target-libquadmath] Error 1
make[1]: Leaving directory '/sources/pkgs/gcc-10.2.0/build'
make: *** [Makefile:962: all] Error 2
Man pages generated for binutils are empty files. Issue was not known until using pkgtools (makepkg) :
WARNING: zero length file usr/share/man/man1/as.1
WARNING: zero length file usr/share/man/man1/nm.1
WARNING: zero length file usr/share/man/man1/ld.1
WARNING: zero length file usr/share/man/man1/gprof.1
WARNING: zero length file usr/share/man/man1/objcopy.1
WARNING: zero length file usr/share/man/man1/strip.1
WARNING: zero length file usr/share/man/man1/objdump.1
WARNING: zero length file usr/share/man/man1/addr2line.1
WARNING: zero length file usr/share/man/man1/strings.1
WARNING: zero length file usr/share/man/man1/readelf.1
WARNING: zero length file usr/share/man/man1/c++filt.1
WARNING: zero length file usr/share/man/man1/elfedit.1
WARNING: zero length file usr/share/man/man1/ranlib.1
WARNING: zero length file usr/share/man/man1/size.1
WARNING: zero length file usr/share/man/man1/ar.1
Tested on an older MLFS system with GCC-8.2.0... same issue when building binutild 2.37.
I noticed in binutils-2.37/binutils/doc
that ar.1 and nm.1 are empty.
Arch: i686
Distro: MLFS-4.00
While building the /tools
toolchain, ncurses will not use the libc.so
in /tools/lib
$ ldd lib/libtinfow.so.6.2
ldd (0xb7f47000)
libc.so => ldd (0xb7f47000)
I have tried setting these:
export LDFLAGS=-L/tools/lib
export CPPFLAGS=-I/tools/include
For configure:
./configure --prefix=/tools \
--build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--with-shared \
--without-debug \
--without-ada \
--enable-widec \
--enable-overwrite \
--with-termlib \
--enable-termcap \
--libdir=/tools/lib \
--oldincludedir=/tools/include
Compiled boot database in /etc/s6/db
is not used when booting with s6+s6-rc. System boots without errors and log under /run/uncaught-logs
is empty. Procfs and sysfs not mounted
Ever since switching from GNU's Gettext to gettext-tiny, the autotools (autoconf & automake) have been unreliable. Sometimes coreutils will re-configure fine with autoreconf-fvi
and other times fail:
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: running: autopoint --force
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /usr/bin/autoconf --force
configure.ac:55: warning: The macro `AC_PROG_CC_STDC' is obsolete.
configure.ac:55: You should run autoupdate.
m4/std-gnu11.m4:476: AC_PROG_CC_STDC is expanded from...
configure.ac:55: the top level
configure.ac:61: warning: The macro `AC_GNU_SOURCE' is obsolete.
configure.ac:61: You should run autoupdate.
./lib/autoconf/specific.m4:312: AC_GNU_SOURCE is expanded from...
m4/gnulib-comp.m4:34: gl_EARLY is expanded from...
configure.ac:61: the top level
configure.ac:61: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:61: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
m4/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
m4/gnulib-comp.m4:34: gl_EARLY is expanded from...
configure.ac:61: the top level
configure.ac:63: warning: AC_CHECK_HEADERS(openssl/$ALG_header): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/libs.m4:100: AC_CHECK_LIB is expanded from...
m4/gl-openssl.m4:13: gl_CRYPTO_CHECK is expanded from...
m4/md5.m4:7: gl_MD5 is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: AC_CHECK_HEADERS(openssl/$ALG_header): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/libs.m4:100: AC_CHECK_LIB is expanded from...
m4/gl-openssl.m4:13: gl_CRYPTO_CHECK is expanded from...
m4/sha1.m4:7: gl_SHA1 is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: AC_CHECK_HEADERS(openssl/$ALG_header): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/libs.m4:100: AC_CHECK_LIB is expanded from...
m4/gl-openssl.m4:13: gl_CRYPTO_CHECK is expanded from...
m4/sha256.m4:7: gl_SHA256 is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from... [72/1935]
configure.ac:63: the top level
configure.ac:63: warning: AC_CHECK_HEADERS(openssl/$ALG_header): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/libs.m4:100: AC_CHECK_LIB is expanded from...
m4/gl-openssl.m4:13: gl_CRYPTO_CHECK is expanded from...
m4/sha512.m4:7: gl_SHA512 is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: The macro `_AC_COMPUTE_INT' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/general.m4:3376: _AC_COMPUTE_INT is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/gethostname.m4:47: gl_PREREQ_HOST_NAME_MAX is expanded from...
m4/gethostname.m4:10: gl_FUNC_GETHOSTNAME 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/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: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
m4/malloc.m4:9: _AC_FUNC_MALLOC_IF is expanded from...
m4/malloc.m4:55: gl_FUNC_MALLOC_GNU 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...
configure.ac:63: the top level [23/1935]
configure.ac:63: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: $as_echo_n is obsolete; use AS_ECHO_N(["message"]) instead
m4/gnulib-common.m4:453: gl_CACHE_VAL_SILENT is expanded from...
m4/stdarg.m4:10: gl_STDARG_H is expanded from...
m4/gnulib-comp.m4:896: gl_INIT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: The macro `AC_DECL_SYS_SIGLIST' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/specific.m4:40: AC_DECL_SYS_SIGLIST is expanded from...
m4/strsignal.m4:55: gl_PREREQ_STRSIGNAL 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.ac:64: warning: The macro `AC_ISC_POSIX' is obsolete.
configure.ac:64: You should run autoupdate.
./lib/autoconf/specific.m4:550: AC_ISC_POSIX is expanded from...
m4/jm-macros.m4:22: coreutils_MACROS is expanded from...
configure.ac:64: the top level
configure.ac:64: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:64: You should run autoupdate.
./lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from...
m4/check-decl.m4:14: gl_CHECK_DECLS is expanded from...
m4/jm-macros.m4:22: coreutils_MACROS is expanded from...
configure.ac:64: the top level
configure.ac:64: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:64: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/xattr.m4:11: gl_FUNC_XATTR is expanded from...
m4/prereq.m4:28: gl_PREREQ is expanded from...
m4/jm-macros.m4:22: coreutils_MACROS is expanded from...
configure.ac:64: the top level
configure.ac:64: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:64: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/jm-macros.m4:22: coreutils_MACROS is expanded from...
configure.ac:64: the top level
configure.ac:64: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:64: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
m4/jm-macros.m4:22: coreutils_MACROS is expanded from...
configure.ac:64: the top level
configure.ac:64: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:64: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2894: _AC_LINK_IFELSE is expanded from...
./lib/autoconf/general.m4:2911: AC_LINK_IFELSE is expanded from...
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
m4/jm-macros.m4:22: coreutils_MACROS is expanded from...
configure.ac:64: the top level
configure:8529: error: possibly undefined macro: gl_ANYTHREADLIB_EARLY
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure:15689: error: possibly undefined macro: gl_PTHREADLIB
configure:15774: error: possibly undefined macro: gl_WEAK_SYMBOLS
autoreconf: error: /usr/bin/autoconf failed with exit status: 1
I was reading doc/043-Create_Essential_Files_and_Links, and then i've read ln -sv bash /bin/sh
.
I disagree totally about linking bash
to sh
and my reasons are 100% technical.
So i've thought: "why not use a real POSIX shell?"
My suggestions for a real POSIX shell are ash/dash (preferentially dash, because maintained and widely-used) and 42-shell.
I would like to know if y'all agree with me and would like to add my idea to the main source tree.
I am totally available to help this time.
Thanks for the attention and please forgive me for possible grammatical errors (although practicing and using it everyday, my english still sucks).
Before continuing, is this bug normal?
Building Binutils for /tools creates a linker in /tools/bin/ld that expects to find a musl libc in the host's /lib . This is okay if host uses musl libc. If host uses Glibc or another libc, ld in /tools/bin cannot execute.
Binutils will build and install for /tools, but GCC pass 1 for /tools will fail to build.
There's a more in-depth explanation of why are we using these?
Reference: https://github.com/dslm4515/Musl-LFS/blob/stable-9.00/doc/2-toolchain/04-gcc#L76-L77
When OpenSSH is running and a user connects with ssh
the following warning is logged:
wtmp_write: problem writing /dev/null/wtmp: Not a directory
The correct path should be /run/utmps/utmp
as defined in /usr/include/path.h
. Header is provided by musl libc.
Looking at the openSSH source, looks like openSSH is setting path from /usr/include/utmp.h
, which has incorrect paths:
#define _PATH_UTMP "/dev/null/utmp"
#define _PATH_WTMP "/dev/null/wtmp"
Looks like utmp.h of musl libc will need to be patched.
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
I couldn't find any information about it other than its source code. I've read the source code a little, but I didn't come to any precise conclusion.
I'm in a rush right now, sorry for not elaborating more.
Related: https://github.com/dslm4515/Musl-LFS/blob/master/doc/3-Chroot/011-Time_Zone_Utilities#L12
The sources do not have a provided sha-sum file to check integrity.
applying the coreutils-8.31-i18n-1.patch
patch causes the build to die with this error:
/usr/bin/ld: src/expand.o: in function `expand':
expand.c:(.text+0x4cd): undefined reference to `mbfile_multi_getc'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:8824: src/expand] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/sources/coreutils-8.31'
make[1]: *** [Makefile:12651: all-recursive] Error 1
make[1]: Leaving directory '/sources/coreutils-8.31'
make: *** [Makefile:6831: all] Error 2
it builds fine when the patch is not applied. it makes more sense to add a disclaimer to say that the step is optional like the original linux from scratch book does since it's not necessary or to remove it.
Current host: Raspberry Pi 4 (4GB RAM)
Distro: MLFS-6.00 (GCC 9.2.0)
Truple: aarch64-linux-musleabihf
Compilation errors out with libgomp of GCC failing:
checking whether the C compiler works... no
configure: error: in `/sources/gcc-10.2.0/build/aarch64-linux-musleabihf/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [Makefile:14436: configure-target-libgomp] Error 1
make[1]: Leaving directory '/sources/gcc-10.2.0/build'
make: *** [Makefile:962: all] Error 2
Checking config.log for libgomp shows:
configure:3907: checking whether the C compiler works
configure:3929: /sources/gcc-10.2.0/build/./gcc/xgcc -B/sources/gcc-10.2.0/build/./gcc/ -B/usr/aarch64-linux-musleabihf/bin/ -B/usr/aarch64-linux-musleabihf/lib/ -isyst>
/tools/lib/gcc/aarch64-mlfs-linux-musleabihf/10.2.0/../../../../aarch64-mlfs-linux-musleabihf/bin/ld: cannot find -lssp_nonshared
collect2: error: ld returned 1 exit status
configure:3933: $? = 1
configure:3971: result: no
My original configure command fo GCC:
SED=sed libat_cv_have_ifunc=no \
../configure --prefix=/usr \
--build="${TRUPLE}"\
--with-system-zlib \
--with-isl \
--with-linker-hash-style=gnu \
--enable-languages=c,c++ \
--enable-threads=posix \
--enable-clocale=generic \
--enable-languages=c,c++ \
--enable-tls \
--enable-libstdcxx-time \
--enable-fully-dynamic-string \
--enable-default-pie \
--enable-default-ssp \
--enable-vtable-verify \
--enable-linker-build-id \
--enable-fast-character \
--disable-libstdcxx-pch \
--disable-nls \
--disable-multilib \
--disable-bootstrap \
--disable-symvers \
--disable-libsanitizer \
--disable-target-libiberty \
--disable-libunwind-exceptions \
--with-arch=armv8-a --with-abi=lp64 \
--disable-libssp --disable-libmpx --disable-libmudflap
Initially, the last 3 flags in my configure command also yielded a failed build with a different error. I forgot to document the error when I used the same configure flags from previous branch (6.00, GCC 9.2.0). I am currently upgrading branch 7.00 with package versions used in LFS-10RC1
The bin user is considered insecure and deprecated since mid-80's and the most part of UNIX security books/manuals recommend chown
ing it to root:wheel
--- for instance, FreeBSD have been doing it since 1998 (freebsd/freebsd-src@7faa559).
Related unix.SE thread: https://unix.stackexchange.com/a/485506
Such as the sources.txt and sources.md5 paths can't being absolute.
I already have fixes for it (that I've created in Pindorama's version of it), just warning about problems that could eventually happen.
I will pull-request them soon as possible, I promise --- I just don't do it right now because I'm a little busy.
File
will compile with errors:
Making all in magic
make[2]: Entering directory '/home/builder/sources/file-5.34/magic'
../src/file -C -m magic
make[2]: *** [Makefile:807: magic.mgc] Bad system call
make[2]: Leaving directory '/home/builder/sources/file-5.34/magic'
make[1]: *** [Makefile:399: all-recursive] Error 1
make[1]: Leaving directory '/home/builder/sources/file-5.34'
make: *** [Makefile:331: all] Error 2
But I can still complete build with make -k
and make -k install
. If i try to use the newly built file
binary, it exits with Bad system call
Host system is a MLFS build (stable-2.01) and it cannot seem to build file
from source... but the system installed file
does work. I first thought it was the introduction of gcc-8.2.0
but host has gcc-7.3.0
and still cannot compile file
Currently Musl-LFS has the init script at /sbin/init
within initramfs instead of /init
, which in my testing causes kernel panic:
Musl-LFS/doc/3-Chroot/097-Initramfs
Line 41 in d953d31
Also, ldd /usr/sbin/udevadm
shows that one of the dependencies is libkmod.so.2, which isn't copied to the initramfs, also producing a kernel panic:
Musl-LFS/doc/3-Chroot/097-Initramfs
Line 44 in d953d31
Further, none of the s6-*
tools like s6-mkdir
, s6-mount
etc (which are copied instead of the "regular" ones like mkdir, mount, etc) are actually used by the init script:
Finally, init script uses printf utility, which isn't copied to the initramfs.
Hi I'm using the latest kernel (5.12.10) but I compile it doesn't work at all, after I looked around I found it had to be patched for musl libc because the linux/swab.h API Header was broken. Apply this patch on Linux API Headers installation.
include-uapi-linux-swab-Fix-potentially-missing-__always_inline.patch
From: Matt Redfearn <[email protected]>
Subject: [PATCH] include/uapi/linux/swab: Fix potentially missing __always_inline
Date: Wed, 3 Jan 2018 09:57:30 +0000
Message-ID: <[email protected]>
X-Mailer: git-send-email 2.7.4
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8BIT
Commit bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining
of some byteswap operations") added __always_inline to swab functions
and commit 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to
userspace headers") added a definition of __always_inline for use in
exported headers when the kernel's compiler.h is not available.
However, since swab.h does not include stddef.h, if the header soup does
not indirectly include it, the definition of __always_inline is missing,
resulting in a compilation failure, which was observed compiling the
perf tool using exported headers containing this commit:
In file included from /usr/include/linux/byteorder/little_endian.h:12:0,
from /usr/include/asm/byteorder.h:14,
from tools/include/uapi/linux/perf_event.h:20,
from perf.h:8,
from builtin-bench.c:18:
/usr/include/linux/swab.h:160:8: error: unknown type name ‘__always_inline’
static __always_inline __u16 __swab16p(const __u16 *p)
Fix this by replacing the inclusion of linux/compiler.h with
linux/stddef.h to ensure that we pick up that definition if required,
without relying on it's indirect inclusion. compiler.h is then included
indirectly, via stddef.h.
Fixes: 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to userspace headers")
Signed-off-by: Matt Redfearn <[email protected]>
---
include/uapi/linux/swab.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
index 23cd84868cc3..f6a8cf737abf 100644
--- a/include/uapi/linux/swab.h
+++ b/include/uapi/linux/swab.h
@@ -3,7 +3,7 @@
#define _UAPI_LINUX_SWAB_H
#include <linux/types.h>
-#include <linux/compiler.h>
+#include <linux/stddef.h>
#include <asm/bitsperlong.h>
#include <asm/swab.h>
/*
--
2.7.4
I added a little above, on #include <asm/bitsperlong.h>
Related Issues @ Alpine Linux
Related Issues @ LKML
Merge Request @ Alpine Linux
Porg can be patched to build under musl, but certain commands during make install
will not log:
exec ./tools/install.sh -D -m 644 src/includ/include/s6/ftrigr.h
exec ./tools/install.sh -D -m 644 src/includ /usr/include/s6/accessrules.h
exec ./tools/install.sh -D -m 644 src/includ/include/s6/config.h
porg: s6-2.7.2.2: No files to log
In case it matters, issue happens with both /tools/bin/porg
and /bin/porg
Porg is no longer maintained, would be nice to find a good replacement that can log install (files installed) and remove packages based on that log
make[2]: Entering directory '/mnt/mlfs/sources/gcc-9.1.0/build/build-x86_64-cross-linux-musl/libcpp'
g++ -I../../../libcpp -I. -I../../../libcpp/../include -I../../../libcpp/include -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long -fno-exceptions -fno-rtti -I../../../libcpp -I. -I../../../libcpp/../include -I../../../libcpp/include -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo ../../../libcpp/charset.c
In file included from ../../../libcpp/charset.c:21:
../../../libcpp/system.h:41:10: fatal error: new: No such file or directory
41 | #include <new>
| ^~~~~
compilation terminated.
make[2]: *** [Makefile:224: charset.o] Error 1
make[2]: Leaving directory '/mnt/mlfs/sources/gcc-9.1.0/build/build-x86_64-cross-linux-musl/libcpp'
make[1]: *** [Makefile:2803: all-build-libcpp] Error 2
make[1]: Leaving directory '/mnt/mlfs/sources/gcc-9.1.0/build'
make: *** [Makefile:958: all] Error 2
Environment:
LC_ALL=POSIX
OLDPWD=/mnt/mlfs/sources/gcc-9.1.0
CC=x86_64-mlfs-linux-musl-gcc
STRIP=x86_64-mlfs-linux-musl-strip
PWD=/mnt/mlfs/sources/gcc-9.1.0/build
HOME=/home/mlfs
RANLIB=x86_64-mlfs-linux-musl-ranlib
AS=x86_64-mlfs-linux-musl-as
AR=x86_64-mlfs-linux-musl-ar
MLFS_HOST=x86_64-cross-linux-musl
MLFS_CPU=x86-64
CXX=x86_64-mlfs-linux-musl-g++
TERM=xterm
SHLVL=1
MLFS_ARCH=x86
PATH=/cross-tools/bin:/tools/bin:/bin:/usr/bin
PS1=\u:\w\n\$
MLFS_TARGET=x86_64-mlfs-linux-musl
LD=x86_64-mlfs-linux-musl-ld
MLFS=/mnt/mlfs
_=/usr/bin/env
Last command: make
Host: x86_64-linux-musl
target: x86_64-linux-musl
Compilation log for file-5.40
mlfs chroot) root:/tmp/file-5.40# ./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /tools/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for builtin ELF support... yes
checking for ELF core file support... yes
checking for zlib support...
checking for bzlib support...
checking for xzlib support...
checking for libseccomp support...
checking for file formats in man section 5... no
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /tools/bin/grep
checking for egrep... /tools/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether byte ordering is bigendian... no
checking whether ln -s works... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /tools/bin/sed
checking for fgrep... /tools/bin/grep -F
checking for ld used by gcc... /tools/x86_64-mlfs-linux-musl/bin/ld
checking if the linker (/tools/x86_64-mlfs-linux-musl/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /tools/bin/nm -B
checking the name lister (/tools/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 32768
checking how to convert x86_64-pc-linux-musl file names to x86_64-pc-linux-musl format... func_convert_file_noop
checking how to convert x86_64-pc-linux-musl file names to toolchain format... func_convert_file_noop
checking for /tools/x86_64-mlfs-linux-musl/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /tools/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
./configure: line 7783: /usr/bin/file: No such file or directory
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/tools/x86_64-mlfs-linux-musl/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether the -Werror option is usable... yes
checking for simple visibility declarations... yes
checking for ANSI C header files... (cached) yes
checking whether sys/types.h defines makedev... no
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking sys/sysmacros.h usability... yes
checking sys/sysmacros.h presence... yes
checking for sys/sysmacros.h... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for stdint.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking xlocale.h usability... no
checking xlocale.h presence... no
checking for xlocale.h... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking sys/utime.h usability... no
checking sys/utime.h presence... no
checking for sys/utime.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/sysmacros.h... (cached) yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking bzlib.h usability... yes
checking bzlib.h presence... yes
checking for bzlib.h... yes
checking lzma.h usability... yes
checking lzma.h presence... yes
checking for lzma.h... yes
checking for sig_t... yes
checking for off_t... yes
checking for size_t... yes
checking for struct stat.st_rdev... yes
checking for struct tm.tm_gmtoff... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for tm_zone in struct tm... yes
checking whether tzname is declared... yes
checking for tzname... yes
checking for tm_isdst in struct tm... yes
checking whether daylight is declared... yes
checking for daylight... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for mbstate_t... yes
checking for struct option in getopt... yes
checking for pid_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for int32_t... yes
checking for uint64_t... yes
checking for int64_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether mbrtowc and mbstate_t are properly declared... yes
checking for gcc compiler warnings... yes
checking for strndup... yes
checking for mkstemp... yes
checking for mkostemp... yes
checking for utimes... yes
checking for utime... yes
checking for wcwidth... yes
checking for strtof... yes
checking for newlocale... yes
checking for uselocale... yes
checking for freelocale... yes
checking for memmem... yes
checking for pipe2... yes
checking for getopt_long... yes
checking for asprintf... yes
checking for vasprintf... yes
checking for strlcpy... yes
checking for strlcat... yes
checking for getline... yes
checking for ctime_r... yes
checking for asctime_r... yes
checking for localtime_r... yes
checking for gmtime_r... yes
checking for pread... yes
checking for strcasestr... yes
checking for fmtcheck... no
checking for dprintf... yes
checking for gzopen in -lz... no
checking for BZ2_bzCompressInit in -lbz2... yes
checking for lzma_stream_decoder in -llzma... yes
checking for seccomp_init in -lseccomp... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating magic/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating python/Makefile
config.status: creating libmagic.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
(mlfs chroot) root:/tmp/file-5.40#
(mlfs chroot) root:/tmp/file-5.40# # Build and install
(mlfs chroot) root:/tmp/file-5.40# make -j4 && make install
make all-recursive
make[1]: Entering directory '/tmp/file-5.40'
Making all in src
make[2]: Entering directory '/tmp/file-5.40/src'
sed -e "s/X.YY/$(echo 5.40 | tr -d .)/" < ../src/magic.h.in > magic.h
make all-am
make[3]: Entering directory '/tmp/file-5.40/src'
CC file.o
CC seccomp.o
CC buffer.lo
CC magic.lo
CC apprentice.lo
CC softmagic.lo
CC ascmagic.lo
CC encoding.lo
CC compress.lo
CC is_csv.lo
CC is_json.lo
CC is_tar.lo
CC readelf.lo
CC print.lo
CC fsmagic.lo
CC funcs.lo
CC apptype.lo
CC der.lo
CC cdf.lo
CC cdf_time.lo
CC readcdf.lo
CC fmtcheck.lo
CCLD libmagic.la
/tools/lib/gcc/x86_64-mlfs-linux-musl/10.3.1/../../../../x86_64-mlfs-linux-musl/bin/ld: /tools/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against symbol `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-mlfs-linux-musl/10.3.1/../../../../x86_64-mlfs-linux-musl/bin/ld: /tools/lib/libbz2.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-mlfs-linux-musl/10.3.1/../../../../x86_64-mlfs-linux-musl/bin/ld: /tools/lib/libbz2.a(decompress.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-mlfs-linux-musl/10.3.1/../../../../x86_64-mlfs-linux-musl/bin/ld: /tools/lib/libbz2.a(blocksort.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-mlfs-linux-musl/10.3.1/../../../../x86_64-mlfs-linux-musl/bin/ld: /tools/lib/libbz2.a(blocksort.o): warning: relocation against `stderr' in read-only section `.text'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:499: libmagic.la] Error 1
make[3]: Leaving directory '/tmp/file-5.40/src'
make[2]: *** [Makefile:380: all] Error 2
make[2]: Leaving directory '/tmp/file-5.40/src'
make[1]: *** [Makefile:459: all-recursive] Error 1
make[1]: Leaving directory '/tmp/file-5.40'
make: *** [Makefile:368: all] Error 2
(mlfs chroot) root:/tmp/file-5.40#
Stage 3, final system, step 014. Haven't had any issues during the previous steps. Any ideas?
Step 10 fails with this output after command:
PATH=/bin:/usr/bin:/cross-tools/bin:/tools/bin make
Output:
configure: summary of build options:
Version: GNU MP 6.2.0
Host type: none-mlfs-linux-musl
ABI: standard
Install prefix: /tools
Compiler: x86_64-mlfs-linux-musl-gcc
Static libraries: yes
Shared libraries: no
make[1]: Leaving directory '/mnt/mlfs/sources/gcc-10.1.0/build'
make: *** [Makefile:963: all] Error 2
i've followed the build steps with extreme caution but i'm given this error at step 11:
[07:04] mlfs /mnt/mss/apathymusl/sources/files/linux-5.2.11: make mrproper
[07:04] mlfs /mnt/mss/apathymusl/sources/files/linux-5.2.11: MLFS_ARCH=${MLFS_CPU} make INSTALL_HDR_PATH=dest headers_install
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c:97:10: fatal error: sys/types.h: No such file or directory
97 | #include <sys/types.h>
| ^~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:90: scripts/basic/fixdep] Error 1
make: *** [Makefile:504: scripts_basic] Error 2
gcc-9.2.0
, glibc-2.29
, binutils-2.32
system running on 5.2.11-apathy-r4
kernel with 5.0
kernel headers.x86_64
./bin/sh
is symlinked to bash 5.0.0
.can provide any extra details if desired.
Musl-LFS/doc/2-toolchain/04-gcc
Lines 111 to 114 in 988f2c6
modifying the
*cpp:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
line in 062-Final_System-GCC
to:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} -I /usr/lib/gcc/$ARCH-linux-musl/9.1.0/include -I /usr/lib/gcc/$ARCH-linux-musl/9.1.0/include-fixed
causes [-Werror=missing-include-dirs]
complaining about /usr/lib/gcc/x86_64-linux-musl/9.1.0 /include-fixed
and /usr/lib/gcc/x86_64-linux-musl/9.1.0/include
not existing.
i experienced this when installing p11-kit
and gnutls
. exporting a fresh specs
file and replacing it with the modified one gets rid of the errors.
And I'd like to know if you guys have interest in adding it to sources.list instead of using headers saved in files/.
I've also created a script to automate the instalation process. It's made in Korn Shell (because it's the default shell for Copacabana), but you can run it with GNU Bourne-Again Shell without further problems.
The GitHub repository is here:
https://github.com/Projeto-Pindorama/musl-compat
And the tarball is here:
https://github.com/Projeto-Pindorama/musl-compat/archive/refs/tags/0.5.tar.gz
Perl-5.34.0 configures fine after unpacking perl-cross-1.3.6 over it, but build segfaults:
make[1]: Leaving directory '/mnt/mlfs/sources/perl-5.34.0'
make dynaloader
make[1]: Entering directory '/mnt/mlfs/sources/perl-5.34.0'
sh cflags.SH
./miniperl_top make_patchnum.pl
cp -f ext/re/re.pm lib/re.pm
cp -f dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp lib/ExtUtils/xsubpp
Updating 'git_version.h' and 'lib/Config_git.pl' cflags.SH: Adding -Werror=pointer-arith.
cflags.SH: Adding -Wextra.
cflags.SH: Adding -Wc++-compat.
cflags.SH: Adding -Wwrite-strings.
cflags.SH: Adding -Werror=declaration-after-statement.
cflags.SH: cc = x86_64-mlfs-linux-musl-gcc
cflags.SH: ccflags = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
cflags.SH: stdflags =
cflags.SH: optimize = -fwrapv -fno-strict-aliasing
cflags.SH: warn = -Wall -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -Werror=declaration-after-statement
Extracting cflags (with variable substitutions)
./miniperl_top configpm
make[1]: *** [Makefile:207: lib/Config.pm] Segmentation fault
make[1]: Leaving directory '/mnt/mlfs/sources/perl-5.34.0'
make: *** [Makefile:80: all] Error 2
kernel log shows:
miniperl[29079]: segfault at 57343900 ip 00000000005794f5 sp 00007ffefe3ed200 error 4 in miniperl[405000+2cd000]
Code: 40 01 0f b6 c0 89 85 34 ff ff ff c7 85 e4 fe ff ff 00 00 00 00 48 8b 85 c8 f9 ff ff 48 8b 40 10 48 39 45 88 73 0c 48 8b 45 88 <0f> b6 00 0f b6 c0 eb 05 b8 f6 ff ff ff 89 85 64 ff ff ff 81 bd 34
When building the final system (section 03 - Chroot), compiling utmp, you are asked to do the following:
# Set the version in pkconfig file
cp -v ../files/utmps-alpine/*.pc /tmp/
sed -i -e "s/@@VERSION@@/0.1.0.2/g" -- /tmp/*.pc
However, there is no such directory as files/utmps-alpine! Am I missing something?
I was trying to compile IPRoute2 and just got this error.
There's nothing unusual on my CFLAGS (in fact, it's empty).
Any clue of what can be happening?
sh configure /usr/include
TC schedulers
ATM nolibc has setns: no
SELinux support: no
libbpf support: no
ELF support: yes
libmnl support: no
Berkeley DB: no
need for strlcpy: yes
libcap support: yeslib
CC libgenl.o
CC libnetlink.o
libnetlink.c:154:2: warning: #warning "libmnl required for error support" [-Wcpp]
154 | #warning "libmnl required for error support"
| ^~~~~~~
AR libnetlink.a
CC utils.o
In file included from utils.c:41:
../include/namespace.h:41:19: error: static declaration of 'setns' follows non-static declaration
41 | static inline int setns(int fd, int nstype)
| ^~~~~
In file included from ../include/namespace.h:5,
from utils.c:41:
/usr/include/sched.h:78:5: note: previous declaration of 'setns' was here
78 | int setns(int, int);
| ^~~~~
make[1]: *** [utils.o] Error 1
make: *** [all] Error 2
I'm trying to build GNU m4 (version 1.4.19) at the chroot stage, and it returns, when CCLD
'ng the final m4 binary, linking errors related to undefined functions being referenced --- interesting enough, these functions serve to the purpose of reporting errors, such as "error_at_line
" or just "error
".
Attached, there is my config.log (which ran fine, by the way) and below there's the error itself.
config.log
Complete gmake log (errorm4.log)
copacabana_chroot% gmake -j$(grep -c 'processor' /proc/cpuinfo)
[...]
CCLD m4
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(clean-temp.o): in function `create_temp_dir':
/usr/src/cmp/m4-1.4.19/lib/clean-temp.c:234: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: /usr/src/cmp/m4-1.4.19/lib/clean-temp.c:249: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(clean-temp.o): in function `do_rmdir':
/usr/src/cmp/m4-1.4.19/lib/clean-temp.c:370: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: /usr/src/cmp/m4-1.4.19/lib/clean-temp.c:370: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: /usr/src/cmp/m4-1.4.19/lib/clean-temp.c:370: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(execute.o):/usr/src/cmp/m4-1.4.19/lib/execute.c:347: more undefined references to `error' follow
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(verror.o): in function `verror_at_line':
/usr/src/cmp/m4-1.4.19/lib/verror.c:68: undefined reference to `error_at_line'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: /usr/src/cmp/m4-1.4.19/lib/verror.c:70: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: /usr/src/cmp/m4-1.4.19/lib/verror.c:76: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(xalloc-die.o): in function `xalloc_die':
/usr/src/cmp/m4-1.4.19/lib/xalloc-die.c:34: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(xprintf.o): in function `xvprintf':
/usr/src/cmp/m4-1.4.19/lib/xprintf.c:50: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(xprintf.o): in function `xvfprintf':
/usr/src/cmp/m4-1.4.19/lib/xprintf.c:76: undefined reference to `error'
/tools/lib/gcc/x86_64-pindoramaCOPACABANA-linux-musl/10.3.1/../../../../x86_64-pindoramaCOPACABANA-linux-musl/bin/ld: ../lib/libm4.a(xprintf.o):/usr/src/cmp/m4-1.4.19/lib/xprintf.c:76: more undefined references to `error' follow
collect2: error: ld returned 1 exit status
gmake[2]: *** [m4] Error 1
gmake[2]: Leaving directory `/usr/src/cmp/m4-1.4.19/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/src/cmp/m4-1.4.19'
gmake: *** [all] Error 2
Just a quick note: I have not compiled argp-standalone nor GNU readline, since these were not specified as dependencies of GNU m4 in LFS' Dependencies appendix (https://www.linuxfromscratch.org/lfs/view/9.1-systemd/appendices/dependencies.html).
I do not think this is a problem, but...
Funny enough, before a third attempt to build it, I have got "undefined reference" errors related to rpl_*
functions, which, at least based on my little research, it was related to Gnulib; but, after I restarted the chroot environment, this error just disappeared and the "undefined reference to `error
'" errors stayed.
Yes, this is confusing, I know.
Use the source at https://github.com/chimera-linux/musl-fts
instead of
https://github.com/pullmoll/musl-fts
This will eliminate the need of autotools and can be built sooner... would be nice to build the supporting libraries fr musl libc right after musl libc is built for the final system
When I tried to build the kernel headers in the final chroot, I've got an error, It can't find: sys/types.h
.
Looks like missing symbols in host's ncurses library:
Error relocating /lib/libncursesw.so.6: __vfprintf_chk: symbol not found
Error relocating /lib/libncursesw.so.6: __poll_chk: symbol not found
Error relocating /lib/libncursesw.so.6: __memcpy_chk: symbol not found
Error relocating /lib/libncursesw.so.6: __vsnprintf_chk: symbol not found
Error relocating /lib/libncursesw.so.6: __strcpy_chk: symbol not found
Error relocating /lib/libncursesw.so.6: __fprintf_chk: symbol not found
Error relocating /lib/libncursesw.so.6: __sprintf_chk: symbol not found
make[4]: *** [Makefile:2640: funs.h] Error 127
make[4]: Leaving directory '/mnt/mlfs/sources/texinfo-6.7/tools/info'
make[3]: *** [Makefile:1224: all-recursive] Error 1
make[3]: Leaving directory '/mnt/mlfs/sources/texinfo-6.7/tools'
make[2]: *** [Makefile:1163: all] Error 2
make[2]: Leaving directory '/mnt/mlfs/sources/texinfo-6.7/tools'
make[1]: *** [Makefile:1224: all-recursive] Error 1
make[1]: Leaving directory '/mnt/mlfs/sources/texinfo-6.7'
make: *** [Makefile:1163: all] Error 2
[mlfs@arch64UEFI texinfo-6.7]$
Host system is currently archlinux. Not sure if my instructions need revision or something wrong with host's ncurses libraries
Compiler: GCC-9.1.0
Libc: Musl-1.1.22
Arch: i686
Building for: Toolchain in /tools
Configures: Yes
Compiles: No.
/mnt/sda4/cross-tools/bin/../lib/gcc/i686-mlfs-linux-musl/9.1.0/../../../../i686-mlfs-linux-musl/bin/ld: lib/libcoreutils.a(strtold.o):/mnt/sda4/sources/coreutils-8.31/lib/strtod.c:305: multiple definition of `minus_zero'; lib/libcoreutils.a(strtod.o):/mnt/sda4/sources/coreutils-8.31/lib/strtod.c:305: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:8537: src/od] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/mnt/sda4/sources/coreutils-8.31'
make[1]: *** [Makefile:12165: all-recursive] Error 1
make[1]: Leaving directory '/mnt/sda4/sources/coreutils-8.31'
make: *** [Makefile:6351: all] Error 2
Hardware: Raspberry Pi 3
During chroot, GCC fails to compile:
checking whether make supports nested variables... yes
checking for armv7l-linux-musleabihf-gcc... /sources/gcc-10.2.0/build/./gcc/xgcc -B/sources/gcc-10.2.0/build/./gcc/ -B/usr/armv7l-linux-musleabihf/bin/ -B/usr/armv7l-linux-musleabihf/lib/ -isystem /usr/armv7l-linux-musleabihf/include -isystem /usr/armv7l-linux-musleabihf/sys-include
checking whether the C compiler works... no
configure: error: in `/sources/gcc-10.2.0/build/armv7l-linux-musleabihf/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [Makefile:14436: configure-target-libgomp] Error 1
make[1]: Leaving directory '/sources/gcc-10.2.0/build'
make: *** [Makefile:962: all] Error 2
(mlfs chroot) root:/sources/gcc-10.2.0/build#
Same build instructions work fine on x86
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.