From 2880abc366b57eba92c48a94c9c8db1a56bd666d Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Glondu?= Date: Wed, 8 Feb 2023 09:48:04 +0100 Subject: [PATCH] Avoid build path ending up in binaries (Closes: #1030785) --- ...ug-file-prefix-map-from-ocamlc_cflag.patch | 32 +++++++++++++++++++ debian/patches/series | 1 + debian/rules | 1 + 3 files changed, 34 insertions(+) create mode 100644 debian/patches/0008-Filter-out-f-debug-file-prefix-map-from-ocamlc_cflag.patch diff --git a/debian/patches/0008-Filter-out-f-debug-file-prefix-map-from-ocamlc_cflag.patch b/debian/patches/0008-Filter-out-f-debug-file-prefix-map-from-ocamlc_cflag.patch new file mode 100644 index 00000000..0034748e --- /dev/null +++ b/debian/patches/0008-Filter-out-f-debug-file-prefix-map-from-ocamlc_cflag.patch @@ -0,0 +1,32 @@ +From: =?utf-8?q?St=C3=A9phane_Glondu?= +Date: Wed, 8 Feb 2023 08:45:00 +0100 +Subject: Filter out -f{debug,file}-prefix-map= from ocamlc_cflags and mkexe + +Bug-Debian: https://bugs.debian.org/1030785 +Forwarded: not-needed +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9ac019f..a449246 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -43,7 +43,7 @@ libraries_man_section=3 + # at the moment they are not taken into account on Windows, because + # flexlink, which is used to build executables on this platform, can + # not handle them. +-mkexe="\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_LDFLAGS) \$(LDFLAGS)" ++mkexe="\$(CC) \$(OC_CFLAGS) \$(filter-out -fdebug-prefix-map=% -ffile-prefix-map=%,\$(CFLAGS)) \$(OC_LDFLAGS) \$(LDFLAGS)" + + # Flags for building executable files with debugging symbols + mkexedebugflag="-g" +@@ -1952,7 +1952,7 @@ AS_IF([test x"$DEFAULT_STRING" = "xunsafe"], + + oc_cflags="$common_cflags $internal_cflags" + oc_cppflags="$common_cppflags $internal_cppflags" +-ocamlc_cflags="$common_cflags $sharedlib_cflags \$(CFLAGS)" ++ocamlc_cflags="$common_cflags $sharedlib_cflags \$(filter-out -fdebug-prefix-map=% -ffile-prefix-map=%,\$(CFLAGS))" + ocamlc_cppflags="$common_cppflags \$(CPPFLAGS)" + cclibs="$cclibs $mathlib" + diff --git a/debian/patches/series b/debian/patches/series index 2924ded5..56079e3b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ 0005-Trigger-output-complete-exe-on-custom-with-an-enviro.patch 0006-Do-not-error-on-warnings-in-autoconf.patch 0007-Put-manpages-in-section-3o-instead-of-3.patch +0008-Filter-out-f-debug-file-prefix-map-from-ocamlc_cflag.patch diff --git a/debian/rules b/debian/rules index e01a7424..f8a996d9 100755 --- a/debian/rules +++ b/debian/rules @@ -131,6 +131,7 @@ override_dh_auto_configure: config-stamp ocamlinit-stamp config-stamp: pre-config-stamp ./configure $(CONFIGURE_OPTS) + sed -r -i '/^CFLAGS/s/-f(file|debug)-prefix-map=[^ ]* //g' Makefile.config touch $@ ocamlinit-stamp: $(TARBALL_TARGET) config-stamp -- 2.30.2