The stage 2 compiler was looking for libraries outside the bootstrapped toolchain environment which causes that linked programs cannot be executied because the runtime linker only looks for libraries inside the toolchain environment.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/gcc | 1 + 1 file changed, 1 insertion(+)
diff --git a/lfs/gcc b/lfs/gcc index ade02dcda..96e58ddae 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -116,6 +116,7 @@ ifeq "$(PASS)" "2" EXTRA_CONFIG = \ --build=$(BUILDTARGET) \ --prefix=$(TOOLS_DIR) \ + --with-sysroot=$(ROOT) \ --with-local-prefix=$(TOOLS_DIR) \ --with-native-system-header-dir=$(TOOLS_DIR)/include \ --enable-languages=c,c++ \
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- config/rootfiles/common/aarch64/glibc | 40 ++++------ config/rootfiles/common/armv6l/glibc | 40 ++++------ config/rootfiles/common/x86_64/glibc | 43 +++++------ lfs/glibc | 8 +- ...x-null-pointer-dereference-bug-28213.patch | 40 ---------- ...ead_attr_copy-in-mq_notify-bug-27896.patch | 74 ------------------- 6 files changed, 50 insertions(+), 195 deletions(-) delete mode 100644 src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch delete mode 100644 src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch
diff --git a/config/rootfiles/common/aarch64/glibc b/config/rootfiles/common/aarch64/glibc index 0849703f9..634f1686e 100644 --- a/config/rootfiles/common/aarch64/glibc +++ b/config/rootfiles/common/aarch64/glibc @@ -1,41 +1,25 @@ #etc/ld.so.cache etc/rpc -lib/ld-2.33.so lib/ld-linux-aarch64.so.1 -lib/libBrokenLocale-2.33.so lib/libBrokenLocale.so.1 #lib/libSegFault.so -lib/libanl-2.33.so lib/libanl.so.1 -lib/libc-2.33.so lib/libc.so.6 -lib/libdl-2.33.so +#lib/libc_malloc_debug.so.0 lib/libdl.so.2 -lib/libm-2.33.so lib/libm.so.6 #lib/libmemusage.so -lib/libnsl-2.33.so lib/libnsl.so.1 -lib/libnss_compat-2.33.so lib/libnss_compat.so.2 -lib/libnss_db-2.33.so lib/libnss_db.so.2 -lib/libnss_dns-2.33.so lib/libnss_dns.so.2 -lib/libnss_files-2.33.so lib/libnss_files.so.2 -lib/libnss_hesiod-2.33.so lib/libnss_hesiod.so.2 #lib/libpcprofile.so -lib/libpthread-2.33.so lib/libpthread.so.0 -lib/libresolv-2.33.so lib/libresolv.so.2 -lib/librt-2.33.so lib/librt.so.1 -lib/libthread_db-1.0.so lib/libthread_db.so.1 -lib/libutil-2.33.so lib/libutil.so.1 sbin/ldconfig #sbin/sln @@ -145,6 +129,8 @@ usr/bin/locale #usr/include/bits/procfs-id.h #usr/include/bits/procfs-prregset.h #usr/include/bits/procfs.h +#usr/include/bits/pthread_stack_min-dynamic.h +#usr/include/bits/pthread_stack_min.h #usr/include/bits/pthreadtypes-arch.h #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h @@ -169,6 +155,7 @@ usr/bin/locale #usr/include/bits/signum-arch.h #usr/include/bits/signum-generic.h #usr/include/bits/sigstack.h +#usr/include/bits/sigstksz.h #usr/include/bits/sigthread.h #usr/include/bits/sockaddr.h #usr/include/bits/socket-constants.h @@ -197,6 +184,7 @@ usr/bin/locale #usr/include/bits/struct_mutex.h #usr/include/bits/struct_rwlock.h #usr/include/bits/struct_stat.h +#usr/include/bits/struct_stat_time64_helper.h #usr/include/bits/syscall.h #usr/include/bits/syslog-ldbl.h #usr/include/bits/syslog-path.h @@ -245,11 +233,17 @@ usr/bin/locale #usr/include/bits/types/struct___jmp_buf_tag.h #usr/include/bits/types/struct_iovec.h #usr/include/bits/types/struct_itimerspec.h +#usr/include/bits/types/struct_msqid64_ds.h +#usr/include/bits/types/struct_msqid64_ds_helper.h #usr/include/bits/types/struct_msqid_ds.h #usr/include/bits/types/struct_osockaddr.h #usr/include/bits/types/struct_rusage.h #usr/include/bits/types/struct_sched_param.h +#usr/include/bits/types/struct_semid64_ds.h +#usr/include/bits/types/struct_semid64_ds_helper.h #usr/include/bits/types/struct_semid_ds.h +#usr/include/bits/types/struct_shmid64_ds.h +#usr/include/bits/types/struct_shmid64_ds_helper.h #usr/include/bits/types/struct_shmid_ds.h #usr/include/bits/types/struct_sigstack.h #usr/include/bits/types/struct_statx.h @@ -292,6 +286,7 @@ usr/bin/locale #usr/include/error.h #usr/include/execinfo.h #usr/include/fcntl.h +#usr/include/features-time64.h #usr/include/features.h #usr/include/fenv.h #usr/include/finclude @@ -775,6 +770,8 @@ usr/lib/gconv #usr/lib/gconv/UTF-7.so #usr/lib/gconv/VISCII.so #usr/lib/gconv/gconv-modules +#usr/lib/gconv/gconv-modules.d +#usr/lib/gconv/gconv-modules.d/gconv-modules-extra.conf #usr/lib/gconv/libCNS.so #usr/lib/gconv/libGB.so #usr/lib/gconv/libISOIR165.so @@ -793,27 +790,22 @@ usr/lib/gconv #usr/lib/libanl.so #usr/lib/libc.a #usr/lib/libc.so +#usr/lib/libc_malloc_debug.so #usr/lib/libc_nonshared.a #usr/lib/libdl.a -#usr/lib/libdl.so #usr/lib/libg.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a #usr/lib/libnss_compat.so #usr/lib/libnss_db.so -#usr/lib/libnss_dns.so -#usr/lib/libnss_files.so #usr/lib/libnss_hesiod.so #usr/lib/libpthread.a -#usr/lib/libpthread.so #usr/lib/libresolv.a #usr/lib/libresolv.so #usr/lib/librt.a -#usr/lib/librt.so #usr/lib/libthread_db.so #usr/lib/libutil.a -#usr/lib/libutil.so usr/lib/locale #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 @@ -8372,7 +8364,5 @@ usr/lib/locale #usr/share/locale/zh_TW #usr/share/locale/zh_TW/LC_MESSAGES #usr/share/locale/zh_TW/LC_MESSAGES/libc.mo -#var/cache/ldconfig -#var/cache/ldconfig/aux-cache #var/db #var/db/Makefile diff --git a/config/rootfiles/common/armv6l/glibc b/config/rootfiles/common/armv6l/glibc index de1a6519c..3348bc098 100644 --- a/config/rootfiles/common/armv6l/glibc +++ b/config/rootfiles/common/armv6l/glibc @@ -1,41 +1,25 @@ #etc/ld.so.cache etc/rpc -lib/ld-2.33.so lib/ld-linux.so.3 -lib/libBrokenLocale-2.33.so lib/libBrokenLocale.so.1 #lib/libSegFault.so -lib/libanl-2.33.so lib/libanl.so.1 -lib/libc-2.33.so lib/libc.so.6 -lib/libdl-2.33.so +#lib/libc_malloc_debug.so.0 lib/libdl.so.2 -lib/libm-2.33.so lib/libm.so.6 #lib/libmemusage.so -lib/libnsl-2.33.so lib/libnsl.so.1 -lib/libnss_compat-2.33.so lib/libnss_compat.so.2 -lib/libnss_db-2.33.so lib/libnss_db.so.2 -lib/libnss_dns-2.33.so lib/libnss_dns.so.2 -lib/libnss_files-2.33.so lib/libnss_files.so.2 -lib/libnss_hesiod-2.33.so lib/libnss_hesiod.so.2 #lib/libpcprofile.so -lib/libpthread-2.33.so lib/libpthread.so.0 -lib/libresolv-2.33.so lib/libresolv.so.2 -lib/librt-2.33.so lib/librt.so.1 -lib/libthread_db-1.0.so lib/libthread_db.so.1 -lib/libutil-2.33.so lib/libutil.so.1 sbin/ldconfig #sbin/sln @@ -145,6 +129,8 @@ usr/bin/locale #usr/include/bits/procfs-id.h #usr/include/bits/procfs-prregset.h #usr/include/bits/procfs.h +#usr/include/bits/pthread_stack_min-dynamic.h +#usr/include/bits/pthread_stack_min.h #usr/include/bits/pthreadtypes-arch.h #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h @@ -169,6 +155,7 @@ usr/bin/locale #usr/include/bits/signum-arch.h #usr/include/bits/signum-generic.h #usr/include/bits/sigstack.h +#usr/include/bits/sigstksz.h #usr/include/bits/sigthread.h #usr/include/bits/sockaddr.h #usr/include/bits/socket-constants.h @@ -197,6 +184,7 @@ usr/bin/locale #usr/include/bits/struct_mutex.h #usr/include/bits/struct_rwlock.h #usr/include/bits/struct_stat.h +#usr/include/bits/struct_stat_time64_helper.h #usr/include/bits/syscall.h #usr/include/bits/syslog-ldbl.h #usr/include/bits/syslog-path.h @@ -245,11 +233,17 @@ usr/bin/locale #usr/include/bits/types/struct___jmp_buf_tag.h #usr/include/bits/types/struct_iovec.h #usr/include/bits/types/struct_itimerspec.h +#usr/include/bits/types/struct_msqid64_ds.h +#usr/include/bits/types/struct_msqid64_ds_helper.h #usr/include/bits/types/struct_msqid_ds.h #usr/include/bits/types/struct_osockaddr.h #usr/include/bits/types/struct_rusage.h #usr/include/bits/types/struct_sched_param.h +#usr/include/bits/types/struct_semid64_ds.h +#usr/include/bits/types/struct_semid64_ds_helper.h #usr/include/bits/types/struct_semid_ds.h +#usr/include/bits/types/struct_shmid64_ds.h +#usr/include/bits/types/struct_shmid64_ds_helper.h #usr/include/bits/types/struct_shmid_ds.h #usr/include/bits/types/struct_sigstack.h #usr/include/bits/types/struct_statx.h @@ -292,6 +286,7 @@ usr/bin/locale #usr/include/error.h #usr/include/execinfo.h #usr/include/fcntl.h +#usr/include/features-time64.h #usr/include/features.h #usr/include/fenv.h #usr/include/finclude @@ -774,6 +769,8 @@ usr/lib/gconv #usr/lib/gconv/UTF-7.so #usr/lib/gconv/VISCII.so #usr/lib/gconv/gconv-modules +#usr/lib/gconv/gconv-modules.d +#usr/lib/gconv/gconv-modules.d/gconv-modules-extra.conf #usr/lib/gconv/libCNS.so #usr/lib/gconv/libGB.so #usr/lib/gconv/libISOIR165.so @@ -795,27 +792,22 @@ usr/lib/gconv #usr/lib/libanl.so #usr/lib/libc.a #usr/lib/libc.so +#usr/lib/libc_malloc_debug.so #usr/lib/libc_nonshared.a #usr/lib/libdl.a -#usr/lib/libdl.so #usr/lib/libg.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a #usr/lib/libnss_compat.so #usr/lib/libnss_db.so -#usr/lib/libnss_dns.so -#usr/lib/libnss_files.so #usr/lib/libnss_hesiod.so #usr/lib/libpthread.a -#usr/lib/libpthread.so #usr/lib/libresolv.a #usr/lib/libresolv.so #usr/lib/librt.a -#usr/lib/librt.so #usr/lib/libthread_db.so #usr/lib/libutil.a -#usr/lib/libutil.so usr/lib/locale #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 @@ -8374,7 +8366,5 @@ usr/lib/locale #usr/share/locale/zh_TW #usr/share/locale/zh_TW/LC_MESSAGES #usr/share/locale/zh_TW/LC_MESSAGES/libc.mo -#var/cache/ldconfig -#var/cache/ldconfig/aux-cache #var/db #var/db/Makefile diff --git a/config/rootfiles/common/x86_64/glibc b/config/rootfiles/common/x86_64/glibc index 74f7e38fd..40bd175f4 100644 --- a/config/rootfiles/common/x86_64/glibc +++ b/config/rootfiles/common/x86_64/glibc @@ -1,43 +1,26 @@ #etc/ld.so.cache etc/rpc -lib/ld-2.33.so lib/ld-linux-x86-64.so.2 -lib/libBrokenLocale-2.33.so lib/libBrokenLocale.so.1 #lib/libSegFault.so -lib/libanl-2.33.so lib/libanl.so.1 -lib/libc-2.33.so lib/libc.so.6 -lib/libdl-2.33.so +#lib/libc_malloc_debug.so.0 lib/libdl.so.2 -lib/libm-2.33.so lib/libm.so.6 #lib/libmemusage.so -lib/libmvec-2.33.so lib/libmvec.so.1 -lib/libnsl-2.33.so lib/libnsl.so.1 -lib/libnss_compat-2.33.so lib/libnss_compat.so.2 -lib/libnss_db-2.33.so lib/libnss_db.so.2 -lib/libnss_dns-2.33.so lib/libnss_dns.so.2 -lib/libnss_files-2.33.so lib/libnss_files.so.2 -lib/libnss_hesiod-2.33.so lib/libnss_hesiod.so.2 #lib/libpcprofile.so -lib/libpthread-2.33.so lib/libpthread.so.0 -lib/libresolv-2.33.so lib/libresolv.so.2 -lib/librt-2.33.so lib/librt.so.1 -lib/libthread_db-1.0.so lib/libthread_db.so.1 -lib/libutil-2.33.so lib/libutil.so.1 sbin/ldconfig #sbin/sln @@ -137,6 +120,8 @@ usr/bin/locale #usr/include/bits/msq.h #usr/include/bits/netdb.h #usr/include/bits/param.h +#usr/include/bits/platform +#usr/include/bits/platform/x86.h #usr/include/bits/poll.h #usr/include/bits/poll2.h #usr/include/bits/posix1_lim.h @@ -147,6 +132,8 @@ usr/bin/locale #usr/include/bits/procfs-id.h #usr/include/bits/procfs-prregset.h #usr/include/bits/procfs.h +#usr/include/bits/pthread_stack_min-dynamic.h +#usr/include/bits/pthread_stack_min.h #usr/include/bits/pthreadtypes-arch.h #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h @@ -171,6 +158,7 @@ usr/bin/locale #usr/include/bits/signum-arch.h #usr/include/bits/signum-generic.h #usr/include/bits/sigstack.h +#usr/include/bits/sigstksz.h #usr/include/bits/sigthread.h #usr/include/bits/sockaddr.h #usr/include/bits/socket-constants.h @@ -199,6 +187,7 @@ usr/bin/locale #usr/include/bits/struct_mutex.h #usr/include/bits/struct_rwlock.h #usr/include/bits/struct_stat.h +#usr/include/bits/struct_stat_time64_helper.h #usr/include/bits/syscall.h #usr/include/bits/syslog-ldbl.h #usr/include/bits/syslog-path.h @@ -247,11 +236,17 @@ usr/bin/locale #usr/include/bits/types/struct___jmp_buf_tag.h #usr/include/bits/types/struct_iovec.h #usr/include/bits/types/struct_itimerspec.h +#usr/include/bits/types/struct_msqid64_ds.h +#usr/include/bits/types/struct_msqid64_ds_helper.h #usr/include/bits/types/struct_msqid_ds.h #usr/include/bits/types/struct_osockaddr.h #usr/include/bits/types/struct_rusage.h #usr/include/bits/types/struct_sched_param.h +#usr/include/bits/types/struct_semid64_ds.h +#usr/include/bits/types/struct_semid64_ds_helper.h #usr/include/bits/types/struct_semid_ds.h +#usr/include/bits/types/struct_shmid64_ds.h +#usr/include/bits/types/struct_shmid64_ds_helper.h #usr/include/bits/types/struct_shmid_ds.h #usr/include/bits/types/struct_sigstack.h #usr/include/bits/types/struct_statx.h @@ -294,6 +289,7 @@ usr/bin/locale #usr/include/error.h #usr/include/execinfo.h #usr/include/fcntl.h +#usr/include/features-time64.h #usr/include/features.h #usr/include/fenv.h #usr/include/finclude @@ -783,6 +779,8 @@ usr/lib/gconv #usr/lib/gconv/UTF-7.so #usr/lib/gconv/VISCII.so #usr/lib/gconv/gconv-modules +#usr/lib/gconv/gconv-modules.d +#usr/lib/gconv/gconv-modules.d/gconv-modules-extra.conf #usr/lib/gconv/libCNS.so #usr/lib/gconv/libGB.so #usr/lib/gconv/libISOIR165.so @@ -801,11 +799,11 @@ usr/lib/gconv #usr/lib/libanl.so #usr/lib/libc.a #usr/lib/libc.so +#usr/lib/libc_malloc_debug.so #usr/lib/libc_nonshared.a #usr/lib/libdl.a -#usr/lib/libdl.so #usr/lib/libg.a -#usr/lib/libm-2.33.a +#usr/lib/libm-2.34.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a @@ -813,18 +811,13 @@ usr/lib/gconv #usr/lib/libmvec.so #usr/lib/libnss_compat.so #usr/lib/libnss_db.so -#usr/lib/libnss_dns.so -#usr/lib/libnss_files.so #usr/lib/libnss_hesiod.so #usr/lib/libpthread.a -#usr/lib/libpthread.so #usr/lib/libresolv.a #usr/lib/libresolv.so #usr/lib/librt.a -#usr/lib/librt.so #usr/lib/libthread_db.so #usr/lib/libutil.a -#usr/lib/libutil.so usr/lib/locale #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 diff --git a/lfs/glibc b/lfs/glibc index d2d3aff91..e7f2a71c5 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -24,7 +24,7 @@
include Config
-VER = 2.33 +VER = 2.34
THISAPP = glibc-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -73,7 +73,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 390bbd889c7e8e8a7041564cb6b27cca +$(DL_FILE)_MD5 = 31998b53fb39cb946e96abc310af1c89
install : $(TARGET)
@@ -105,10 +105,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) @mkdir $(DIR_SRC)/glibc-build
- # Security Fixes - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
ifneq "$(TOOLCHAIN)" "1" diff --git a/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch b/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch deleted file mode 100644 index d2083e6e2..000000000 --- a/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 27a78fd712c06748737dfa9638fab96ea362fca9 Mon Sep 17 00:00:00 2001 -From: Nikita Popov npv1310@gmail.com -Date: Mon, 9 Aug 2021 20:17:34 +0530 -Subject: [PATCH] librt: fix NULL pointer dereference (bug 28213) - -Helper thread frees copied attribute on NOTIFY_REMOVED message -received from the OS kernel. Unfortunately, it fails to check whether -copied attribute actually exists (data.attr != NULL). This worked -earlier because free() checks passed pointer before actually -attempting to release corresponding memory. But -__pthread_attr_destroy assumes pointer is not NULL. - -So passing NULL pointer to __pthread_attr_destroy will result in -segmentation fault. This scenario is possible if -notification->sigev_notify_attributes == NULL (which means default -thread attributes should be used). - -Signed-off-by: Nikita Popov npv1310@gmail.com -Reviewed-by: Siddhesh Poyarekar siddhesh@sourceware.org -(cherry picked from commit b805aebd42364fe696e417808a700fdb9800c9e8) ---- - sysdeps/unix/sysv/linux/mq_notify.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c -index 6f46d29d1d..1714e1cc5f 100644 ---- a/sysdeps/unix/sysv/linux/mq_notify.c -+++ b/sysdeps/unix/sysv/linux/mq_notify.c -@@ -132,7 +132,7 @@ helper_thread (void *arg) - to wait until it is done with it. */ - (void) __pthread_barrier_wait (¬ify_barrier); - } -- else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED) -+ else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED && data.attr != NULL) - { - /* The only state we keep is the copy of the thread attributes. */ - pthread_attr_destroy (data.attr); --- -2.20.1 - diff --git a/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch b/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch deleted file mode 100644 index f846b37b8..000000000 --- a/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 4b6be914bd3920500a67ef6ca1aa7d1c37e5e859 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab schwab@linux-m68k.org -Date: Thu, 27 May 2021 12:49:47 +0200 -Subject: [PATCH] Use __pthread_attr_copy in mq_notify (bug 27896) - -Make a deep copy of the pthread attribute object to remove a potential -use-after-free issue. - -(cherry picked from commit 42d359350510506b87101cf77202fefcbfc790cb) ---- - NEWS | 6 ++++++ - sysdeps/unix/sysv/linux/mq_notify.c | 15 ++++++++++----- - 2 files changed, 16 insertions(+), 5 deletions(-) - -diff --git a/NEWS b/NEWS -index 0c33a80af9..b9e570b4a4 100644 ---- a/NEWS -+++ b/NEWS -@@ -13,6 +13,12 @@ Major new features: - a dump of information related to IFUNC resolver operation and - glibc-hwcaps subdirectory selection. - -+Security related changes: -+ -+ CVE-2021-33574: The mq_notify function has a potential use-after-free -+ issue when using a notification type of SIGEV_THREAD and a thread -+ attribute with a non-default affinity mask. -+ - The following bugs are resolved with this release: - - [15271] dlfcn function failure after dlmopen terminates process -diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c -index cc575a0cdd..f7ddfe5a6c 100644 ---- a/sysdeps/unix/sysv/linux/mq_notify.c -+++ b/sysdeps/unix/sysv/linux/mq_notify.c -@@ -133,8 +133,11 @@ helper_thread (void *arg) - (void) __pthread_barrier_wait (¬ify_barrier); - } - else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED) -- /* The only state we keep is the copy of the thread attributes. */ -- free (data.attr); -+ { -+ /* The only state we keep is the copy of the thread attributes. */ -+ pthread_attr_destroy (data.attr); -+ free (data.attr); -+ } - } - return NULL; - } -@@ -255,8 +258,7 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification) - if (data.attr == NULL) - return -1; - -- memcpy (data.attr, notification->sigev_notify_attributes, -- sizeof (pthread_attr_t)); -+ __pthread_attr_copy (data.attr, notification->sigev_notify_attributes); - } - - /* Construct the new request. */ -@@ -270,7 +272,10 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification) - - /* If it failed, free the allocated memory. */ - if (__glibc_unlikely (retval != 0)) -- free (data.attr); -+ { -+ pthread_attr_destroy (data.attr); -+ free (data.attr); -+ } - - return retval; - } --- -2.20.1 -
Reviewed-by: Adolf Belka adolf.belka@ipfire.org
On 04/02/2022 17:47, Michael Tremer wrote:
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
config/rootfiles/common/aarch64/glibc | 40 ++++------ config/rootfiles/common/armv6l/glibc | 40 ++++------ config/rootfiles/common/x86_64/glibc | 43 +++++------ lfs/glibc | 8 +- ...x-null-pointer-dereference-bug-28213.patch | 40 ---------- ...ead_attr_copy-in-mq_notify-bug-27896.patch | 74 ------------------- 6 files changed, 50 insertions(+), 195 deletions(-) delete mode 100644 src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch delete mode 100644 src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch
diff --git a/config/rootfiles/common/aarch64/glibc b/config/rootfiles/common/aarch64/glibc index 0849703f9..634f1686e 100644 --- a/config/rootfiles/common/aarch64/glibc +++ b/config/rootfiles/common/aarch64/glibc @@ -1,41 +1,25 @@ #etc/ld.so.cache etc/rpc -lib/ld-2.33.so lib/ld-linux-aarch64.so.1 -lib/libBrokenLocale-2.33.so lib/libBrokenLocale.so.1 #lib/libSegFault.so -lib/libanl-2.33.so lib/libanl.so.1 -lib/libc-2.33.so lib/libc.so.6 -lib/libdl-2.33.so +#lib/libc_malloc_debug.so.0 lib/libdl.so.2 -lib/libm-2.33.so lib/libm.so.6 #lib/libmemusage.so -lib/libnsl-2.33.so lib/libnsl.so.1 -lib/libnss_compat-2.33.so lib/libnss_compat.so.2 -lib/libnss_db-2.33.so lib/libnss_db.so.2 -lib/libnss_dns-2.33.so lib/libnss_dns.so.2 -lib/libnss_files-2.33.so lib/libnss_files.so.2 -lib/libnss_hesiod-2.33.so lib/libnss_hesiod.so.2 #lib/libpcprofile.so -lib/libpthread-2.33.so lib/libpthread.so.0 -lib/libresolv-2.33.so lib/libresolv.so.2 -lib/librt-2.33.so lib/librt.so.1 -lib/libthread_db-1.0.so lib/libthread_db.so.1 -lib/libutil-2.33.so lib/libutil.so.1 sbin/ldconfig #sbin/sln @@ -145,6 +129,8 @@ usr/bin/locale #usr/include/bits/procfs-id.h #usr/include/bits/procfs-prregset.h #usr/include/bits/procfs.h +#usr/include/bits/pthread_stack_min-dynamic.h +#usr/include/bits/pthread_stack_min.h #usr/include/bits/pthreadtypes-arch.h #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h @@ -169,6 +155,7 @@ usr/bin/locale #usr/include/bits/signum-arch.h #usr/include/bits/signum-generic.h #usr/include/bits/sigstack.h +#usr/include/bits/sigstksz.h #usr/include/bits/sigthread.h #usr/include/bits/sockaddr.h #usr/include/bits/socket-constants.h @@ -197,6 +184,7 @@ usr/bin/locale #usr/include/bits/struct_mutex.h #usr/include/bits/struct_rwlock.h #usr/include/bits/struct_stat.h +#usr/include/bits/struct_stat_time64_helper.h #usr/include/bits/syscall.h #usr/include/bits/syslog-ldbl.h #usr/include/bits/syslog-path.h @@ -245,11 +233,17 @@ usr/bin/locale #usr/include/bits/types/struct___jmp_buf_tag.h #usr/include/bits/types/struct_iovec.h #usr/include/bits/types/struct_itimerspec.h +#usr/include/bits/types/struct_msqid64_ds.h +#usr/include/bits/types/struct_msqid64_ds_helper.h #usr/include/bits/types/struct_msqid_ds.h #usr/include/bits/types/struct_osockaddr.h #usr/include/bits/types/struct_rusage.h #usr/include/bits/types/struct_sched_param.h +#usr/include/bits/types/struct_semid64_ds.h +#usr/include/bits/types/struct_semid64_ds_helper.h #usr/include/bits/types/struct_semid_ds.h +#usr/include/bits/types/struct_shmid64_ds.h +#usr/include/bits/types/struct_shmid64_ds_helper.h #usr/include/bits/types/struct_shmid_ds.h #usr/include/bits/types/struct_sigstack.h #usr/include/bits/types/struct_statx.h @@ -292,6 +286,7 @@ usr/bin/locale #usr/include/error.h #usr/include/execinfo.h #usr/include/fcntl.h +#usr/include/features-time64.h #usr/include/features.h #usr/include/fenv.h #usr/include/finclude @@ -775,6 +770,8 @@ usr/lib/gconv #usr/lib/gconv/UTF-7.so #usr/lib/gconv/VISCII.so #usr/lib/gconv/gconv-modules +#usr/lib/gconv/gconv-modules.d +#usr/lib/gconv/gconv-modules.d/gconv-modules-extra.conf #usr/lib/gconv/libCNS.so #usr/lib/gconv/libGB.so #usr/lib/gconv/libISOIR165.so @@ -793,27 +790,22 @@ usr/lib/gconv #usr/lib/libanl.so #usr/lib/libc.a #usr/lib/libc.so +#usr/lib/libc_malloc_debug.so #usr/lib/libc_nonshared.a #usr/lib/libdl.a -#usr/lib/libdl.so #usr/lib/libg.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a #usr/lib/libnss_compat.so #usr/lib/libnss_db.so -#usr/lib/libnss_dns.so -#usr/lib/libnss_files.so #usr/lib/libnss_hesiod.so #usr/lib/libpthread.a -#usr/lib/libpthread.so #usr/lib/libresolv.a #usr/lib/libresolv.so #usr/lib/librt.a -#usr/lib/librt.so #usr/lib/libthread_db.so #usr/lib/libutil.a -#usr/lib/libutil.so usr/lib/locale #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 @@ -8372,7 +8364,5 @@ usr/lib/locale #usr/share/locale/zh_TW #usr/share/locale/zh_TW/LC_MESSAGES #usr/share/locale/zh_TW/LC_MESSAGES/libc.mo -#var/cache/ldconfig -#var/cache/ldconfig/aux-cache #var/db #var/db/Makefile diff --git a/config/rootfiles/common/armv6l/glibc b/config/rootfiles/common/armv6l/glibc index de1a6519c..3348bc098 100644 --- a/config/rootfiles/common/armv6l/glibc +++ b/config/rootfiles/common/armv6l/glibc @@ -1,41 +1,25 @@ #etc/ld.so.cache etc/rpc -lib/ld-2.33.so lib/ld-linux.so.3 -lib/libBrokenLocale-2.33.so lib/libBrokenLocale.so.1 #lib/libSegFault.so -lib/libanl-2.33.so lib/libanl.so.1 -lib/libc-2.33.so lib/libc.so.6 -lib/libdl-2.33.so +#lib/libc_malloc_debug.so.0 lib/libdl.so.2 -lib/libm-2.33.so lib/libm.so.6 #lib/libmemusage.so -lib/libnsl-2.33.so lib/libnsl.so.1 -lib/libnss_compat-2.33.so lib/libnss_compat.so.2 -lib/libnss_db-2.33.so lib/libnss_db.so.2 -lib/libnss_dns-2.33.so lib/libnss_dns.so.2 -lib/libnss_files-2.33.so lib/libnss_files.so.2 -lib/libnss_hesiod-2.33.so lib/libnss_hesiod.so.2 #lib/libpcprofile.so -lib/libpthread-2.33.so lib/libpthread.so.0 -lib/libresolv-2.33.so lib/libresolv.so.2 -lib/librt-2.33.so lib/librt.so.1 -lib/libthread_db-1.0.so lib/libthread_db.so.1 -lib/libutil-2.33.so lib/libutil.so.1 sbin/ldconfig #sbin/sln @@ -145,6 +129,8 @@ usr/bin/locale #usr/include/bits/procfs-id.h #usr/include/bits/procfs-prregset.h #usr/include/bits/procfs.h +#usr/include/bits/pthread_stack_min-dynamic.h +#usr/include/bits/pthread_stack_min.h #usr/include/bits/pthreadtypes-arch.h #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h @@ -169,6 +155,7 @@ usr/bin/locale #usr/include/bits/signum-arch.h #usr/include/bits/signum-generic.h #usr/include/bits/sigstack.h +#usr/include/bits/sigstksz.h #usr/include/bits/sigthread.h #usr/include/bits/sockaddr.h #usr/include/bits/socket-constants.h @@ -197,6 +184,7 @@ usr/bin/locale #usr/include/bits/struct_mutex.h #usr/include/bits/struct_rwlock.h #usr/include/bits/struct_stat.h +#usr/include/bits/struct_stat_time64_helper.h #usr/include/bits/syscall.h #usr/include/bits/syslog-ldbl.h #usr/include/bits/syslog-path.h @@ -245,11 +233,17 @@ usr/bin/locale #usr/include/bits/types/struct___jmp_buf_tag.h #usr/include/bits/types/struct_iovec.h #usr/include/bits/types/struct_itimerspec.h +#usr/include/bits/types/struct_msqid64_ds.h +#usr/include/bits/types/struct_msqid64_ds_helper.h #usr/include/bits/types/struct_msqid_ds.h #usr/include/bits/types/struct_osockaddr.h #usr/include/bits/types/struct_rusage.h #usr/include/bits/types/struct_sched_param.h +#usr/include/bits/types/struct_semid64_ds.h +#usr/include/bits/types/struct_semid64_ds_helper.h #usr/include/bits/types/struct_semid_ds.h +#usr/include/bits/types/struct_shmid64_ds.h +#usr/include/bits/types/struct_shmid64_ds_helper.h #usr/include/bits/types/struct_shmid_ds.h #usr/include/bits/types/struct_sigstack.h #usr/include/bits/types/struct_statx.h @@ -292,6 +286,7 @@ usr/bin/locale #usr/include/error.h #usr/include/execinfo.h #usr/include/fcntl.h +#usr/include/features-time64.h #usr/include/features.h #usr/include/fenv.h #usr/include/finclude @@ -774,6 +769,8 @@ usr/lib/gconv #usr/lib/gconv/UTF-7.so #usr/lib/gconv/VISCII.so #usr/lib/gconv/gconv-modules +#usr/lib/gconv/gconv-modules.d +#usr/lib/gconv/gconv-modules.d/gconv-modules-extra.conf #usr/lib/gconv/libCNS.so #usr/lib/gconv/libGB.so #usr/lib/gconv/libISOIR165.so @@ -795,27 +792,22 @@ usr/lib/gconv #usr/lib/libanl.so #usr/lib/libc.a #usr/lib/libc.so +#usr/lib/libc_malloc_debug.so #usr/lib/libc_nonshared.a #usr/lib/libdl.a -#usr/lib/libdl.so #usr/lib/libg.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a #usr/lib/libnss_compat.so #usr/lib/libnss_db.so -#usr/lib/libnss_dns.so -#usr/lib/libnss_files.so #usr/lib/libnss_hesiod.so #usr/lib/libpthread.a -#usr/lib/libpthread.so #usr/lib/libresolv.a #usr/lib/libresolv.so #usr/lib/librt.a -#usr/lib/librt.so #usr/lib/libthread_db.so #usr/lib/libutil.a -#usr/lib/libutil.so usr/lib/locale #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 @@ -8374,7 +8366,5 @@ usr/lib/locale #usr/share/locale/zh_TW #usr/share/locale/zh_TW/LC_MESSAGES #usr/share/locale/zh_TW/LC_MESSAGES/libc.mo -#var/cache/ldconfig -#var/cache/ldconfig/aux-cache #var/db #var/db/Makefile diff --git a/config/rootfiles/common/x86_64/glibc b/config/rootfiles/common/x86_64/glibc index 74f7e38fd..40bd175f4 100644 --- a/config/rootfiles/common/x86_64/glibc +++ b/config/rootfiles/common/x86_64/glibc @@ -1,43 +1,26 @@ #etc/ld.so.cache etc/rpc -lib/ld-2.33.so lib/ld-linux-x86-64.so.2 -lib/libBrokenLocale-2.33.so lib/libBrokenLocale.so.1 #lib/libSegFault.so -lib/libanl-2.33.so lib/libanl.so.1 -lib/libc-2.33.so lib/libc.so.6 -lib/libdl-2.33.so +#lib/libc_malloc_debug.so.0 lib/libdl.so.2 -lib/libm-2.33.so lib/libm.so.6 #lib/libmemusage.so -lib/libmvec-2.33.so lib/libmvec.so.1 -lib/libnsl-2.33.so lib/libnsl.so.1 -lib/libnss_compat-2.33.so lib/libnss_compat.so.2 -lib/libnss_db-2.33.so lib/libnss_db.so.2 -lib/libnss_dns-2.33.so lib/libnss_dns.so.2 -lib/libnss_files-2.33.so lib/libnss_files.so.2 -lib/libnss_hesiod-2.33.so lib/libnss_hesiod.so.2 #lib/libpcprofile.so -lib/libpthread-2.33.so lib/libpthread.so.0 -lib/libresolv-2.33.so lib/libresolv.so.2 -lib/librt-2.33.so lib/librt.so.1 -lib/libthread_db-1.0.so lib/libthread_db.so.1 -lib/libutil-2.33.so lib/libutil.so.1 sbin/ldconfig #sbin/sln @@ -137,6 +120,8 @@ usr/bin/locale #usr/include/bits/msq.h #usr/include/bits/netdb.h #usr/include/bits/param.h +#usr/include/bits/platform +#usr/include/bits/platform/x86.h #usr/include/bits/poll.h #usr/include/bits/poll2.h #usr/include/bits/posix1_lim.h @@ -147,6 +132,8 @@ usr/bin/locale #usr/include/bits/procfs-id.h #usr/include/bits/procfs-prregset.h #usr/include/bits/procfs.h +#usr/include/bits/pthread_stack_min-dynamic.h +#usr/include/bits/pthread_stack_min.h #usr/include/bits/pthreadtypes-arch.h #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h @@ -171,6 +158,7 @@ usr/bin/locale #usr/include/bits/signum-arch.h #usr/include/bits/signum-generic.h #usr/include/bits/sigstack.h +#usr/include/bits/sigstksz.h #usr/include/bits/sigthread.h #usr/include/bits/sockaddr.h #usr/include/bits/socket-constants.h @@ -199,6 +187,7 @@ usr/bin/locale #usr/include/bits/struct_mutex.h #usr/include/bits/struct_rwlock.h #usr/include/bits/struct_stat.h +#usr/include/bits/struct_stat_time64_helper.h #usr/include/bits/syscall.h #usr/include/bits/syslog-ldbl.h #usr/include/bits/syslog-path.h @@ -247,11 +236,17 @@ usr/bin/locale #usr/include/bits/types/struct___jmp_buf_tag.h #usr/include/bits/types/struct_iovec.h #usr/include/bits/types/struct_itimerspec.h +#usr/include/bits/types/struct_msqid64_ds.h +#usr/include/bits/types/struct_msqid64_ds_helper.h #usr/include/bits/types/struct_msqid_ds.h #usr/include/bits/types/struct_osockaddr.h #usr/include/bits/types/struct_rusage.h #usr/include/bits/types/struct_sched_param.h +#usr/include/bits/types/struct_semid64_ds.h +#usr/include/bits/types/struct_semid64_ds_helper.h #usr/include/bits/types/struct_semid_ds.h +#usr/include/bits/types/struct_shmid64_ds.h +#usr/include/bits/types/struct_shmid64_ds_helper.h #usr/include/bits/types/struct_shmid_ds.h #usr/include/bits/types/struct_sigstack.h #usr/include/bits/types/struct_statx.h @@ -294,6 +289,7 @@ usr/bin/locale #usr/include/error.h #usr/include/execinfo.h #usr/include/fcntl.h +#usr/include/features-time64.h #usr/include/features.h #usr/include/fenv.h #usr/include/finclude @@ -783,6 +779,8 @@ usr/lib/gconv #usr/lib/gconv/UTF-7.so #usr/lib/gconv/VISCII.so #usr/lib/gconv/gconv-modules +#usr/lib/gconv/gconv-modules.d +#usr/lib/gconv/gconv-modules.d/gconv-modules-extra.conf #usr/lib/gconv/libCNS.so #usr/lib/gconv/libGB.so #usr/lib/gconv/libISOIR165.so @@ -801,11 +799,11 @@ usr/lib/gconv #usr/lib/libanl.so #usr/lib/libc.a #usr/lib/libc.so +#usr/lib/libc_malloc_debug.so #usr/lib/libc_nonshared.a #usr/lib/libdl.a -#usr/lib/libdl.so #usr/lib/libg.a -#usr/lib/libm-2.33.a +#usr/lib/libm-2.34.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a @@ -813,18 +811,13 @@ usr/lib/gconv #usr/lib/libmvec.so #usr/lib/libnss_compat.so #usr/lib/libnss_db.so -#usr/lib/libnss_dns.so -#usr/lib/libnss_files.so #usr/lib/libnss_hesiod.so #usr/lib/libpthread.a -#usr/lib/libpthread.so #usr/lib/libresolv.a #usr/lib/libresolv.so #usr/lib/librt.a -#usr/lib/librt.so #usr/lib/libthread_db.so #usr/lib/libutil.a -#usr/lib/libutil.so usr/lib/locale #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 diff --git a/lfs/glibc b/lfs/glibc index d2d3aff91..e7f2a71c5 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -24,7 +24,7 @@
include Config
-VER = 2.33 +VER = 2.34
THISAPP = glibc-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -73,7 +73,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 390bbd889c7e8e8a7041564cb6b27cca +$(DL_FILE)_MD5 = 31998b53fb39cb946e96abc310af1c89
install : $(TARGET)
@@ -105,10 +105,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) @mkdir $(DIR_SRC)/glibc-build
# Security Fixes
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
ifneq "$(TOOLCHAIN)" "1"
diff --git a/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch b/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch deleted file mode 100644 index d2083e6e2..000000000 --- a/src/patches/glibc-2.33-librt-fix-null-pointer-dereference-bug-28213.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 27a78fd712c06748737dfa9638fab96ea362fca9 Mon Sep 17 00:00:00 2001 -From: Nikita Popov npv1310@gmail.com -Date: Mon, 9 Aug 2021 20:17:34 +0530 -Subject: [PATCH] librt: fix NULL pointer dereference (bug 28213)
-Helper thread frees copied attribute on NOTIFY_REMOVED message -received from the OS kernel. Unfortunately, it fails to check whether -copied attribute actually exists (data.attr != NULL). This worked -earlier because free() checks passed pointer before actually -attempting to release corresponding memory. But -__pthread_attr_destroy assumes pointer is not NULL.
-So passing NULL pointer to __pthread_attr_destroy will result in -segmentation fault. This scenario is possible if -notification->sigev_notify_attributes == NULL (which means default -thread attributes should be used).
-Signed-off-by: Nikita Popov npv1310@gmail.com -Reviewed-by: Siddhesh Poyarekar siddhesh@sourceware.org
-(cherry picked from commit b805aebd42364fe696e417808a700fdb9800c9e8)
- sysdeps/unix/sysv/linux/mq_notify.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c -index 6f46d29d1d..1714e1cc5f 100644 ---- a/sysdeps/unix/sysv/linux/mq_notify.c -+++ b/sysdeps/unix/sysv/linux/mq_notify.c -@@ -132,7 +132,7 @@ helper_thread (void *arg)
to wait until it is done with it. */
(void) __pthread_barrier_wait (¬ify_barrier);
- }
-- else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED) -+ else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED && data.attr != NULL)
- {
/* The only state we keep is the copy of the thread attributes. */
pthread_attr_destroy (data.attr);
-2.20.1
diff --git a/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch b/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch deleted file mode 100644 index f846b37b8..000000000 --- a/src/patches/glibc-2.33-use-__pthread_attr_copy-in-mq_notify-bug-27896.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 4b6be914bd3920500a67ef6ca1aa7d1c37e5e859 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab schwab@linux-m68k.org -Date: Thu, 27 May 2021 12:49:47 +0200 -Subject: [PATCH] Use __pthread_attr_copy in mq_notify (bug 27896)
-Make a deep copy of the pthread attribute object to remove a potential -use-after-free issue.
-(cherry picked from commit 42d359350510506b87101cf77202fefcbfc790cb)
- NEWS | 6 ++++++
- sysdeps/unix/sysv/linux/mq_notify.c | 15 ++++++++++-----
- 2 files changed, 16 insertions(+), 5 deletions(-)
-diff --git a/NEWS b/NEWS -index 0c33a80af9..b9e570b4a4 100644 ---- a/NEWS -+++ b/NEWS -@@ -13,6 +13,12 @@ Major new features:
- a dump of information related to IFUNC resolver operation and
- glibc-hwcaps subdirectory selection.
-+Security related changes: -+ -+ CVE-2021-33574: The mq_notify function has a potential use-after-free -+ issue when using a notification type of SIGEV_THREAD and a thread -+ attribute with a non-default affinity mask. -+
- The following bugs are resolved with this release:
- [15271] dlfcn function failure after dlmopen terminates process
-diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c -index cc575a0cdd..f7ddfe5a6c 100644 ---- a/sysdeps/unix/sysv/linux/mq_notify.c -+++ b/sysdeps/unix/sysv/linux/mq_notify.c -@@ -133,8 +133,11 @@ helper_thread (void *arg)
(void) __pthread_barrier_wait (¬ify_barrier);
- }
else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
-- /* The only state we keep is the copy of the thread attributes. */ -- free (data.attr); -+ { -+ /* The only state we keep is the copy of the thread attributes. */ -+ pthread_attr_destroy (data.attr); -+ free (data.attr); -+ }
}
- return NULL;
- }
-@@ -255,8 +258,7 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
if (data.attr == NULL)
- return -1;
-- memcpy (data.attr, notification->sigev_notify_attributes, -- sizeof (pthread_attr_t)); -+ __pthread_attr_copy (data.attr, notification->sigev_notify_attributes);
}
- /* Construct the new request. */
-@@ -270,7 +272,10 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
- /* If it failed, free the allocated memory. */
- if (__glibc_unlikely (retval != 0))
-- free (data.attr); -+ { -+ pthread_attr_destroy (data.attr); -+ free (data.attr); -+ }
- return retval;
- }
-2.20.1
Enable Intel Control-flow Enforcement Technology (CET) support to protect the library with indirect branch tracking (IBT) and shadow stack (SHSTK).
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/glibc | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lfs/glibc b/lfs/glibc index e7f2a71c5..9c631de4c 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -65,6 +65,10 @@ EXTRA_CONFIG += \ --enable-bind-now \ --disable-crypt
+ifeq "$(BUILD_ARCH)" "x86_64" + EXTRA_CONFIG += --enable-cet +endif + ############################################################################### # Top-level Rules ###############################################################################
https://lwn.net/Articles/834289/
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/glibc | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lfs/glibc b/lfs/glibc index 9c631de4c..685e56e97 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -69,6 +69,10 @@ ifeq "$(BUILD_ARCH)" "x86_64" EXTRA_CONFIG += --enable-cet endif
+ifeq "$(BUILD_ARCH)" "aarch64" + EXTRA_CONFIG += --enable-memory-tagging +endif + ############################################################################### # Top-level Rules ###############################################################################
Binutils and GCC were misconfigured and used host libraries to build toolchain programs. That resulted in that those programs were correctly linked, but could not be executed, because the runtime linker did not search in the host system.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/binutils | 9 +++++---- lfs/gcc | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lfs/binutils b/lfs/binutils index d94be9a06..94e295cf9 100644 --- a/lfs/binutils +++ b/lfs/binutils @@ -59,7 +59,8 @@ ifeq "$(PASS)" "1" --target=$(CROSSTARGET) \ --prefix=$(TOOLS_DIR) \ --with-sysroot=$(ROOT) \ - --with-lib-path=$(TOOLS_DIR)/lib + --with-lib-path=$(TOOLS_DIR)/lib \ + --disable-nls EXTRA_MAKE = EXTRA_INSTALL = else @@ -69,10 +70,10 @@ else AR="$(CROSSTARGET)-ar" \ RANLIB="$(CROSSTARGET)-ranlib" EXTRA_CONFIG = \ - --host=$(BUILDTARGET) \ - --build=$(BUILDTARGET) \ --prefix=$(TOOLS_DIR) \ - --with-lib-path=$(TOOLS_DIR)/lib + --with-lib-path=$(TOOLS_DIR)/lib \ + --with-sysroot \ + --disable-nls EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/gcc b/lfs/gcc index 96e58ddae..6bb1d170a 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -83,8 +83,10 @@ ifeq "$(PASS)" "1" --with-sysroot=$(ROOT) \ --with-local-prefix=$(TOOLS_DIR) \ --with-native-system-header-dir=$(TOOLS_DIR)/include \ + --with-glibc-version=2.11 \ --disable-nls \ --disable-shared \ + --disable-multilib \ --disable-decimal-float \ --disable-threads \ --disable-libatomic \ @@ -114,13 +116,12 @@ ifeq "$(PASS)" "2" AR="$(CROSSTARGET)-ar" \ RANLIB="$(CROSSTARGET)-ranlib" EXTRA_CONFIG = \ - --build=$(BUILDTARGET) \ --prefix=$(TOOLS_DIR) \ - --with-sysroot=$(ROOT) \ --with-local-prefix=$(TOOLS_DIR) \ --with-native-system-header-dir=$(TOOLS_DIR)/include \ --enable-languages=c,c++ \ --disable-libstdcxx-pch \ + --disable-multilib \ --disable-libgomp EXTRA_MAKE = EXTRA_INSTALL =
zstd requires libatomic on riscv64 which isn't available, yet
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make.sh b/make.sh index 79798834a..5930699f0 100755 --- a/make.sh +++ b/make.sh @@ -1026,9 +1026,9 @@ buildtoolchain() { lfsmake1 libxcrypt lfsmake1 gcc PASS=L lfsmake1 zlib - lfsmake1 zstd lfsmake1 binutils PASS=2 lfsmake1 gcc PASS=2 + lfsmake1 zstd lfsmake1 ccache lfsmake1 tcl lfsmake1 expect
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/texinfo | 1 + .../texinfo-6.8-undo-gnulib-nonnul.patch | 186 ++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 src/patches/texinfo-6.8-undo-gnulib-nonnul.patch
diff --git a/lfs/texinfo b/lfs/texinfo index 4563243f0..27a3d06b6 100644 --- a/lfs/texinfo +++ b/lfs/texinfo @@ -77,6 +77,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/texinfo-6.8-undo-gnulib-nonnul.patch cd $(DIR_APP) && ./configure --prefix=$(PREFIX) --disable-nls cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install diff --git a/src/patches/texinfo-6.8-undo-gnulib-nonnul.patch b/src/patches/texinfo-6.8-undo-gnulib-nonnul.patch new file mode 100644 index 000000000..60f2e63b7 --- /dev/null +++ b/src/patches/texinfo-6.8-undo-gnulib-nonnul.patch @@ -0,0 +1,186 @@ + +Patch by Vitezslav Crhonek vcrhonek@redhat.com +Source: https://src.fedoraproject.org/rpms/texinfo/c/9b2cca4817fa4bd8d520fed05e9560f... + +diff -up texinfo-6.8/gnulib/lib/cdefs.h.orig texinfo-6.8/gnulib/lib/cdefs.h +--- texinfo-6.8/gnulib/lib/cdefs.h.orig 2021-03-11 19:57:53.000000000 +0100 ++++ texinfo-6.8/gnulib/lib/cdefs.h 2021-07-19 12:26:46.985176475 +0200 +@@ -321,15 +321,15 @@ + + /* The nonnull function attribute marks pointer parameters that + must not be NULL. */ +-#ifndef __attribute_nonnull__ ++#ifndef __nonnull + # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) +-# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params)) ++# define __nonnull(params) __attribute__ ((__nonnull__ params)) + # else +-# define __attribute_nonnull__(params) ++# define __nonnull(params) + # endif +-#endif +-#ifndef __nonnull +-# define __nonnull(params) __attribute_nonnull__ (params) ++#elif !defined __GLIBC__ ++# undef __nonnull ++# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params) + #endif + + /* If fortification mode, we warn about unused results of certain +diff -up texinfo-6.8/gnulib/lib/libc-config.h.orig texinfo-6.8/gnulib/lib/libc-config.h +--- texinfo-6.8/gnulib/lib/libc-config.h.orig 2021-03-11 19:57:54.000000000 +0100 ++++ texinfo-6.8/gnulib/lib/libc-config.h 2021-07-19 12:27:58.810590975 +0200 +@@ -33,9 +33,9 @@ + #include <config.h> + + /* On glibc this includes <features.h> and <sys/cdefs.h> and #defines +- _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and +- DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull. +- Elsewhere it is harmless. */ ++ _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it ++ includes <sys/cdefs.h> which defines __nonnull. Elsewhere it ++ is harmless. */ + #include <errno.h> + + /* From glibc <errno.h>. */ +diff -up texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c.orig texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c +--- texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c.orig 2021-03-11 19:57:54.000000000 +0100 ++++ texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c 2021-07-19 12:24:46.878419397 +0200 +@@ -192,7 +192,7 @@ DYNARRAY_NAME (free__array__) (struct DY + + /* Initialize a dynamic array object. This must be called before any + use of the object. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static void + DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list) + { +@@ -202,7 +202,7 @@ DYNARRAY_NAME (init) (struct DYNARRAY_ST + } + + /* Deallocate the dynamic array and its elements. */ +-__attribute_maybe_unused__ __attribute_nonnull__ ((1)) ++__attribute_maybe_unused__ __nonnull ((1)) + static void + DYNARRAY_FREE (struct DYNARRAY_STRUCT *list) + { +@@ -213,7 +213,7 @@ DYNARRAY_FREE (struct DYNARRAY_STRUCT *l + } + + /* Return true if the dynamic array is in an error state. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static inline bool + DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list) + { +@@ -222,7 +222,7 @@ DYNARRAY_NAME (has_failed) (const struct + + /* Mark the dynamic array as failed. All elements are deallocated as + a side effect. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static void + DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list) + { +@@ -236,7 +236,7 @@ DYNARRAY_NAME (mark_failed) (struct DYNA + + /* Return the number of elements which have been added to the dynamic + array. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static inline size_t + DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list) + { +@@ -245,7 +245,7 @@ DYNARRAY_NAME (size) (const struct DYNAR + + /* Return a pointer to the array element at INDEX. Terminate the + process if INDEX is out of bounds. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static inline DYNARRAY_ELEMENT * + DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index) + { +@@ -257,7 +257,7 @@ DYNARRAY_NAME (at) (struct DYNARRAY_STRU + /* Return a pointer to the first array element, if any. For a + zero-length array, the pointer can be NULL even though the dynamic + array has not entered the failure state. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static inline DYNARRAY_ELEMENT * + DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list) + { +@@ -267,7 +267,7 @@ DYNARRAY_NAME (begin) (struct DYNARRAY_S + /* Return a pointer one element past the last array element. For a + zero-length array, the pointer can be NULL even though the dynamic + array has not entered the failure state. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static inline DYNARRAY_ELEMENT * + DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list) + { +@@ -294,7 +294,7 @@ DYNARRAY_NAME (add__) (struct DYNARRAY_S + /* Add ITEM at the end of the array, enlarging it by one element. + Mark *LIST as failed if the dynamic array allocation size cannot be + increased. */ +-__attribute_nonnull__ ((1)) ++__nonnull ((1)) + static inline void + DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item) + { +@@ -348,8 +348,7 @@ DYNARRAY_NAME (emplace__) (struct DYNARR + /* Allocate a place for a new element in *LIST and return a pointer to + it. The pointer can be NULL if the dynamic array cannot be + enlarged due to a memory allocation failure. */ +-__attribute_maybe_unused__ __attribute_warn_unused_result__ +-__attribute_nonnull__ ((1)) ++__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1)) + static + /* Avoid inlining with the larger initialization code. */ + #if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE)) +@@ -373,7 +372,7 @@ DYNARRAY_NAME (emplace) (struct DYNARRAY + existing size, new elements are added (which can be initialized). + Otherwise, the list is truncated, and elements are freed. Return + false on memory allocation failure (and mark *LIST as failed). */ +-__attribute_maybe_unused__ __attribute_nonnull__ ((1)) ++__attribute_maybe_unused__ __nonnull ((1)) + static bool + DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size) + { +@@ -418,7 +417,7 @@ DYNARRAY_NAME (resize) (struct DYNARRAY_ + } + + /* Remove the last element of LIST if it is present. */ +-__attribute_maybe_unused__ __attribute_nonnull__ ((1)) ++__attribute_maybe_unused__ __nonnull ((1)) + static void + DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list) + { +@@ -435,7 +434,7 @@ DYNARRAY_NAME (remove_last) (struct DYNA + + /* Remove all elements from the list. The elements are freed, but the + list itself is not. */ +-__attribute_maybe_unused__ __attribute_nonnull__ ((1)) ++__attribute_maybe_unused__ __nonnull ((1)) + static void + DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list) + { +@@ -453,8 +452,7 @@ DYNARRAY_NAME (clear) (struct DYNARRAY_S + stored in *RESULT if LIST refers to an empty list. On success, the + pointer in *RESULT is heap-allocated and must be deallocated using + free. */ +-__attribute_maybe_unused__ __attribute_warn_unused_result__ +-__attribute_nonnull__ ((1, 2)) ++__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1, 2)) + static bool + DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, + DYNARRAY_FINAL_TYPE *result) +@@ -485,8 +483,7 @@ DYNARRAY_NAME (finalize) (struct DYNARRA + have a sentinel at the end). If LENGTHP is not NULL, the array + length is written to *LENGTHP. *LIST is re-initialized and can be + reused. */ +-__attribute_maybe_unused__ __attribute_warn_unused_result__ +-__attribute_nonnull__ ((1)) ++__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1)) + static DYNARRAY_ELEMENT * + DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp) + {
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/ntp | 1 + ...tp-4.2.8p15-build-fix-for-glibc-2.34.patch | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/patches/ntp-4.2.8p15-build-fix-for-glibc-2.34.patch
diff --git a/lfs/ntp b/lfs/ntp index ca46e5163..e039d7bdd 100644 --- a/lfs/ntp +++ b/lfs/ntp @@ -70,6 +70,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ntp-4.2.8p15-build-fix-for-glibc-2.34.patch $(UPDATE_AUTOMAKE) cd $(DIR_APP) && \ ./configure \ diff --git a/src/patches/ntp-4.2.8p15-build-fix-for-glibc-2.34.patch b/src/patches/ntp-4.2.8p15-build-fix-for-glibc-2.34.patch new file mode 100644 index 000000000..442fe7828 --- /dev/null +++ b/src/patches/ntp-4.2.8p15-build-fix-for-glibc-2.34.patch @@ -0,0 +1,29 @@ +From 082a504cfcc046c3d8adaae1164268bc94e5108a Mon Sep 17 00:00:00 2001 +From: Khem Raj raj.khem@gmail.com +Date: Sat, 31 Jul 2021 10:51:41 -0700 +Subject: [PATCH] libntp: Do not use PTHREAD_STACK_MIN on glibc +In glibc 2.34+ PTHREAD_STACK_MIN is not a compile-time constant which +could mean different stack sizes at runtime on different architectures +and it also causes compile failure. Default glibc thread stack size +or 64Kb set by ntp should be good in glibc these days. +Upstream-Status: Pending +Signed-off-by: Khem Raj raj.khem@gmail.com +--- + libntp/work_thread.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/libntp/work_thread.c b/libntp/work_thread.c +index 03a5647..3ddd751 100644 +--- a/libntp/work_thread.c ++++ b/libntp/work_thread.c +@@ -41,7 +41,7 @@ + #ifndef THREAD_MINSTACKSIZE + # define THREAD_MINSTACKSIZE (64U * 1024) + #endif +-#ifndef __sun ++#if !defined(__sun) && !defined(__GLIBC__) + #if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN + # undef THREAD_MINSTACKSIZE + # define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN +-- +2.32.0 +
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/postfix | 1 + .../postfix-3.6.2-glibc-234-build-fix.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/patches/postfix-3.6.2-glibc-234-build-fix.patch
diff --git a/lfs/postfix b/lfs/postfix index 6fe46d9a8..0dcccadb6 100644 --- a/lfs/postfix +++ b/lfs/postfix @@ -99,6 +99,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/postfix-3.6.2-glibc-234-build-fix.patch cd $(DIR_APP) && make -f Makefile.init makefiles \ DEBUG="" OPT="$(CFLAGS) -fno-strict-aliasing" CCARGS="$(CCARGS)" AUXLIBS="$(AUXLIBS)" cd $(DIR_APP) && make $(MAKETUNING) diff --git a/src/patches/postfix-3.6.2-glibc-234-build-fix.patch b/src/patches/postfix-3.6.2-glibc-234-build-fix.patch new file mode 100644 index 000000000..b678b78b6 --- /dev/null +++ b/src/patches/postfix-3.6.2-glibc-234-build-fix.patch @@ -0,0 +1,14 @@ +diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h +index 99bec9b..95c78ec 100644 +--- a/src/util/sys_defs.h ++++ b/src/util/sys_defs.h +@@ -802,6 +803,9 @@ extern int initgroups(const char *, int); + #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" + #endif + #endif ++#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 34) ++#define HAS_CLOSEFROM ++#endif + #include <linux/version.h> + #if !defined(KERNEL_VERSION) + #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
This is now bundled in nfs-utils.
This patch needs a rootfile update for nfs
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- config/rootfiles/packages/libnfsidmap | 15 ----- lfs/libnfsidmap | 88 --------------------------- lfs/nfs | 4 +- make.sh | 1 - 4 files changed, 2 insertions(+), 106 deletions(-) delete mode 100644 config/rootfiles/packages/libnfsidmap delete mode 100644 lfs/libnfsidmap
diff --git a/config/rootfiles/packages/libnfsidmap b/config/rootfiles/packages/libnfsidmap deleted file mode 100644 index 0c9d3ab12..000000000 --- a/config/rootfiles/packages/libnfsidmap +++ /dev/null @@ -1,15 +0,0 @@ -#usr/include/nfsidmap.h -#usr/lib/libnfsidmap -#usr/lib/libnfsidmap.la -#usr/lib/libnfsidmap.so -usr/lib/libnfsidmap.so.0 -usr/lib/libnfsidmap.so.0.3.0 -#usr/lib/libnfsidmap/nsswitch.la -usr/lib/libnfsidmap/nsswitch.so -#usr/lib/libnfsidmap/static.la -usr/lib/libnfsidmap/static.so -#usr/lib/libnfsidmap/umich_ldap.la -usr/lib/libnfsidmap/umich_ldap.so -#usr/lib/pkgconfig/libnfsidmap.pc -#usr/share/man/man3/nfs4_uid_to_name.3 -#usr/share/man/man5/idmapd.conf.5 diff --git a/lfs/libnfsidmap b/lfs/libnfsidmap deleted file mode 100644 index 1980d9306..000000000 --- a/lfs/libnfsidmap +++ /dev/null @@ -1,88 +0,0 @@ -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team info@ipfire.org # -# # -# 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 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# 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/. # -# # -############################################################################### - -############################################################################### -# Definitions -############################################################################### - -include Config - -VER = 0.27 - -THISAPP = libnfsidmap-$(VER) -DL_FILE = $(THISAPP).tar.bz2 -DL_FROM = $(URL_IPFIRE) -DIR_APP = $(DIR_SRC)/$(THISAPP) -TARGET = $(DIR_INFO)/$(THISAPP) -PROG = libnfsidmap -PAK_VER = 2 - -#CFLAGS += -I/usr/include/tirpc - -############################################################################### -# Top-level Rules -############################################################################### - -objects = $(DL_FILE) - -$(DL_FILE) = $(DL_FROM)/$(DL_FILE) - -$(DL_FILE)_MD5 = 27cfb22f1ee85e51b863b71858a97da0 - -install : $(TARGET) - -check : $(patsubst %,$(DIR_CHK)/%,$(objects)) - -download :$(patsubst %,$(DIR_DL)/%,$(objects)) - -md5 : $(subst %,%_MD5,$(objects)) - -dist: - @$(PAK) - -############################################################################### -# Downloading, checking, md5sum -############################################################################### - -$(patsubst %,$(DIR_CHK)/%,$(objects)) : - @$(CHECK) - -$(patsubst %,$(DIR_DL)/%,$(objects)) : - @$(LOAD) - -$(subst %,%_MD5,$(objects)) : - @$(MD5) - -############################################################################### -# Installation Details -############################################################################### - -$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) - @$(PREBUILD) - @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - $(UPDATE_AUTOMAKE) - cd $(DIR_APP) && ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --disable-static - cd $(DIR_APP) && make $(MAKETUNING) - cd $(DIR_APP) && make install - @rm -rf $(DIR_APP) - @$(POSTBUILD) diff --git a/lfs/nfs b/lfs/nfs index 55accfb28..702f7116f 100644 --- a/lfs/nfs +++ b/lfs/nfs @@ -32,9 +32,9 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = nfs -PAK_VER = 15 +PAK_VER = 16
-DEPS = libnfsidmap rpcbind +DEPS = rpcbind
############################################################################### # Top-level Rules diff --git a/make.sh b/make.sh index 5930699f0..d9240a008 100755 --- a/make.sh +++ b/make.sh @@ -1496,7 +1496,6 @@ buildipfire() { lfsmake2 rsync lfsmake2 rpcbind lfsmake2 keyutils - lfsmake2 libnfsidmap lfsmake2 nfs lfsmake2 gnu-netcat lfsmake2 ncat
Reviewed-by: Adolf Belka adolf.belka@ipfire.org
On 04/02/2022 17:47, Michael Tremer wrote:
This is now bundled in nfs-utils.
This patch needs a rootfile update for nfs
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
config/rootfiles/packages/libnfsidmap | 15 ----- lfs/libnfsidmap | 88 --------------------------- lfs/nfs | 4 +- make.sh | 1 - 4 files changed, 2 insertions(+), 106 deletions(-) delete mode 100644 config/rootfiles/packages/libnfsidmap delete mode 100644 lfs/libnfsidmap
diff --git a/config/rootfiles/packages/libnfsidmap b/config/rootfiles/packages/libnfsidmap deleted file mode 100644 index 0c9d3ab12..000000000 --- a/config/rootfiles/packages/libnfsidmap +++ /dev/null @@ -1,15 +0,0 @@ -#usr/include/nfsidmap.h -#usr/lib/libnfsidmap -#usr/lib/libnfsidmap.la -#usr/lib/libnfsidmap.so -usr/lib/libnfsidmap.so.0 -usr/lib/libnfsidmap.so.0.3.0 -#usr/lib/libnfsidmap/nsswitch.la -usr/lib/libnfsidmap/nsswitch.so -#usr/lib/libnfsidmap/static.la -usr/lib/libnfsidmap/static.so -#usr/lib/libnfsidmap/umich_ldap.la -usr/lib/libnfsidmap/umich_ldap.so -#usr/lib/pkgconfig/libnfsidmap.pc -#usr/share/man/man3/nfs4_uid_to_name.3 -#usr/share/man/man5/idmapd.conf.5 diff --git a/lfs/libnfsidmap b/lfs/libnfsidmap deleted file mode 100644 index 1980d9306..000000000 --- a/lfs/libnfsidmap +++ /dev/null @@ -1,88 +0,0 @@ -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team info@ipfire.org # -# # -# 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 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# 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/. # -# # -###############################################################################
-############################################################################### -# Definitions -###############################################################################
-include Config
-VER = 0.27
-THISAPP = libnfsidmap-$(VER) -DL_FILE = $(THISAPP).tar.bz2 -DL_FROM = $(URL_IPFIRE) -DIR_APP = $(DIR_SRC)/$(THISAPP) -TARGET = $(DIR_INFO)/$(THISAPP) -PROG = libnfsidmap -PAK_VER = 2
-#CFLAGS += -I/usr/include/tirpc
-############################################################################### -# Top-level Rules -###############################################################################
-objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 27cfb22f1ee85e51b863b71858a97da0
-install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-dist:
- @$(PAK)
-############################################################################### -# Downloading, checking, md5sum -###############################################################################
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-$(patsubst %,$(DIR_DL)/%,$(objects)) :
- @$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-############################################################################### -# Installation Details -###############################################################################
-$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
- @$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
- $(UPDATE_AUTOMAKE)
- cd $(DIR_APP) && ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--disable-static
- cd $(DIR_APP) && make $(MAKETUNING)
- cd $(DIR_APP) && make install
- @rm -rf $(DIR_APP)
- @$(POSTBUILD)
diff --git a/lfs/nfs b/lfs/nfs index 55accfb28..702f7116f 100644 --- a/lfs/nfs +++ b/lfs/nfs @@ -32,9 +32,9 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = nfs -PAK_VER = 15 +PAK_VER = 16
-DEPS = libnfsidmap rpcbind +DEPS = rpcbind
############################################################################### # Top-level Rules diff --git a/make.sh b/make.sh index 5930699f0..d9240a008 100755 --- a/make.sh +++ b/make.sh @@ -1496,7 +1496,6 @@ buildipfire() { lfsmake2 rsync lfsmake2 rpcbind lfsmake2 keyutils
- lfsmake2 libnfsidmap lfsmake2 nfs lfsmake2 gnu-netcat lfsmake2 ncat
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- config/rootfiles/common/aarch64/binutils | 5 ++--- config/rootfiles/common/armv6l/binutils | 5 ++--- config/rootfiles/common/x86_64/binutils | 5 ++--- lfs/binutils | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/config/rootfiles/common/aarch64/binutils b/config/rootfiles/common/aarch64/binutils index b6099c3f7..cae233bce 100644 --- a/config/rootfiles/common/aarch64/binutils +++ b/config/rootfiles/common/aarch64/binutils @@ -16,7 +16,6 @@ usr/bin/strings #usr/bin/strip #usr/include/ansidecl.h #usr/include/bfd.h -#usr/include/bfd_stdint.h #usr/include/bfdlink.h #usr/include/ctf-api.h #usr/include/ctf.h @@ -292,7 +291,7 @@ usr/lib/bfd-plugins/libdep.so #usr/lib/ldscripts/armelfb_linux_eabi.xu #usr/lib/ldscripts/armelfb_linux_eabi.xw #usr/lib/ldscripts/armelfb_linux_eabi.xwe -usr/lib/libbfd-2.36.1.so +usr/lib/libbfd-2.37.so #usr/lib/libbfd.a #usr/lib/libbfd.la #usr/lib/libbfd.so @@ -306,7 +305,7 @@ usr/lib/libctf-nobfd.so.0.0.0 #usr/lib/libctf.so usr/lib/libctf.so.0 usr/lib/libctf.so.0.0.0 -usr/lib/libopcodes-2.36.1.so +usr/lib/libopcodes-2.37.so #usr/lib/libopcodes.a #usr/lib/libopcodes.la #usr/lib/libopcodes.so diff --git a/config/rootfiles/common/armv6l/binutils b/config/rootfiles/common/armv6l/binutils index 06f33f27a..773315212 100644 --- a/config/rootfiles/common/armv6l/binutils +++ b/config/rootfiles/common/armv6l/binutils @@ -16,7 +16,6 @@ usr/bin/strings #usr/bin/strip #usr/include/ansidecl.h #usr/include/bfd.h -#usr/include/bfd_stdint.h #usr/include/bfdlink.h #usr/include/ctf-api.h #usr/include/ctf.h @@ -72,7 +71,7 @@ usr/lib/bfd-plugins/libdep.so #usr/lib/ldscripts/armelfb_linux_eabi.xu #usr/lib/ldscripts/armelfb_linux_eabi.xw #usr/lib/ldscripts/armelfb_linux_eabi.xwe -usr/lib/libbfd-2.36.1.so +usr/lib/libbfd-2.37.so #usr/lib/libbfd.a #usr/lib/libbfd.la #usr/lib/libbfd.so @@ -86,7 +85,7 @@ usr/lib/libctf-nobfd.so.0.0.0 #usr/lib/libctf.so usr/lib/libctf.so.0 usr/lib/libctf.so.0.0.0 -usr/lib/libopcodes-2.36.1.so +usr/lib/libopcodes-2.37.so #usr/lib/libopcodes.a #usr/lib/libopcodes.la #usr/lib/libopcodes.so diff --git a/config/rootfiles/common/x86_64/binutils b/config/rootfiles/common/x86_64/binutils index 227841c64..1b3427425 100644 --- a/config/rootfiles/common/x86_64/binutils +++ b/config/rootfiles/common/x86_64/binutils @@ -16,7 +16,6 @@ usr/bin/strings #usr/bin/strip #usr/include/ansidecl.h #usr/include/bfd.h -#usr/include/bfd_stdint.h #usr/include/bfdlink.h #usr/include/ctf-api.h #usr/include/ctf.h @@ -160,7 +159,7 @@ usr/bin/strings #usr/lib/ldscripts/elf_x86_64.xu #usr/lib/ldscripts/elf_x86_64.xw #usr/lib/ldscripts/elf_x86_64.xwe -usr/lib/libbfd-2.36.1.so +usr/lib/libbfd-2.37.so #usr/lib/libbfd.a #usr/lib/libbfd.la #usr/lib/libbfd.so @@ -174,7 +173,7 @@ usr/lib/libctf-nobfd.so.0.0.0 #usr/lib/libctf.so usr/lib/libctf.so.0 usr/lib/libctf.so.0.0.0 -usr/lib/libopcodes-2.36.1.so +usr/lib/libopcodes-2.37.so #usr/lib/libopcodes.a #usr/lib/libopcodes.la #usr/lib/libopcodes.so diff --git a/lfs/binutils b/lfs/binutils index 94e295cf9..d05d3c2c5 100644 --- a/lfs/binutils +++ b/lfs/binutils @@ -24,7 +24,7 @@
include Config
-VER = 2.36.1 +VER = 2.37
THISAPP = binutils-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -97,7 +97,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 628d490d976d8957279bbbff06cf29d4 +$(DL_FILE)_MD5 = e78d9ff2976b745a348f4c1f27c77cb1
install : $(TARGET)
Reviewed-by: Adolf Belka adolf.belka@ipfire.org
On 04/02/2022 17:47, Michael Tremer wrote:
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
config/rootfiles/common/aarch64/binutils | 5 ++--- config/rootfiles/common/armv6l/binutils | 5 ++--- config/rootfiles/common/x86_64/binutils | 5 ++--- lfs/binutils | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/config/rootfiles/common/aarch64/binutils b/config/rootfiles/common/aarch64/binutils index b6099c3f7..cae233bce 100644 --- a/config/rootfiles/common/aarch64/binutils +++ b/config/rootfiles/common/aarch64/binutils @@ -16,7 +16,6 @@ usr/bin/strings #usr/bin/strip #usr/include/ansidecl.h #usr/include/bfd.h -#usr/include/bfd_stdint.h #usr/include/bfdlink.h #usr/include/ctf-api.h #usr/include/ctf.h @@ -292,7 +291,7 @@ usr/lib/bfd-plugins/libdep.so #usr/lib/ldscripts/armelfb_linux_eabi.xu #usr/lib/ldscripts/armelfb_linux_eabi.xw #usr/lib/ldscripts/armelfb_linux_eabi.xwe -usr/lib/libbfd-2.36.1.so +usr/lib/libbfd-2.37.so #usr/lib/libbfd.a #usr/lib/libbfd.la #usr/lib/libbfd.so @@ -306,7 +305,7 @@ usr/lib/libctf-nobfd.so.0.0.0 #usr/lib/libctf.so usr/lib/libctf.so.0 usr/lib/libctf.so.0.0.0 -usr/lib/libopcodes-2.36.1.so +usr/lib/libopcodes-2.37.so #usr/lib/libopcodes.a #usr/lib/libopcodes.la #usr/lib/libopcodes.so diff --git a/config/rootfiles/common/armv6l/binutils b/config/rootfiles/common/armv6l/binutils index 06f33f27a..773315212 100644 --- a/config/rootfiles/common/armv6l/binutils +++ b/config/rootfiles/common/armv6l/binutils @@ -16,7 +16,6 @@ usr/bin/strings #usr/bin/strip #usr/include/ansidecl.h #usr/include/bfd.h -#usr/include/bfd_stdint.h #usr/include/bfdlink.h #usr/include/ctf-api.h #usr/include/ctf.h @@ -72,7 +71,7 @@ usr/lib/bfd-plugins/libdep.so #usr/lib/ldscripts/armelfb_linux_eabi.xu #usr/lib/ldscripts/armelfb_linux_eabi.xw #usr/lib/ldscripts/armelfb_linux_eabi.xwe -usr/lib/libbfd-2.36.1.so +usr/lib/libbfd-2.37.so #usr/lib/libbfd.a #usr/lib/libbfd.la #usr/lib/libbfd.so @@ -86,7 +85,7 @@ usr/lib/libctf-nobfd.so.0.0.0 #usr/lib/libctf.so usr/lib/libctf.so.0 usr/lib/libctf.so.0.0.0 -usr/lib/libopcodes-2.36.1.so +usr/lib/libopcodes-2.37.so #usr/lib/libopcodes.a #usr/lib/libopcodes.la #usr/lib/libopcodes.so diff --git a/config/rootfiles/common/x86_64/binutils b/config/rootfiles/common/x86_64/binutils index 227841c64..1b3427425 100644 --- a/config/rootfiles/common/x86_64/binutils +++ b/config/rootfiles/common/x86_64/binutils @@ -16,7 +16,6 @@ usr/bin/strings #usr/bin/strip #usr/include/ansidecl.h #usr/include/bfd.h -#usr/include/bfd_stdint.h #usr/include/bfdlink.h #usr/include/ctf-api.h #usr/include/ctf.h @@ -160,7 +159,7 @@ usr/bin/strings #usr/lib/ldscripts/elf_x86_64.xu #usr/lib/ldscripts/elf_x86_64.xw #usr/lib/ldscripts/elf_x86_64.xwe -usr/lib/libbfd-2.36.1.so +usr/lib/libbfd-2.37.so #usr/lib/libbfd.a #usr/lib/libbfd.la #usr/lib/libbfd.so @@ -174,7 +173,7 @@ usr/lib/libctf-nobfd.so.0.0.0 #usr/lib/libctf.so usr/lib/libctf.so.0 usr/lib/libctf.so.0.0.0 -usr/lib/libopcodes-2.36.1.so +usr/lib/libopcodes-2.37.so #usr/lib/libopcodes.a #usr/lib/libopcodes.la #usr/lib/libopcodes.so diff --git a/lfs/binutils b/lfs/binutils index 94e295cf9..d05d3c2c5 100644 --- a/lfs/binutils +++ b/lfs/binutils @@ -24,7 +24,7 @@
include Config
-VER = 2.36.1 +VER = 2.37
THISAPP = binutils-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -97,7 +97,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 628d490d976d8957279bbbff06cf29d4 +$(DL_FILE)_MD5 = e78d9ff2976b745a348f4c1f27c77cb1
install : $(TARGET)
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/make.sh b/make.sh index d9240a008..dfa1bafde 100755 --- a/make.sh +++ b/make.sh @@ -145,35 +145,35 @@ configure_build() {
case "${build_arch}" in x86_64) - BUILDTARGET="${build_arch}-unknown-linux-gnu" + BUILDTARGET="${build_arch}-pc-linux-gnu" CROSSTARGET="${build_arch}-cross-linux-gnu" BUILD_PLATFORM="x86" CFLAGS_ARCH="-m64 -mtune=generic -fstack-clash-protection -fcf-protection" ;;
aarch64) - BUILDTARGET="${build_arch}-unknown-linux-gnu" + BUILDTARGET="${build_arch}-pc-linux-gnu" CROSSTARGET="${build_arch}-cross-linux-gnu" BUILD_PLATFORM="arm" CFLAGS_ARCH="-fstack-clash-protection" ;;
armv7hl) - BUILDTARGET="${build_arch}-unknown-linux-gnueabi" + BUILDTARGET="${build_arch}-pc-linux-gnueabi" CROSSTARGET="${build_arch}-cross-linux-gnueabi" BUILD_PLATFORM="arm" CFLAGS_ARCH="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" ;;
armv6l) - BUILDTARGET="${build_arch}-unknown-linux-gnueabi" + BUILDTARGET="${build_arch}-pc-linux-gnueabi" CROSSTARGET="${build_arch}-cross-linux-gnueabi" BUILD_PLATFORM="arm" CFLAGS_ARCH="-march=armv6zk+fp -mfpu=vfp -mfloat-abi=softfp -fomit-frame-pointer" ;;
riscv64) - BUILDTARGET="${build_arch}-unknown-linux-gnu" + BUILDTARGET="${build_arch}-pc-linux-gnu" CROSSTARGET="${build_arch}-cross-linux-gnu" BUILD_PLATFORM="riscv" CFLAGS_ARCH="-fstack-clash-protection"
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make.sh b/make.sh index dfa1bafde..57e185312 100755 --- a/make.sh +++ b/make.sh @@ -38,7 +38,7 @@ GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # Git Branch GIT_TAG="$(git tag | tail -1)" # Git Tag GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)" # Last commit
-TOOLCHAINVER=20210701 +TOOLCHAINVER=20210805
# use multicore and max compression ZSTD_OPT="-T0 --ultra -22"
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/flash-images | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lfs/flash-images b/lfs/flash-images index 0abb23b0a..2cc81c37b 100644 --- a/lfs/flash-images +++ b/lfs/flash-images @@ -78,9 +78,9 @@ else endif
# /boot: 128MB - OFFSET -# / : 1600 MB +# / : 1800 MB S_BOOT := $(shell echo $$(( 262144 - $(S_OFFSET) ))) -S_ROOT := 3354038 +S_ROOT := 3773292
ifeq "$(EFI)" "1" S_EFI = 65536 # 32 MB
This will fix cross-compiling the toolchain which I broke before.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/binutils | 2 ++ lfs/gcc | 2 ++ 2 files changed, 4 insertions(+)
diff --git a/lfs/binutils b/lfs/binutils index d05d3c2c5..33555fa23 100644 --- a/lfs/binutils +++ b/lfs/binutils @@ -70,6 +70,8 @@ else AR="$(CROSSTARGET)-ar" \ RANLIB="$(CROSSTARGET)-ranlib" EXTRA_CONFIG = \ + --build=$(BUILDTARGET) \ + --host=$(BUILDTARGET) \ --prefix=$(TOOLS_DIR) \ --with-lib-path=$(TOOLS_DIR)/lib \ --with-sysroot \ diff --git a/lfs/gcc b/lfs/gcc index 6bb1d170a..f9502562d 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -116,6 +116,8 @@ ifeq "$(PASS)" "2" AR="$(CROSSTARGET)-ar" \ RANLIB="$(CROSSTARGET)-ranlib" EXTRA_CONFIG = \ + --build=$(BUILDTARGET) \ + --host=$(BUILDTARGET) \ --prefix=$(TOOLS_DIR) \ --with-local-prefix=$(TOOLS_DIR) \ --with-native-system-header-dir=$(TOOLS_DIR)/include \
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/hyperscan | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lfs/hyperscan b/lfs/hyperscan index f55e91606..ead1bc344 100644 --- a/lfs/hyperscan +++ b/lfs/hyperscan @@ -80,7 +80,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && cmake . \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DBUILD_SHARED_LIBS:BOOL=ON \ - -DBUILD_STATIC_AND_SHARED:BOOL=OFF + -DBUILD_STATIC_AND_SHARED:BOOL=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_EXAMPLES=OFF cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install @rm -rf $(DIR_APP)
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/pciutils | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lfs/pciutils b/lfs/pciutils index 995c3c0a4..2dcf9e868 100644 --- a/lfs/pciutils +++ b/lfs/pciutils @@ -80,11 +80,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Install headers. mkdir -pv /usr/include/pci - cd $(DIR_APP) && install -p lib/pci.h /usr/include/pci - cd $(DIR_APP) && install -p lib/header.h /usr/include/pci - cd $(DIR_APP) && install -p lib/config.h /usr/include/pci - cd $(DIR_APP) && install -p lib/types.h /usr/include/pci - cd $(DIR_APP) && install -p lib/libpci.pc /usr/lib/pkgconfig + cd $(DIR_APP) && install -m 644 lib/pci.h /usr/include/pci + cd $(DIR_APP) && install -m 644 lib/header.h /usr/include/pci + cd $(DIR_APP) && install -m 644 lib/config.h /usr/include/pci + cd $(DIR_APP) && install -m 644 lib/types.h /usr/include/pci + cd $(DIR_APP) && install -m 644 lib/libpci.pc /usr/lib/pkgconfig chmod -v 755 /usr/lib/libpci.so @rm -rf $(DIR_APP) @$(POSTBUILD)
Reviewed-by: Adolf Belka adolf.belka@ipfire.org
On 04/02/2022 17:47, Michael Tremer wrote:
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
lfs/pciutils | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lfs/pciutils b/lfs/pciutils index 995c3c0a4..2dcf9e868 100644 --- a/lfs/pciutils +++ b/lfs/pciutils @@ -80,11 +80,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
# Install headers. mkdir -pv /usr/include/pci
- cd $(DIR_APP) && install -p lib/pci.h /usr/include/pci
- cd $(DIR_APP) && install -p lib/header.h /usr/include/pci
- cd $(DIR_APP) && install -p lib/config.h /usr/include/pci
- cd $(DIR_APP) && install -p lib/types.h /usr/include/pci
- cd $(DIR_APP) && install -p lib/libpci.pc /usr/lib/pkgconfig
- cd $(DIR_APP) && install -m 644 lib/pci.h /usr/include/pci
- cd $(DIR_APP) && install -m 644 lib/header.h /usr/include/pci
- cd $(DIR_APP) && install -m 644 lib/config.h /usr/include/pci
- cd $(DIR_APP) && install -m 644 lib/types.h /usr/include/pci
- cd $(DIR_APP) && install -m 644 lib/libpci.pc /usr/lib/pkgconfig chmod -v 755 /usr/lib/libpci.so @rm -rf $(DIR_APP) @$(POSTBUILD)
This should *actually* exclude everything we want to exclude and *actually* strip everything to the maximum.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/strip | 21 +++++----------- make.sh | 9 +++++-- src/stripper | 71 ++++++++++++++++++++++++++-------------------------- 3 files changed, 48 insertions(+), 53 deletions(-)
diff --git a/lfs/strip b/lfs/strip index 48e698a7c..466dfd9d5 100644 --- a/lfs/strip +++ b/lfs/strip @@ -29,16 +29,6 @@ VER = ipfire THISAPP = strip TARGET = $(DIR_INFO)/$(THISAPP)
-ifeq "$(TOOLCHAIN)" "1" - SHELL = /bin/bash - STRIP = /usr/bin/strip - ROOT = $(TOOLS_DIR) -else - SHELL = $(TOOLS_DIR)/bin/bash - STRIP = $(TOOLS_DIR)/bin/strip - ROOT = / -endif - ############################################################################### # Top-level Rules ############################################################################### @@ -56,18 +46,19 @@ md5 : ###############################################################################
$(TARGET) : +ifeq "$(TOOLCHAIN)" "1" + # Strip everything in the toolchain + $(DIR_SRC)/src/stripper $(TOOLS_DIR) +else # Don't strip VDR binaries, because they use a weird plugin system # which does not work when unneeded symbols get stripped from # /usr/sbin/vdr. - STRIP=$(STRIP) $(SHELL) $(DIR_SRC)/src/stripper \ - $(ROOT) \ + $(DIR_SRC)/src/stripper / \ --exclude=$(TOOLS_DIR) \ - --exclude=/dev \ - --exclude=/proc \ - --exclude=/sys \ --exclude=/tmp \ --exclude=/usr/src \ --exclude=/usr/lib/vdr \ --exclude=/usr/sbin/vdr \ --exclude=/var/tmp \ --exclude=/usr/lib/go +endif diff --git a/make.sh b/make.sh index 57e185312..356173065 100755 --- a/make.sh +++ b/make.sh @@ -556,6 +556,11 @@ enterchroot() {
local PATH="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/bin"
+ # Prepend any custom changes to PATH + if [ -n "${CUSTOM_PATH}" ]; then + PATH="${CUSTOM_PATH}:${PATH}" + fi + PATH="${PATH}" chroot ${LFS} env -i \ HOME="/root" \ TERM="${TERM}" \ @@ -695,7 +700,7 @@ lfsmake2() { local PS1='\u:\w$ '
enterchroot \ - ${EXTRA_PATH}bash -x -c "cd /usr/src/lfs && \ + bash -x -c "cd /usr/src/lfs && \ make -f $* \ LFS_BASEDIR=/usr/src install" \ >> ${LOGFILE} 2>&1 & @@ -1693,7 +1698,7 @@ buildinstaller() { lfsmake2 memtest lfsmake2 installer # use toolchain bash for chroot to strip - EXTRA_PATH=${TOOLS_DIR}/bin/ lfsmake2 strip + CUSTOM_PATH="${TOOLS_DIR}/bin" lfsmake2 strip }
buildpackages() { diff --git a/src/stripper b/src/stripper index 6f449bb39..d1739b28c 100755 --- a/src/stripper +++ b/src/stripper @@ -1,49 +1,58 @@ #!/usr/bin/env bash
-dirs="" -excludes="/dev /proc /sys /run" +paths=() +excludes=()
while [ $# -gt 0 ]; do case "${1}" in --exclude=*) - excludes="${excludes} ${1#*=}" + excludes+=( "!" "-path" "${1#*=}/*" ) ;; *) - dirs="${dirs} ${1}" + paths+=( "${1}" ) ;; esac shift done
function _strip() { - local file=${1} - local strip="${STRIP-strip}" + local file="${1}" + local args=()
- local exclude l - for exclude in ${excludes}; do - l=${#exclude} - if [ "${file:0:${l}}" = "${exclude}" ]; then - return 0 - fi - done + # Fetch the filetype + local type="$(readelf -h "${file}" 2>/dev/null)"
- # Fetch any capabilities - local capabilities="$(getfattr --no-dereference --name="security.capability" \ - --absolute-names --dump "${file}" 2>/dev/null)" + case "${type}" in + # Libraries and Relocatable binaries + *Type:*"DYN (Shared object file)"*) + args+=( "--strip-all" ) + ;;
- local cmd=( "${strip}" ) + # Binaries + *Type:*"EXEC (Executable file)"*) + args+=( "--strip-all" ) + ;;
- case "$(file -bi ${file})" in - application/x-archive*) - cmd+=( "--strip-debug" "--remove-section=.comment" "--remove-section=.note" ) + # Static libraries + *Type:*"REL (Relocatable file)"*) + args+=( "--strip-debug" "--remove-section=.comment" "--remove-section=.note" ) ;; + + # Skip any unrecognised files *) - cmd+=( "--strip-all" ) + return 0 ;; esac
+ # Fetch any capabilities + local capabilities="$(getfattr --no-dereference --name="security.capability" \ + --absolute-names --dump "${file}" 2>/dev/null)" + echo "Stripping ${file}..." - ${cmd[*]} ${file} + if ! strip "${args[@]}" "${file}"; then + return 1 + fi +
# Restore capabilities if [ -n "${capabilities}" ]; then @@ -51,18 +60,8 @@ function _strip() { fi }
-for dir in ${dirs}; do - # Strip shared objects. - find ${dir} -type f ( -perm -0100 -or -perm -0010 -or -perm -0001 ) \ - | file -N -f - | sed -n -e 's/^(.*):[ ]*.*ELF.*, not stripped.*/\1/p' | - while read file; do - _strip ${file} || exit $? - done || exit $? - - # Strip static archives. - find ${dir} -name *.a -a -exec file {} ; \ - | grep 'current ar archive' | sed -n -e 's/^(.*):[ ]*current ar archive/\1/p' | - while read file; do - _strip ${file} || exit $? - done || exit $? +for path in ${paths[@]}; do + for file in $(find / -xdev "${excludes[@]}" -type f ( -perm -0100 -or -perm -0010 -or -perm -0001 ) 2>/dev/null); do + _strip "${file}" || exit $? + done done
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/make.sh b/make.sh index 356173065..f3a1aeb5e 100755 --- a/make.sh +++ b/make.sh @@ -554,7 +554,7 @@ enterchroot() { # Install QEMU helper, if needed qemu_install_helper
- local PATH="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/bin" + local PATH="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin"
# Prepend any custom changes to PATH if [ -n "${CUSTOM_PATH}" ]; then @@ -664,7 +664,7 @@ lfsmake1() { [ $? == 1 ] && return 0
cd $BASEDIR/lfs && env -i \ - PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/bin:$PATH" \ + PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}" \ CCACHE_DIR="${CCACHE_DIR}"/${BUILD_ARCH}/${TOOLCHAINVER} \ CCACHE_TEMPDIR="${CCACHE_TEMPDIR}" \ CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/expect | 1 + 1 file changed, 1 insertion(+)
diff --git a/lfs/expect b/lfs/expect index ac4752be9..c5b8bee10 100644 --- a/lfs/expect +++ b/lfs/expect @@ -70,6 +70,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) $(DIR_SRC)/tcl* && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + $(UPDATE_AUTOMAKE) cd $(DIR_APP) && ./configure \ --prefix=$(TOOLS_DIR) \ --build=$(BUILDTARGET) \
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make.sh b/make.sh index f3a1aeb5e..cd7464917 100755 --- a/make.sh +++ b/make.sh @@ -38,7 +38,7 @@ GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # Git Branch GIT_TAG="$(git tag | tail -1)" # Git Tag GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)" # Last commit
-TOOLCHAINVER=20210805 +TOOLCHAINVER=20220128
# use multicore and max compression ZSTD_OPT="-T0 --ultra -22"
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/stripper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/stripper b/src/stripper index d1739b28c..8689b34de 100755 --- a/src/stripper +++ b/src/stripper @@ -61,7 +61,7 @@ function _strip() { }
for path in ${paths[@]}; do - for file in $(find / -xdev "${excludes[@]}" -type f ( -perm -0100 -or -perm -0010 -or -perm -0001 ) 2>/dev/null); do + for file in $(find "${path}" -xdev "${excludes[@]}" -type f ( -perm -0100 -or -perm -0010 -or -perm -0001 ) 2>/dev/null); do _strip "${file}" || exit $? done done
This is required so that we use the host's tools to perform the stripping.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/make.sh b/make.sh index cd7464917..f59624665 100755 --- a/make.sh +++ b/make.sh @@ -663,8 +663,12 @@ lfsmake1() { lfsmakecommoncheck $* [ $? == 1 ] && return 0
+ if [ -n "${CUSTOM_PATH}" ]; then + local PATH="${CUSTOM_PATH}:${PATH}" + fi + cd $BASEDIR/lfs && env -i \ - PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}" \ + PATH="${PATH}" \ CCACHE_DIR="${CCACHE_DIR}"/${BUILD_ARCH}/${TOOLCHAINVER} \ CCACHE_TEMPDIR="${CCACHE_TEMPDIR}" \ CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \ @@ -1062,7 +1066,7 @@ buildtoolchain() { lfsmake1 bison lfsmake1 flex lfsmake1 fake-environ - lfsmake1 strip + CUSTOM_PATH="${PATH}" lfsmake1 strip lfsmake1 cleanup-toolchain }
We did not use any of the tools that we were building which made the build fail when cross-building on a different architecture.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/make.sh b/make.sh index f59624665..3c7bc1011 100755 --- a/make.sh +++ b/make.sh @@ -663,8 +663,11 @@ lfsmake1() { lfsmakecommoncheck $* [ $? == 1 ] && return 0
+ # Set PATH to use the toolchain tools first and then whatever the host has set + local PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}" + if [ -n "${CUSTOM_PATH}" ]; then - local PATH="${CUSTOM_PATH}:${PATH}" + PATH="${CUSTOM_PATH}:${PATH}" fi
cd $BASEDIR/lfs && env -i \
This is required because some packages do not recommend building with time_t when it is 32 bit (Y2038 problem).
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/Config | 5 +++++ lfs/coreutils | 5 ----- lfs/gzip | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 3e4de3b3f..1209c1603 100644 --- a/lfs/Config +++ b/lfs/Config @@ -84,6 +84,11 @@ else PREFIX = /usr endif
+# Permit building with 32 bit time_t on 32 bit architectures +ifeq "$(IS_32BIT)" "1" + export TIME_T_32_BIT_OK = yes +endif + TAR_OPTIONS = \ --format=pax \ --acls \ diff --git a/lfs/coreutils b/lfs/coreutils index b64ac7a06..d272fd06a 100644 --- a/lfs/coreutils +++ b/lfs/coreutils @@ -50,11 +50,6 @@ CONFIGURE_OPTIONS += \
CFLAGS += -fno-strict-aliasing
-# Build with 32 bit time_t on 32 bit architectures -ifeq "$(IS_32BIT)" "1" - export TIME_T_32_BIT_OK=yes -endif - ############################################################################### # Top-level Rules ############################################################################### diff --git a/lfs/gzip b/lfs/gzip index 4f8925cd2..4f0853de0 100644 --- a/lfs/gzip +++ b/lfs/gzip @@ -41,11 +41,6 @@ else EXTRA_CONFIG = --prefix=$(TOOLS_DIR) endif
-# Build with 32 bit time_t on 32 bit architectures -ifeq "$(IS_32BIT)" "1" - export TIME_T_32_BIT_OK=yes -endif - ############################################################################### # Top-level Rules ###############################################################################
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/stripper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/stripper b/src/stripper index 8689b34de..fa624815b 100755 --- a/src/stripper +++ b/src/stripper @@ -61,7 +61,7 @@ function _strip() { }
for path in ${paths[@]}; do - for file in $(find "${path}" -xdev "${excludes[@]}" -type f ( -perm -0100 -or -perm -0010 -or -perm -0001 ) 2>/dev/null); do + for file in $(find -H "${path}" -xdev "${excludes[@]}" -type f ( -perm -0100 -or -perm -0010 -or -perm -0001 ) 2>/dev/null); do _strip "${file}" || exit $? done done
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- config/rootfiles/common/aarch64/glibc | 27 +++++++++++++++++++++-- config/rootfiles/common/armv6l/glibc | 25 +++++++++++++++++++-- config/rootfiles/common/x86_64/glibc | 31 ++++++++++++++++++++++----- lfs/glibc | 8 +++---- 4 files changed, 77 insertions(+), 14 deletions(-)
diff --git a/config/rootfiles/common/aarch64/glibc b/config/rootfiles/common/aarch64/glibc index 634f1686e..f98c94aab 100644 --- a/config/rootfiles/common/aarch64/glibc +++ b/config/rootfiles/common/aarch64/glibc @@ -2,7 +2,6 @@ etc/rpc lib/ld-linux-aarch64.so.1 lib/libBrokenLocale.so.1 -#lib/libSegFault.so lib/libanl.so.1 lib/libc.so.6 #lib/libc_malloc_debug.so.0 @@ -23,11 +22,11 @@ lib/libthread_db.so.1 lib/libutil.so.1 sbin/ldconfig #sbin/sln -#usr/bin/catchsegv #usr/bin/gencat usr/bin/getconf usr/bin/getent #usr/bin/iconv +usr/bin/ld.so usr/bin/ldd usr/bin/locale #usr/bin/localedef @@ -58,12 +57,14 @@ usr/bin/locale #usr/include/bits #usr/include/bits/a.out.h #usr/include/bits/argp-ldbl.h +#usr/include/bits/atomic_wide_counter.h #usr/include/bits/byteswap.h #usr/include/bits/cmathcalls.h #usr/include/bits/confname.h #usr/include/bits/cpu-set.h #usr/include/bits/dirent.h #usr/include/bits/dirent_ext.h +#usr/include/bits/dl_find_object.h #usr/include/bits/dlfcn.h #usr/include/bits/elfclass.h #usr/include/bits/endian.h @@ -101,6 +102,7 @@ usr/bin/locale #usr/include/bits/libc-header-start.h #usr/include/bits/libm-simd-decl-stubs.h #usr/include/bits/link.h +#usr/include/bits/link_lavcurrent.h #usr/include/bits/local_lim.h #usr/include/bits/locale.h #usr/include/bits/long-double.h @@ -135,6 +137,7 @@ usr/bin/locale #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h #usr/include/bits/resource.h +#usr/include/bits/rseq.h #usr/include/bits/sched.h #usr/include/bits/select.h #usr/include/bits/select2.h @@ -453,6 +456,7 @@ usr/bin/locale #usr/include/sys/raw.h #usr/include/sys/reboot.h #usr/include/sys/resource.h +#usr/include/sys/rseq.h #usr/include/sys/select.h #usr/include/sys/sem.h #usr/include/sys/sendfile.h @@ -784,6 +788,7 @@ usr/lib/gconv #usr/lib/glibc/getconf/POSIX_V6_LP64_OFF64 #usr/lib/glibc/getconf/POSIX_V7_LP64_OFF64 #usr/lib/glibc/getconf/XBS5_LP64_OFF64 +#usr/lib/grcrt1.o #usr/lib/libBrokenLocale.a #usr/lib/libBrokenLocale.so #usr/lib/libanl.a @@ -807,6 +812,20 @@ usr/lib/gconv #usr/lib/libthread_db.so #usr/lib/libutil.a usr/lib/locale +#usr/lib/locale/C.utf8 +#usr/lib/locale/C.utf8/LC_ADDRESS +#usr/lib/locale/C.utf8/LC_COLLATE +#usr/lib/locale/C.utf8/LC_CTYPE +#usr/lib/locale/C.utf8/LC_IDENTIFICATION +#usr/lib/locale/C.utf8/LC_MEASUREMENT +#usr/lib/locale/C.utf8/LC_MESSAGES +#usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#usr/lib/locale/C.utf8/LC_MONETARY +#usr/lib/locale/C.utf8/LC_NAME +#usr/lib/locale/C.utf8/LC_NUMERIC +#usr/lib/locale/C.utf8/LC_PAPER +#usr/lib/locale/C.utf8/LC_TELEPHONE +#usr/lib/locale/C.utf8/LC_TIME #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 #usr/lib/locale/aa_DJ.utf8/LC_ADDRESS @@ -7639,6 +7658,7 @@ usr/lib/locale #usr/lib/locale/zu_ZA/LC_PAPER #usr/lib/locale/zu_ZA/LC_TELEPHONE #usr/lib/locale/zu_ZA/LC_TIME +#usr/lib/rcrt1.o #usr/sbin/iconvconfig #usr/sbin/nscd #usr/sbin/zic @@ -7878,11 +7898,13 @@ usr/lib/locale #usr/share/i18n/charmaps/VISCII.gz #usr/share/i18n/charmaps/WINDOWS-31J.gz #usr/share/i18n/locales +#usr/share/i18n/locales/C #usr/share/i18n/locales/POSIX #usr/share/i18n/locales/aa_DJ #usr/share/i18n/locales/aa_ER #usr/share/i18n/locales/aa_ER@saaho #usr/share/i18n/locales/aa_ET +#usr/share/i18n/locales/ab_GE #usr/share/i18n/locales/af_ZA #usr/share/i18n/locales/agr_PE #usr/share/i18n/locales/ak_GH @@ -8244,6 +8266,7 @@ usr/lib/locale #usr/share/info/libc.info-15 #usr/share/info/libc.info-16 #usr/share/info/libc.info-17 +#usr/share/info/libc.info-18 #usr/share/info/libc.info-2 #usr/share/info/libc.info-3 #usr/share/info/libc.info-4 diff --git a/config/rootfiles/common/armv6l/glibc b/config/rootfiles/common/armv6l/glibc index 3348bc098..d6be0f39a 100644 --- a/config/rootfiles/common/armv6l/glibc +++ b/config/rootfiles/common/armv6l/glibc @@ -2,7 +2,6 @@ etc/rpc lib/ld-linux.so.3 lib/libBrokenLocale.so.1 -#lib/libSegFault.so lib/libanl.so.1 lib/libc.so.6 #lib/libc_malloc_debug.so.0 @@ -23,11 +22,11 @@ lib/libthread_db.so.1 lib/libutil.so.1 sbin/ldconfig #sbin/sln -#usr/bin/catchsegv #usr/bin/gencat usr/bin/getconf usr/bin/getent #usr/bin/iconv +usr/bin/ld.so usr/bin/ldd usr/bin/locale #usr/bin/localedef @@ -58,12 +57,14 @@ usr/bin/locale #usr/include/bits #usr/include/bits/a.out.h #usr/include/bits/argp-ldbl.h +#usr/include/bits/atomic_wide_counter.h #usr/include/bits/byteswap.h #usr/include/bits/cmathcalls.h #usr/include/bits/confname.h #usr/include/bits/cpu-set.h #usr/include/bits/dirent.h #usr/include/bits/dirent_ext.h +#usr/include/bits/dl_find_object.h #usr/include/bits/dlfcn.h #usr/include/bits/elfclass.h #usr/include/bits/endian.h @@ -101,6 +102,7 @@ usr/bin/locale #usr/include/bits/libc-header-start.h #usr/include/bits/libm-simd-decl-stubs.h #usr/include/bits/link.h +#usr/include/bits/link_lavcurrent.h #usr/include/bits/local_lim.h #usr/include/bits/locale.h #usr/include/bits/long-double.h @@ -135,6 +137,7 @@ usr/bin/locale #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h #usr/include/bits/resource.h +#usr/include/bits/rseq.h #usr/include/bits/sched.h #usr/include/bits/select.h #usr/include/bits/select2.h @@ -452,6 +455,7 @@ usr/bin/locale #usr/include/sys/raw.h #usr/include/sys/reboot.h #usr/include/sys/resource.h +#usr/include/sys/rseq.h #usr/include/sys/select.h #usr/include/sys/sem.h #usr/include/sys/sendfile.h @@ -809,6 +813,20 @@ usr/lib/gconv #usr/lib/libthread_db.so #usr/lib/libutil.a usr/lib/locale +#usr/lib/locale/C.utf8 +#usr/lib/locale/C.utf8/LC_ADDRESS +#usr/lib/locale/C.utf8/LC_COLLATE +#usr/lib/locale/C.utf8/LC_CTYPE +#usr/lib/locale/C.utf8/LC_IDENTIFICATION +#usr/lib/locale/C.utf8/LC_MEASUREMENT +#usr/lib/locale/C.utf8/LC_MESSAGES +#usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#usr/lib/locale/C.utf8/LC_MONETARY +#usr/lib/locale/C.utf8/LC_NAME +#usr/lib/locale/C.utf8/LC_NUMERIC +#usr/lib/locale/C.utf8/LC_PAPER +#usr/lib/locale/C.utf8/LC_TELEPHONE +#usr/lib/locale/C.utf8/LC_TIME #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 #usr/lib/locale/aa_DJ.utf8/LC_ADDRESS @@ -7880,11 +7898,13 @@ usr/lib/locale #usr/share/i18n/charmaps/VISCII.gz #usr/share/i18n/charmaps/WINDOWS-31J.gz #usr/share/i18n/locales +#usr/share/i18n/locales/C #usr/share/i18n/locales/POSIX #usr/share/i18n/locales/aa_DJ #usr/share/i18n/locales/aa_ER #usr/share/i18n/locales/aa_ER@saaho #usr/share/i18n/locales/aa_ET +#usr/share/i18n/locales/ab_GE #usr/share/i18n/locales/af_ZA #usr/share/i18n/locales/agr_PE #usr/share/i18n/locales/ak_GH @@ -8246,6 +8266,7 @@ usr/lib/locale #usr/share/info/libc.info-15 #usr/share/info/libc.info-16 #usr/share/info/libc.info-17 +#usr/share/info/libc.info-18 #usr/share/info/libc.info-2 #usr/share/info/libc.info-3 #usr/share/info/libc.info-4 diff --git a/config/rootfiles/common/x86_64/glibc b/config/rootfiles/common/x86_64/glibc index 40bd175f4..5014f8a88 100644 --- a/config/rootfiles/common/x86_64/glibc +++ b/config/rootfiles/common/x86_64/glibc @@ -2,7 +2,6 @@ etc/rpc lib/ld-linux-x86-64.so.2 lib/libBrokenLocale.so.1 -#lib/libSegFault.so lib/libanl.so.1 lib/libc.so.6 #lib/libc_malloc_debug.so.0 @@ -24,11 +23,11 @@ lib/libthread_db.so.1 lib/libutil.so.1 sbin/ldconfig #sbin/sln -#usr/bin/catchsegv #usr/bin/gencat usr/bin/getconf usr/bin/getent #usr/bin/iconv +usr/bin/ld.so usr/bin/ldd usr/bin/locale #usr/bin/localedef @@ -59,12 +58,14 @@ usr/bin/locale #usr/include/bits #usr/include/bits/a.out.h #usr/include/bits/argp-ldbl.h +#usr/include/bits/atomic_wide_counter.h #usr/include/bits/byteswap.h #usr/include/bits/cmathcalls.h #usr/include/bits/confname.h #usr/include/bits/cpu-set.h #usr/include/bits/dirent.h #usr/include/bits/dirent_ext.h +#usr/include/bits/dl_find_object.h #usr/include/bits/dlfcn.h #usr/include/bits/elfclass.h #usr/include/bits/endian.h @@ -102,6 +103,7 @@ usr/bin/locale #usr/include/bits/libc-header-start.h #usr/include/bits/libm-simd-decl-stubs.h #usr/include/bits/link.h +#usr/include/bits/link_lavcurrent.h #usr/include/bits/local_lim.h #usr/include/bits/locale.h #usr/include/bits/long-double.h @@ -138,6 +140,7 @@ usr/bin/locale #usr/include/bits/pthreadtypes.h #usr/include/bits/ptrace-shared.h #usr/include/bits/resource.h +#usr/include/bits/rseq.h #usr/include/bits/sched.h #usr/include/bits/select.h #usr/include/bits/select2.h @@ -461,6 +464,7 @@ usr/bin/locale #usr/include/sys/reboot.h #usr/include/sys/reg.h #usr/include/sys/resource.h +#usr/include/sys/rseq.h #usr/include/sys/select.h #usr/include/sys/sem.h #usr/include/sys/sendfile.h @@ -793,6 +797,7 @@ usr/lib/gconv #usr/lib/glibc/getconf/POSIX_V6_LP64_OFF64 #usr/lib/glibc/getconf/POSIX_V7_LP64_OFF64 #usr/lib/glibc/getconf/XBS5_LP64_OFF64 +#usr/lib/grcrt1.o #usr/lib/libBrokenLocale.a #usr/lib/libBrokenLocale.so #usr/lib/libanl.a @@ -803,7 +808,7 @@ usr/lib/gconv #usr/lib/libc_nonshared.a #usr/lib/libdl.a #usr/lib/libg.a -#usr/lib/libm-2.34.a +#usr/lib/libm-2.35.a #usr/lib/libm.a #usr/lib/libm.so #usr/lib/libmcheck.a @@ -819,6 +824,20 @@ usr/lib/gconv #usr/lib/libthread_db.so #usr/lib/libutil.a usr/lib/locale +#usr/lib/locale/C.utf8 +#usr/lib/locale/C.utf8/LC_ADDRESS +#usr/lib/locale/C.utf8/LC_COLLATE +#usr/lib/locale/C.utf8/LC_CTYPE +#usr/lib/locale/C.utf8/LC_IDENTIFICATION +#usr/lib/locale/C.utf8/LC_MEASUREMENT +#usr/lib/locale/C.utf8/LC_MESSAGES +#usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#usr/lib/locale/C.utf8/LC_MONETARY +#usr/lib/locale/C.utf8/LC_NAME +#usr/lib/locale/C.utf8/LC_NUMERIC +#usr/lib/locale/C.utf8/LC_PAPER +#usr/lib/locale/C.utf8/LC_TELEPHONE +#usr/lib/locale/C.utf8/LC_TIME #usr/lib/locale/aa_DJ #usr/lib/locale/aa_DJ.utf8 #usr/lib/locale/aa_DJ.utf8/LC_ADDRESS @@ -7651,6 +7670,7 @@ usr/lib/locale #usr/lib/locale/zu_ZA/LC_PAPER #usr/lib/locale/zu_ZA/LC_TELEPHONE #usr/lib/locale/zu_ZA/LC_TIME +#usr/lib/rcrt1.o #usr/sbin/iconvconfig #usr/sbin/nscd #usr/sbin/zic @@ -7890,11 +7910,13 @@ usr/lib/locale #usr/share/i18n/charmaps/VISCII.gz #usr/share/i18n/charmaps/WINDOWS-31J.gz #usr/share/i18n/locales +#usr/share/i18n/locales/C #usr/share/i18n/locales/POSIX #usr/share/i18n/locales/aa_DJ #usr/share/i18n/locales/aa_ER #usr/share/i18n/locales/aa_ER@saaho #usr/share/i18n/locales/aa_ET +#usr/share/i18n/locales/ab_GE #usr/share/i18n/locales/af_ZA #usr/share/i18n/locales/agr_PE #usr/share/i18n/locales/ak_GH @@ -8256,6 +8278,7 @@ usr/lib/locale #usr/share/info/libc.info-15 #usr/share/info/libc.info-16 #usr/share/info/libc.info-17 +#usr/share/info/libc.info-18 #usr/share/info/libc.info-2 #usr/share/info/libc.info-3 #usr/share/info/libc.info-4 @@ -8376,7 +8399,5 @@ usr/lib/locale #usr/share/locale/zh_TW #usr/share/locale/zh_TW/LC_MESSAGES #usr/share/locale/zh_TW/LC_MESSAGES/libc.mo -#var/cache/ldconfig -#var/cache/ldconfig/aux-cache #var/db #var/db/Makefile diff --git a/lfs/glibc b/lfs/glibc index 685e56e97..3a61613eb 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -24,7 +24,7 @@
include Config
-VER = 2.34 +VER = 2.35
THISAPP = glibc-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -46,9 +46,7 @@ else --host=$(CROSSTARGET) \ --build=$(BUILDTARGET) \ --prefix=$(TOOLS_DIR) \ - --with-headers=$(TOOLS_DIR)/include \ - libc_cv_forced_unwind=yes \ - libc_cv_c_cleanup=yes + --with-headers=$(TOOLS_DIR)/include endif
ifeq "$(BUILD_ARCH)" "aarch64" @@ -81,7 +79,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 31998b53fb39cb946e96abc310af1c89 +$(DL_FILE)_MD5 = dd571c67d85d89d7f60b854a4e207423
install : $(TARGET)
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make.sh b/make.sh index 3c7bc1011..d67f0af9d 100755 --- a/make.sh +++ b/make.sh @@ -38,7 +38,7 @@ GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # Git Branch GIT_TAG="$(git tag | tail -1)" # Git Tag GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)" # Last commit
-TOOLCHAINVER=20220128 +TOOLCHAINVER=20220203
# use multicore and max compression ZSTD_OPT="-T0 --ultra -22"
Hello Michael,
trying to compile the new toolchain on my workstation (running openSUSE Leap 15.3, kernel 5.3.18-150300.59.43-default, GCC 11 installed), gcc fails to build:
Checking for necessary space on disk [ DONE ] chroot: failed to run command 'env': No such file or directory Toolchain compilation (x86_64) stage1 [ DONE ] binutils (2.37) PASS=1[ 37 ][ DONE ] gcc (11.1.0) PASS=1[ 4:52 ][ FAIL ]
checking for sys/auxv.h... no checking for sys/mman.h... no checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... no checking whether decimal floating point is supported... no checking whether fixed-point is supported... no checking whether the compiler is configured for setjmp/longjmp exceptions... no checking for CET support... yes checking if the linker (/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build/./gcc/collect-ld) is GNU ld... yes checking for thread model used by GCC... single checking whether assembler supports CFI directives... yes checking for target glibc version... 2.11 2.11 checking for __attribute__((visibility("hidden")))... yes checking for .cfi_sections .debug_frame... yes checking whether the target assembler supports thread-local storage... yes checking whether the thread-local storage support is from emutls... no checking if the assembler supports AVX... yes checking for init priority support... yes configure: updating cache ./config.cache configure: creating ./config.status config.status: creating Makefile config.status: creating auto-target.h config.status: executing default commands /home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libgcc/../config-ml.in: line 133: enable_libstdc++_v3=no: command not found make[2]: Leaving directory '/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build' make[1]: *** [Makefile:947: all] Error 2 make[1]: Leaving directory '/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build' make: *** [gcc:251: /home/pmu/IPFire-development/ipfire-2.x/log/gcc-11.1.0-tools1] Error 2
ERROR: Building gcc PASS=1 [ FAIL ] Check /home/pmu/IPFire-development/ipfire-2.x/log/_build.toolchain.log for errors if applicable [ FAIL ]
In the logs, I also noticed this:
make[4]: Entering directory '/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build/libcc1' /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1 -I /home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/.. /include -I /home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/../libgcc -I ../gcc -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/../gcc -I/home/pmu/IPFire-developme nt/ipfire-2.x/build/usr/src/gcc-build/./gmp -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/gmp -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build/./mpfr/src -I/home/pmu/IPFire-dev elopment/ipfire-2.x/build/usr/src/gcc-11.1.0/mpfr/src -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/mpc/src -W -Wall -fvisibility=hidden -fcf-protection -O2 -pipe -Wall -fPIC -m64 -MT findcomp.lo -MD -MP - MF .deps/findcomp.Tpo -c -o findcomp.lo /home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/findcomp.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1 -I /home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/../include -I /home/fluke/deve l/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/../libgcc -I ../gcc -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/../gcc -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/g cc-build/./gmp -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/gmp -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build/./mpfr/src -I/home/pmu/IPFire-development/ipfire-2.x/build/usr /src/gcc-11.1.0/mpfr/src -I/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/mpc/src -W -Wall -fvisibility=hidden -fcf-protection -O2 -pipe -Wall -fPIC -m64 -MT findcomp.lo -MD -MP -MF .deps/findcomp.Tpo -c /home/fl uke/devel/IPFire-development/ipfire-2.x/build/usr/src/gcc-11.1.0/libcc1/findcomp.cc -fPIC -DPIC -o .libs/findcomp.o g++: error: unrecognized command line option '-fcf-protection'; did you mean '-fstack-protector'? make[4]: *** [Makefile:604: findcomp.lo] Error 1 make[4]: Leaving directory '/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build/libcc1' make[3]: *** [Makefile:441: all] Error 2 make[3]: Leaving directory '/home/pmu/IPFire-development/ipfire-2.x/build/usr/src/gcc-build/libcc1' make[2]: *** [Makefile:12396: all-libcc1] Error 2 make[2]: *** Waiting for unfinished jobs....
This leaves me a bit puzzled, as I thought "-fcf-protection" used to work before.
What am I doing wrong? :-)
Thanks, and best regards, Peter Müller
Hello Michael,
oh well. :-(
openSuSE Leap 15.3 ships GCC 7 by default, and while I installed GCC 11, stupid me forgot to change _another_ symlink which still pointed to the GCC 7 binary.
Please excuse the noise.
Thanks, and best regards, Peter Müller
Hello,
This is exactly why we are pre-building the toolchain. Not only to save time, but because it is quite fragile.
I built this for all architectures on Debian 11 and this worked fine. I am very surprised to say this, but Debian seems to be really up to date :)
I would totally recommend changing your distribution.
-Michael
On 6 Feb 2022, at 10:39, Peter Müller peter.mueller@ipfire.org wrote:
Hello Michael,
oh well. :-(
openSuSE Leap 15.3 ships GCC 7 by default, and while I installed GCC 11, stupid me forgot to change _another_ symlink which still pointed to the GCC 7 binary.
Please excuse the noise.
Thanks, and best regards, Peter Müller