Skip to content

Commit f547ef2

Browse files
committed
Replace hardcode_into_libs patches with sed calls in libgcrypt, libksba, libassuan
Replaces version-specific patches with build system sed commands to simplify version upgrades. Verified identical binary output with baseline. Changes: - libgcrypt-1.10.1: Remove patch, use sed for hardcode_into_libs - libksba-1.6.3: Remove patch, use sed for hardcode_into_libs - libassuan-2.5.5: Remove patch, use sed for hardcode_into_libs - gpg2-2.4.0: Refactor patch to only contain functional code change (ttyfp behavior) Move cross_compiling=yes to sed in module for future version bumps - All modules: Add TODO comments for version bump considerations Sed patterns follow tpm2-tss convention (simple string matching without anchors). Build verification: EOL_x220-hotp-maximized compiles successfully with 175 KiB free CBFS space. All GPG2 toolstack libraries built correctly with -Oz optimization. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent f55c158 commit f547ef2

File tree

9 files changed

+13
-563
lines changed

9 files changed

+13
-563
lines changed

modules/gpg2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ gpg2_depends := libgpg-error libgcrypt libksba libassuan npth libusb $(musl_dep)
1515

1616
#TODO: remove -std=gnu11 when bumping gpg2 version (current 2.4.0 has C23 compatibility issues with GCC 15.1.0 true keyword conflicts)
1717
gpg2_configure := \
18-
$(CROSS_TOOLS) \
18+
sed -i 's/cross_compiling=no/cross_compiling=yes/' configure \
19+
&& $(CROSS_TOOLS) \
1920
CFLAGS="-Oz -std=gnu11" \
2021
./configure \
2122
CPPFLAGS="-I$(INSTALL)/include/libusb-1.0 -DDISABLE_PHOTO_VIEWER" \

modules/libassuan

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
modules-$(CONFIG_GPG2) += libassuan
22

3+
#TODO: On version bump, check if hardcode_into_libs sed can be removed if configure script improves
34
libassuan_version := 2.5.5
45
libassuan_dir := libassuan-$(libassuan_version)
56
libassuan_tar := libassuan-$(libassuan_version).tar.bz2
67
libassuan_url := https://gnupg.org/ftp/gcrypt/libassuan/$(libassuan_tar)
78
libassuan_hash := 8e8c2fcc982f9ca67dcbb1d95e2dc746b1739a4668bc20b3a3c5be632edb34e4
89

910
libassuan_configure := \
10-
CFLAGS="-Oz" \
11+
sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \
12+
&& CFLAGS="-Oz" \
1113
$(CROSS_TOOLS) \
1214
./configure \
1315
--host $(MUSL_ARCH)-linux-musl \

modules/libgcrypt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
modules-$(CONFIG_GPG2) += libgcrypt
22

3+
#TODO: On version bump, check if hardcode_into_libs sed can be removed if configure script improves
34
libgcrypt_version := 1.10.1
45
libgcrypt_dir := libgcrypt-$(libgcrypt_version)
56
libgcrypt_tar := libgcrypt-$(libgcrypt_version).tar.bz2
67
libgcrypt_url := https://gnupg.org/ftp/gcrypt/libgcrypt/$(libgcrypt_tar)
78
libgcrypt_hash := ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de
89

910
libgcrypt_configure := \
10-
$(CROSS_TOOLS) \
11+
sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \
12+
&& $(CROSS_TOOLS) \
1113
CFLAGS="-Oz" \
1214
./configure \
1315
--host=$(MUSL_ARCH)-linux-musl \

modules/libgpg-error

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
modules-$(CONFIG_GPG2) += libgpg-error
22

3+
#TODO: On version bump, check if PowerPC64LE lock object creation is still needed in patches/libgpg-error-1.46.patch
34
libgpg-error_version := 1.46
45
libgpg-error_dir := libgpg-error-$(libgpg-error_version)
56
libgpg-error_tar := libgpg-error-$(libgpg-error_version).tar.bz2

modules/libksba

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
modules-$(CONFIG_GPG2) += libksba
22

3+
#TODO: On version bump, check if hardcode_into_libs sed can be removed if configure script improves
34
libksba_version := 1.6.3
45
libksba_dir := libksba-$(libksba_version)
56
libksba_tar := libksba-$(libksba_version).tar.bz2
67
libksba_url := https://gnupg.org/ftp/gcrypt/libksba/$(libksba_tar)
78
libksba_hash := 3f72c68db30971ebbf14367527719423f0a4d5f8103fc9f4a1c01a9fa440de5c
89

910
libksba_configure := \
10-
$(CROSS_TOOLS) \
11+
sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \
12+
&& $(CROSS_TOOLS) \
1113
CFLAGS="-Oz" \
1214
./configure \
1315
--host $(MUSL_ARCH)-linux-musl \

patches/gpg2-2.4.0.patch

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
diff -u --recursive gnupg-2.4.0/configure gnupg-2.4.0/configure
2-
--- gnupg-2.4.0/configure 2016-08-17 09:20:25.000000000 -0400
3-
+++ gnupg-2.4.0/configure 2018-01-20 16:55:14.502067084 -0500
4-
@@ -572,7 +572,7 @@
5-
ac_clean_files=
6-
ac_config_libobj_dir=.
7-
LIBOBJS=
8-
-cross_compiling=no
9-
+cross_compiling=yes
10-
subdirs=
11-
MFLAGS=
12-
MAKEFLAGS=
1+
diff -u --recursive gnupg-2.4.0/common/ttyio.c.orig gnupg-2.4.0/common/ttyio.c
132
--- gnupg-2.4.0/common/ttyio.c.orig 2023-03-24 02:37:40.384435064 +0100
143
+++ gnupg-2.4.0/common/ttyio.c 2023-03-24 02:38:21.825961221 +0100
154
@@ -186,7 +186,7 @@

patches/libassuan-2.5.5.patch

Lines changed: 0 additions & 176 deletions
This file was deleted.

0 commit comments

Comments
 (0)