Remove hardcoding the build configuration into the help/version output
from swig to make the binaries reproducible.

Signed-off-by: Richard Purdie <[email protected]>
---
 meta/lib/oeqa/selftest/cases/reproducible.py  |  1 -
 .../swig/swig/determinism.patch               | 19 +++++++++++++++++++
 meta/recipes-devtools/swig/swig_3.0.12.bb     |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/swig/swig/determinism.patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py 
b/meta/lib/oeqa/selftest/cases/reproducible.py
index a15601e5e5d..dd2230c149c 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -44,7 +44,6 @@ exclude_packages = [
        'python3-cython',
        'qemu',
        'ruby-ri-docs',
-       'swig',
        'systemd-bootchart'
        ]
 
diff --git a/meta/recipes-devtools/swig/swig/determinism.patch 
b/meta/recipes-devtools/swig/swig/determinism.patch
new file mode 100644
index 00000000000..8ffb4bce8ed
--- /dev/null
+++ b/meta/recipes-devtools/swig/swig/determinism.patch
@@ -0,0 +1,19 @@
+Remove the compiler commandline/platform from the compiled binary as this
+breaks reproducibilty.
+
+Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to 
take]
+RP 2021/3/1
+
+
+Index: swig-3.0.12/Source/Modules/main.cxx
+===================================================================
+--- swig-3.0.12.orig/Source/Modules/main.cxx
++++ swig-3.0.12/Source/Modules/main.cxx
+@@ -636,7 +636,6 @@ void SWIG_getoptions(int argc, char *arg
+       }
+       } else if (strcmp(argv[i], "-version") == 0) {
+       fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
+-      fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
+       fprintf(stdout, "\nConfigured options: %cpcre\n",
+ #ifdef HAVE_PCRE
+               '+'
diff --git a/meta/recipes-devtools/swig/swig_3.0.12.bb 
b/meta/recipes-devtools/swig/swig_3.0.12.bb
index 45026c9700b..090aaa81127 100644
--- a/meta/recipes-devtools/swig/swig_3.0.12.bb
+++ b/meta/recipes-devtools/swig/swig_3.0.12.bb
@@ -6,6 +6,7 @@ SRC_URI += 
"file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.pat
             
file://swig-3.0.12-Coverity-fix-issue-reported-for-SWIG_Python_FixMetho.patch \
             file://Python-Fix-new-GCC8-warnings-in-generated-code.patch \
             
file://0001-Fix-generated-code-for-constant-expressions-containi.patch \
+            file://determinism.patch \
            "
 SRC_URI[md5sum] = "82133dfa7bba75ff9ad98a7046be687c"
 SRC_URI[sha256sum] = 
"7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
-- 
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#148788): 
https://lists.openembedded.org/g/openembedded-core/message/148788
Mute This Topic: https://lists.openembedded.org/mt/80993933/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to