From 527dbd1cbf05465d989cfad15bd3311afb9a8bda Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Tue, 13 Mar 2018 17:23:37 +0000 Subject: [PATCH] [glibc] Upgrade to version 2.27. News post: https://sourceware.org/ml/libc-announce/2018/msg00000.html Release notes: https://sourceware.org/glibc/wiki/Release/2.27 Of special note, was the following: ``` Changes to build and runtime requirements: * bison version 2.7 or later is required to generate code in the 'intl' subdirectory. ``` This change necessitated the addition of `core/bison` to the build dependencies and the rebuilding/freshening of the "stage1" tarball (so that it contains the bison software). Signed-off-by: Fletcher Nichol --- glibc/dont-use-system-ld-so.patch | 62 +++++++++++++++---------------- glibc/plan.sh | 31 +++++++++++++--- glibc/testsuite-fix.patch | 16 ++++---- 3 files changed, 65 insertions(+), 44 deletions(-) diff --git a/glibc/dont-use-system-ld-so.patch b/glibc/dont-use-system-ld-so.patch index f5f1b403a1..b38c2169e7 100644 --- a/glibc/dont-use-system-ld-so.patch +++ b/glibc/dont-use-system-ld-so.patch @@ -1,41 +1,41 @@ -diff -ru glibc-2.22-orig/elf/ldconfig.c glibc-2.22/elf/ldconfig.c ---- glibc-2.22-orig/elf/ldconfig.c 2015-12-12 02:05:44.630174539 +0000 -+++ glibc-2.22/elf/ldconfig.c 2015-12-12 02:42:45.537441848 +0000 -@@ -51,7 +51,7 @@ - #endif - - #ifndef LD_SO_CONF --# define LD_SO_CONF SYSCONFDIR "/ld.so.conf" -+# define LD_SO_CONF PREFIX "/etc/ld.so.conf" - #endif - - /* Get libc version number. */ -diff -ru glibc-2.22-orig/elf/Makefile glibc-2.22/elf/Makefile ---- glibc-2.22-orig/elf/Makefile 2015-12-12 02:05:44.626174409 +0000 -+++ glibc-2.22/elf/Makefile 2015-12-12 02:44:17.044734055 +0000 -@@ -443,13 +443,13 @@ +diff -ru glibc-2.27.orig/elf/Makefile glibc-2.27/elf/Makefile +--- glibc-2.27.orig/elf/Makefile 2018-03-10 00:45:56.360267338 +0000 ++++ glibc-2.27/elf/Makefile 2018-03-10 00:51:31.347282256 +0000 +@@ -559,13 +559,13 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) -SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' --CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ +-CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ +PREFIX-FLAGS := -D'PREFIX="$(prefix)"' -+CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \ ++CFLAGS-ldconfig.c += $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \ -D'SLIBDIR="$(slibdir)"' libof-ldconfig = ldconfig --CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) --CFLAGS-cache.c = $(SYSCONF-FLAGS) --CFLAGS-rtld.c = $(SYSCONF-FLAGS) -+CFLAGS-dl-cache.c = $(PREFIX-FLAGS) -+CFLAGS-cache.c = $(PREFIX-FLAGS) -+CFLAGS-rtld.c = $(PREFIX-FLAGS) +-CFLAGS-dl-cache.c += $(SYSCONF-FLAGS) +-CFLAGS-cache.c += $(SYSCONF-FLAGS) +-CFLAGS-rtld.c += $(SYSCONF-FLAGS) ++CFLAGS-dl-cache.c += $(PREFIX-FLAGS) ++CFLAGS-cache.c += $(PREFIX-FLAGS) ++CFLAGS-rtld.c += $(PREFIX-FLAGS) cpp-srcs-left := $(all-rtld-routines:=.os) lib := rtld -diff -ru glibc-2.22-orig/elf/rtld.c glibc-2.22/elf/rtld.c ---- glibc-2.22-orig/elf/rtld.c 2015-12-12 02:05:44.630174539 +0000 -+++ glibc-2.22/elf/rtld.c 2015-12-12 02:48:31.673870395 +0000 -@@ -1513,7 +1513,7 @@ +diff -ru glibc-2.27.orig/elf/ldconfig.c glibc-2.27/elf/ldconfig.c +--- glibc-2.27.orig/elf/ldconfig.c 2018-03-10 00:45:56.360267338 +0000 ++++ glibc-2.27/elf/ldconfig.c 2018-03-10 00:48:40.345813247 +0000 +@@ -51,7 +51,7 @@ + #endif + + #ifndef LD_SO_CONF +-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf" ++# define LD_SO_CONF PREFIX "/etc/ld.so.conf" + #endif + + /* Get libc version number. */ +diff -ru glibc-2.27.orig/elf/rtld.c glibc-2.27/elf/rtld.c +--- glibc-2.27.orig/elf/rtld.c 2018-03-10 00:45:56.364267278 +0000 ++++ glibc-2.27/elf/rtld.c 2018-03-10 00:52:35.054344944 +0000 +@@ -1625,7 +1625,7 @@ open(). So we do this first. If it succeeds we do almost twice the work but this does not matter, since it is not for production use. */ @@ -44,9 +44,9 @@ diff -ru glibc-2.22-orig/elf/rtld.c glibc-2.22/elf/rtld.c if (__glibc_unlikely (__access (preload_file, R_OK) == 0)) { /* Read the contents of the file. */ -diff -ru glibc-2.22-orig/sysdeps/generic/dl-cache.h glibc-2.22/sysdeps/generic/dl-cache.h ---- glibc-2.22-orig/sysdeps/generic/dl-cache.h 2015-12-12 02:05:44.846181518 +0000 -+++ glibc-2.22/sysdeps/generic/dl-cache.h 2015-12-12 02:45:08.982600296 +0000 +diff -ru glibc-2.27.orig/sysdeps/generic/dl-cache.h glibc-2.27/sysdeps/generic/dl-cache.h +--- glibc-2.27.orig/sysdeps/generic/dl-cache.h 2018-03-10 00:45:56.568264197 +0000 ++++ glibc-2.27/sysdeps/generic/dl-cache.h 2018-03-10 00:53:07.405869963 +0000 @@ -28,7 +28,7 @@ #endif diff --git a/glibc/plan.sh b/glibc/plan.sh index ebcd7c0068..62c63f060a 100644 --- a/glibc/plan.sh +++ b/glibc/plan.sh @@ -1,6 +1,6 @@ pkg_name=glibc pkg_origin=core -pkg_version=2.26 +pkg_version=2.27 pkg_maintainer="The Habitat Maintainers " pkg_description="\ The GNU C Library project provides the core libraries for the GNU system and \ @@ -13,12 +13,13 @@ dlopen, pthread_create, crypt, login, exit and more.\ pkg_upstream_url="https://www.gnu.org/software/libc" pkg_license=('GPL-2.0' 'LGPL-2.0') pkg_source="http://ftp.gnu.org/gnu/$pkg_name/${pkg_name}-${pkg_version}.tar.xz" -pkg_shasum="e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd" +pkg_shasum="5172de54318ec0b7f2735e5a91d908afe1c9ca291fec16b5374d9faadfc1fc72" pkg_deps=( core/linux-headers ) pkg_build_deps=( core/coreutils + core/bison core/diffutils core/patch core/make @@ -33,7 +34,16 @@ pkg_lib_dirs=(lib) do_prepare() { # The `/bin/pwd` path is hardcoded, so we'll add a symlink if needed. if [[ ! -r /bin/pwd ]]; then - ln -sv "$(pkg_path_for coreutils)/bin/pwd" /bin/pwd + # We can't use the `command -v pwd` trick here, as `pwd` is a shell + # builtin, and therefore returns the string of "pwd" (i.e. not the full + # path to the executable on `$PATH`). In a stage1 Studio, the coreutils + # package isn't built yet so we can't rely on using the `pkg_path_for` + # helper either. Sweet twist, no? + if [[ "$STUDIO_TYPE" = "stage1" ]]; then + ln -sv /tools/bin/pwd /bin/pwd + else + ln -sv "$(pkg_path_for coreutils)/bin/pwd" /bin/pwd + fi _clean_pwd=true fi @@ -142,14 +152,25 @@ do_check() { pushd ../${pkg_name}-build > /dev/null # One of the tests uses the hardcoded `bin/cat` path, so we'll add it, if # it doesn't exist. + # Checking for the binary on `$PATH` will work in both stage1 and default + # Studios. if [[ ! -r /bin/cat ]]; then - ln -sv "$(pkg_path_for coreutils)/bin/cat" /bin/cat + ln -sv "$(command -v cat)" /bin/cat _clean_cat=true fi # One of the tests uses the hardcoded `bin/echo` path, so we'll add it, if # it doesn't exist. if [[ ! -r /bin/echo ]]; then - ln -sv "$(pkg_path_for coreutils)/bin/echo" /bin/echo + # We can't use the `command -v echo` trick here, as `echo` is a shell + # builtin, and therefore returns the string of "echo" (i.e. not the full + # path to the executable on `$PATH`). In a stage1 Studio, the coreutils + # package isn't built yet so we can't rely on using the `pkg_path_for` + # helper either. Sweet twist, no? + if [[ "$STUDIO_TYPE" = "stage1" ]]; then + ln -sv /tools/bin/echo /bin/echo + else + ln -sv "$(pkg_path_for coreutils)/bin/echo" /bin/echo + fi _clean_echo=true fi diff --git a/glibc/testsuite-fix.patch b/glibc/testsuite-fix.patch index 0cb5868c2c..1a4c60d2ec 100644 --- a/glibc/testsuite-fix.patch +++ b/glibc/testsuite-fix.patch @@ -1,15 +1,15 @@ -diff -ru glibc-2.22.orig/stdio-common/Makefile glibc-2.22/stdio-common/Makefile ---- glibc-2.22.orig/stdio-common/Makefile 2015-08-05 06:42:21.000000000 +0000 -+++ glibc-2.22/stdio-common/Makefile 2015-12-17 04:51:00.303026327 +0000 -@@ -107,9 +107,9 @@ +diff -ru glibc-2.27.orig/stdio-common/Makefile glibc-2.27/stdio-common/Makefile +--- glibc-2.27.orig/stdio-common/Makefile 2018-03-10 00:45:56.544264559 +0000 ++++ glibc-2.27/stdio-common/Makefile 2018-03-10 00:57:15.122250501 +0000 +@@ -140,9 +140,9 @@ # GNU extension. The latter are needed, though, when internal headers # are used. So made sure we see the installed headers first. - CFLAGS-scanf15.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ + CFLAGS-scanf15.c += -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ - -I../wctype + -I../wctype -I$(common-objpfx)misc - CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ + CFLAGS-scanf17.c += -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ - -I../wctype + -I../wctype -I$(common-objpfx)misc - CPPFLAGS += $(libio-mtsafe) - + # tst-gets.c tests a deprecated function. + CFLAGS-tst-gets.c += -Wno-deprecated-declarations