Skip to content

Commit

Permalink
build: build using glibc 2.28 (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Jun 11, 2023
1 parent 25c431c commit 2bc1dc7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 108 deletions.
20 changes: 7 additions & 13 deletions contrib/devtools/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,26 @@
# - libgcc version 8.3.0 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libgcc1)
# - libc version 2.28 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libc6)
#
# Ubuntu 18.04 (Bionic) EOL: 2028. https://wiki.ubuntu.com/ReleaseTeam
# Ubuntu 20.04 (Focal) EOL: 2030. https://wiki.ubuntu.com/ReleaseTeam
#
# - libgcc version 8.4.0 (https://packages.ubuntu.com/bionic/libgcc1)
# - libc version 2.27 (https://packages.ubuntu.com/bionic/libc6)
# - libgcc version 10.3.0 (https://packages.ubuntu.com/focal/libgcc1)
# - libc version 2.31 (https://packages.ubuntu.com/focal/libc6)
#
# CentOS Stream 8 EOL: 2024. https://wiki.centos.org/About/Product
#
# - libgcc version 8.5.0 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
# - libc version 2.28 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
#
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html for more info.
#
# For 32-bit systems the minimum libc version is 2.28 to embrace new fcntl{64} symbols.
# It is safer than handling them in the glibc_compat.cpp due to their variadic arguments
# with possible different sizes.
# See: https://stackoverflow.com/a/58472959
#

MAX_VERSIONS = {
'GCC': (4,8,0),
'GLIBC': {
lief.ELF.ARCH.x86_64: (2,27),
lief.ELF.ARCH.x86_64: (2,28),
lief.ELF.ARCH.ARM: (2,28),
lief.ELF.ARCH.AARCH64:(2,27),
lief.ELF.ARCH.PPC64: (2,27),
lief.ELF.ARCH.RISCV: (2,27),
lief.ELF.ARCH.AARCH64:(2,28),
lief.ELF.ARCH.PPC64: (2,28),
lief.ELF.ARCH.RISCV: (2,28),
},
'LIBATOMIC': (1,0),
'V': (0,5,0), # xkb (bitcoin-qt only)
Expand Down
13 changes: 6 additions & 7 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ chain for " target " development."))
#:key
(base-gcc-for-libc base-gcc)
(base-kernel-headers base-linux-kernel-headers)
(base-libc (hardened-glibc (make-glibc-without-werror glibc-2.27)))
(base-libc (hardened-glibc (make-glibc-without-werror glibc-2.28)))
(base-gcc (make-gcc-rpath-link (hardened-gcc base-gcc))))
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
desirable for building Dash Core release binaries."
Expand Down Expand Up @@ -508,22 +508,21 @@ inspecting signatures in Mach-O binaries.")
"--enable-stack-protector" "all")
"--enable-bind-now" "yes"))

(define-public glibc-2.27
(define-public glibc-2.28
(package
(inherit glibc-2.31)
(version "2.27")
(version "2.28")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://sourceware.org/git/glibc.git")
(commit "73886db6218e613bd6d4edf529f11e008a6c2fa6")))
(file-name (git-file-name "glibc" "73886db6218e613bd6d4edf529f11e008a6c2fa6"))
(commit "c9e58ae23402eb82877de90fd8a18519c086ed87")))
(file-name (git-file-name "glibc" "c9e58ae23402eb82877de90fd8a18519c086ed87"))
(sha256
(base32
"0azpb9cvnbv25zg8019rqz48h8i2257ngyjg566dlnp74ivrs9vq"))
"0wm0if2n4z48kpn85va6yb4iac34crds2f55ddpz1hykx6jp1pb6"))
(patches (search-our-patches "glibc-ldd-x86_64.patch"
"glibc-versioned-locpath.patch"
"glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"
"glibc-2.27-fcommon.patch"
"glibc-2.27-guix-prefix.patch"))))))

Expand Down

This file was deleted.

21 changes: 11 additions & 10 deletions contrib/guix/patches/glibc-versioned-locpath.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ versions coexist on the system.

/* Use this when we come along an error. */
#define ERROR_RETURN \
@@ -48,7 +49,6 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
__locale_t result_ptr;
@@ -48,7 +49,6 @@ __newlocale (int category_mask, const char *locale, locale_t base)
locale_t result_ptr;
char *locale_path;
size_t locale_path_len;
- const char *locpath_var;
Expand Down Expand Up @@ -51,7 +51,7 @@ versions coexist on the system.
/* Get the names for the locales we are interested in. We either
allow a composite name or a single name. */
diff --git a/locale/setlocale.c b/locale/setlocale.c
index ead030d..0c0e314 100644
index e4de907e1f..47b6233fc5 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -215,12 +215,65 @@ setdata (int category, struct __locale_data *data)
Expand Down Expand Up @@ -121,7 +121,7 @@ index ead030d..0c0e314 100644
char *composite;

/* Sanity check for CATEGORY argument. */
@@ -251,17 +304,10 @@ setlocale (int category, const char *locale)
@@ -251,18 +304,11 @@ setlocale (int category, const char *locale)
locale_path = NULL;
locale_path_len = 0;

Expand All @@ -142,22 +142,23 @@ index ead030d..0c0e314 100644
}

if (category == LC_ALL)
{
diff --git a/string/Makefile b/string/Makefile
index 8424a61..f925503 100644
index aa2da9ca72..de752a1539 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -38,7 +38,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
@@ -40,7 +40,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
swab strfry memfrob memmem rawmemchr strchrnul \
$(addprefix argz-,append count create ctsep next \
delete extract insert stringify \
- addsep replace) \
+ addsep replace suffix) \
envz basename \
strcoll_l strxfrm_l string-inlines memrchr \
xpg-strerror strerror_l
xpg-strerror strerror_l explicit_bzero
diff --git a/string/argz-suffix.c b/string/argz-suffix.c
new file mode 100644
index 0000000..505b0f2
index 0000000000..505b0f248c
--- /dev/null
+++ b/string/argz-suffix.c
@@ -0,0 +1,56 @@
Expand Down Expand Up @@ -218,10 +219,10 @@ index 0000000..505b0f2
+}
+weak_alias (__argz_suffix_entries, argz_suffix_entries)
diff --git a/string/argz.h b/string/argz.h
index bb62a31..d276a35 100644
index 9c496f5ef5..1010a439d8 100644
--- a/string/argz.h
+++ b/string/argz.h
@@ -134,6 +134,16 @@ extern error_t argz_replace (char **__restrict __argz,
@@ -108,6 +108,16 @@ extern error_t argz_replace (char **__restrict __argz,
const char *__restrict __str,
const char *__restrict __with,
unsigned int *__restrict __replace_count);
Expand Down

0 comments on commit 2bc1dc7

Please sign in to comment.