diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-11-14 16:08:24 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-11-14 07:36:55 -0800 |
| commit | fdec68e4b179db6caf799681747225ca86890b1a (patch) | |
| tree | cec22c76958227b76719200bdd85064fd83df942 | |
| parent | 5375b936ebb932bbc3d1f2a53f45e4bab4a63e54 (diff) | |
| download | meta-openembedded-fdec68e4b179db6caf799681747225ca86890b1a.tar.gz | |
mariadb: support reproducible builds
In order to support reproducible builds [1]
1. While using bison to generate source code, add option --file-prefix-map [2]
to remove build path prefix in the generated header file.
2. Remove link directories for Yocto to drop source path
from compile link option
[1] https://reproducible-builds.org/
[2] https://cgit.git.savannah.gnu.org/cgit/bison.git/commit/?id=dd878d18519689c7bbcd72de4c9f9e53085a3cbf
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
4 files changed, 80 insertions, 3 deletions
diff --git a/meta-oe/conf/layer.conf b/meta-oe/conf/layer.conf index 23af8d0183..83b790fa18 100644 --- a/meta-oe/conf/layer.conf +++ b/meta-oe/conf/layer.conf | |||
| @@ -212,9 +212,6 @@ OEQA_REPRODUCIBLE_EXCLUDED_PACKAGES += " \ | |||
| 212 | lprng-dbg \ | 212 | lprng-dbg \ |
| 213 | lshw \ | 213 | lshw \ |
| 214 | lshw-locale-fr \ | 214 | lshw-locale-fr \ |
| 215 | mariadb-dbg \ | ||
| 216 | mariadb-server \ | ||
| 217 | mariadb-src \ | ||
| 218 | mce-test \ | 215 | mce-test \ |
| 219 | mime-support-doc \ | 216 | mime-support-doc \ |
| 220 | minifi-cpp \ | 217 | minifi-cpp \ |
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc index 6e07f1ffa9..a757a10bfe 100644 --- a/meta-oe/recipes-dbs/mysql/mariadb.inc +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc | |||
| @@ -25,6 +25,8 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ | |||
| 25 | file://0001-Ensure-compatibility-with-ARMv9-by-updating-.arch-di.patch \ | 25 | file://0001-Ensure-compatibility-with-ARMv9-by-updating-.arch-di.patch \ |
| 26 | file://riscv32.patch \ | 26 | file://riscv32.patch \ |
| 27 | file://0001-Remove-x86-specific-loop-in-my_convert.patch \ | 27 | file://0001-Remove-x86-specific-loop-in-my_convert.patch \ |
| 28 | file://0001-support-reproducible-builds.patch \ | ||
| 29 | file://0001-storage-mroonga-CMakeLists.txt-fix-reproducible-buil.patch \ | ||
| 28 | " | 30 | " |
| 29 | SRC_URI[sha256sum] = "52fa4dca2c5f80afc1667d523a27c06176d98532298a6b0c31ed73505f49e15c" | 31 | SRC_URI[sha256sum] = "52fa4dca2c5f80afc1667d523a27c06176d98532298a6b0c31ed73505f49e15c" |
| 30 | 32 | ||
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-storage-mroonga-CMakeLists.txt-fix-reproducible-buil.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-storage-mroonga-CMakeLists.txt-fix-reproducible-buil.patch new file mode 100644 index 0000000000..c34ec92415 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-storage-mroonga-CMakeLists.txt-fix-reproducible-buil.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From 5e53d0f2ef08b0805136adf580b5e84fee9fcfc9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Fri, 14 Nov 2025 15:35:52 +0800 | ||
| 4 | Subject: [PATCH] storage/mroonga/CMakeLists.txt: fix reproducible builds | ||
| 5 | |||
| 6 | Due to the link diretory includes source path and then the compile option | ||
| 7 | -WR,rpath,xxx caused the generated libarary not to be reproducible | ||
| 8 | ... | ||
| 9 | |path-to/mariadb/11.4.8/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-g++ ... | ||
| 10 | -Wl,-rpath,path-to/mariadb/11.4.8/sources/mariadb-11.4.8/storage/mroonga/vendor/groonga/lib: | ||
| 11 | path-to/mariadb/11.4.8/sources/mariadb-11.4.8/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers: | ||
| 12 | path/mariadb/11.4.8/sources/mariadb-11.4.8/libservices: ... | ||
| 13 | ... | ||
| 14 | |||
| 15 | Remove it for Yocto without regression | ||
| 16 | |||
| 17 | Upstream-Status: Inappropriate [OE specific, the removing code may matter for others] | ||
| 18 | |||
| 19 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 20 | --- | ||
| 21 | storage/mroonga/CMakeLists.txt | 3 --- | ||
| 22 | 1 file changed, 3 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt | ||
| 25 | index 1538b6cc..cdccb2c5 100644 | ||
| 26 | --- a/storage/mroonga/CMakeLists.txt | ||
| 27 | +++ b/storage/mroonga/CMakeLists.txt | ||
| 28 | @@ -298,9 +298,6 @@ else() | ||
| 29 | set(MYSQL_LIBRARY_DIRS | ||
| 30 | "${MYSQL_SERVICES_LIB_DIR}") | ||
| 31 | endif() | ||
| 32 | -link_directories( | ||
| 33 | - ${MRN_LIBRARY_DIRS} | ||
| 34 | - ${MYSQL_LIBRARY_DIRS}) | ||
| 35 | |||
| 36 | set(MRN_ALL_SOURCES | ||
| 37 | ${MRN_SOURCES} | ||
| 38 | -- | ||
| 39 | 2.34.1 | ||
| 40 | |||
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-support-reproducible-builds.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-support-reproducible-builds.patch new file mode 100644 index 0000000000..10e6f03df6 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-support-reproducible-builds.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From ff394a977e699e1b757c6e83143e1f330e20ca37 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Fri, 14 Nov 2025 12:38:20 +0800 | ||
| 4 | Subject: [PATCH] support reproducible builds | ||
| 5 | |||
| 6 | In order to support reproducible builds [1], while using bison to generate | ||
| 7 | source code, add option --file-prefix-map [2] to remove build path prefix | ||
| 8 | in the generated header file. | ||
| 9 | |||
| 10 | [1] https://reproducible-builds.org/ | ||
| 11 | [2] https://cgit.git.savannah.gnu.org/cgit/bison.git/commit/?id=dd878d18519689c7bbcd72de4c9f9e53085a3cbf | ||
| 12 | |||
| 13 | Upstream-Status: Submitted [https://github.com/MariaDB/server/pull/4440] | ||
| 14 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 15 | --- | ||
| 16 | sql/CMakeLists.txt | 4 ++-- | ||
| 17 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt | ||
| 20 | index 3a7c9d36..ac868072 100644 | ||
| 21 | --- a/sql/CMakeLists.txt | ||
| 22 | +++ b/sql/CMakeLists.txt | ||
| 23 | @@ -400,10 +400,10 @@ ELSE() | ||
| 24 | CONFIGURE_FILE(myskel.m4.in myskel.m4) | ||
| 25 | BISON_TARGET(gen_mariadb_cc_hh ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy | ||
| 26 | ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.cc | ||
| 27 | - COMPILE_FLAGS "-p MYSQL -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4") | ||
| 28 | + COMPILE_FLAGS "-p MYSQL -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4 --file-prefix-map=${CMAKE_BINARY_DIR}=''") | ||
| 29 | BISON_TARGET(gen_oracle_cc_hh ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy | ||
| 30 | ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.cc | ||
| 31 | - COMPILE_FLAGS "-p ORA -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4") | ||
| 32 | + COMPILE_FLAGS "-p ORA -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4 --file-prefix-map=${CMAKE_BINARY_DIR}=''") | ||
| 33 | ENDIF() | ||
| 34 | |||
| 35 | IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR) | ||
| 36 | -- | ||
| 37 | 2.34.1 | ||
| 38 | |||
