meta-openembedded/meta-oe/recipes-crypto/leancrypto/files/0001-fix-strip-absolute-build-paths-from-DWARF-debug-info.patch
Ayoub Zaki 9dad25fbca
leancrypto: add initial recipe
Cryptographic library that exclusively contains
Quantum resistant cryptographic algorithms. It is lean has minimal dependencies,
supports stack-only operation and provides optimized implementations for
ML-KEM (Kyber), ML-DSA (Dilithium), SLH-DSA (Sphincs+) and many more

Signed-off-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-03-21 07:14:33 -07:00

41 lines
1.4 KiB
Diff

From 5a3c770b24a40a4e32154f25fdba3b685b0221d2 Mon Sep 17 00:00:00 2001
From: Ayoub Zaki <ayoub.zaki@embetrix.com>
Date: Thu, 19 Mar 2026 09:29:10 +0100
Subject: [PATCH] fix: strip absolute build paths from DWARF debug info for
reproducible builds
Upstream-Status: Backport [https://github.com/smuellerDD/leancrypto/commit/6561beeadf7376cc0815d937ee8d231a3bbbcba8]
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
---
meson.build | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/meson.build b/meson.build
index 03616319..ba9bbcbd 100644
--- a/meson.build
+++ b/meson.build
@@ -121,6 +121,19 @@ endif
if get_option('dilithium_debug').enabled()
add_global_arguments([ '-DLC_DILITHIUM_DEBUG' ], language: 'c')
endif
+
+# Strip build directory paths from debug info to avoid buildpaths warnings
+# in debug packages
+if cc.has_argument('-ffile-prefix-map=/dev/null=/dev/null')
+ add_global_arguments([
+ '-ffile-prefix-map=' + meson.project_source_root() + '/=',
+ '-ffile-prefix-map=' + meson.project_build_root() + '/=',
+ ], language: 'c')
+ add_project_link_arguments([
+ '-ffile-prefix-map=' + meson.project_source_root() + '/=',
+ '-ffile-prefix-map=' + meson.project_build_root() + '/=',
+ ], language : 'c')
+endif
if get_option('kyber_debug').enabled()
add_global_arguments([ '-DLC_KYBER_DEBUG' ], language: 'c')
endif
--
2.43.0