Skip to content

Commit

Permalink
package/localedef: build issue with old glibc (<= 2.38)
Browse files Browse the repository at this point in the history
While building host-localedef from glibc 2.38 sources, it uses the
features.h header from its sources that define _ISOC2X_SOURCE 1 as
soon as _GNU_SOURCE is defined.

_ISOC2X_SOURCE enable __GLIBC_USE_ISOC2X 1 that enable the header
redirection to use __isoc23_* functions introduced in glibc 2.38 [1].

If an older version is installed on the host, those functions
doesn't exist and break the build.

Add a local patch to keep _ISOC2X_SOURCE and __GLIBC_USE_ISOC2X
disabled.

Fixes:
host-localedef-2.38-13-g92201f16cbcfd9eafe314ef6654be2ea7ba25675/build/locale/ld-ctype.o: in function `ctype_read':
ld-ctype.c:(.text+0x6cef): undefined reference to `__isoc23_strtoul'

(glibc 2.31 installed on the host)

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=64924422a99690d147a166b4de3103f3bf3eaf6c

Signed-off-by: Romain Naour <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
RomainNaour authored and jacmet committed Sep 29, 2023
1 parent 34f8d87 commit d3fd120
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From babfa64585bef6c53c1d399a1c244aea89437c9e Mon Sep 17 00:00:00 2001
From: Romain Naour <[email protected]>
Date: Sat, 9 Sep 2023 23:58:50 +0200
Subject: [PATCH] HACK: keep _ISOC2X_SOURCE undefined to build localedef with
old glibc

Fixes:
host-localedef-2.38-13-g92201f16cbcfd9eafe314ef6654be2ea7ba25675/build/locale/ld-ctype.o: in function `ctype_read':
ld-ctype.c:(.text+0x6cef): undefined reference to `__isoc23_strtoul'

Upstream: Not applicable

Signed-off-by: Romain Naour <[email protected]>
---
include/features.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/include/features.h b/include/features.h
index 7c51b4a2e4..f385370d18 100644
--- a/include/features.h
+++ b/include/features.h
@@ -207,7 +207,6 @@
# undef _ISOC11_SOURCE
# define _ISOC11_SOURCE 1
# undef _ISOC2X_SOURCE
-# define _ISOC2X_SOURCE 1
# undef _POSIX_SOURCE
# define _POSIX_SOURCE 1
# undef _POSIX_C_SOURCE
--
2.41.0

0 comments on commit d3fd120

Please sign in to comment.