From b249a82b37c15a17b69cda88445bdc753a19203c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 26 Jan 2022 16:29:56 +0000 Subject: [PATCH] Disable package note misfeature --- 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...-incorrect-assumption-about-cross-co.patch | 2 +- ...nly-use-OC_-for-building-executables.patch | 31 +++++++++++++++++++ ocaml.spec | 10 +++++- 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 0004-configure-Only-use-OC_-for-building-executables.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index fd84790..eb6794d 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 23f2e84d360208759c7d82b7ff795770ce6cf0b2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/3] Don't add rpaths to libraries. +Subject: [PATCH 1/4] Don't add rpaths to libraries. --- utils/config.mlp | 4 ++-- diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index 2e5813a..389f09b 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From 9966786a7389dc6621f2bc2dce7c690c5a38b67d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ diff --git a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch index 6f7cd50..e101809 100644 --- a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch +++ b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch @@ -1,7 +1,7 @@ From 5eff09224929f8fa1a2e19f9a15befd3a4a395ea Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Apr 2019 16:16:29 +0100 -Subject: [PATCH 3/3] configure: Remove incorrect assumption about +Subject: [PATCH 3/4] configure: Remove incorrect assumption about cross-compiling. See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 diff --git a/0004-configure-Only-use-OC_-for-building-executables.patch b/0004-configure-Only-use-OC_-for-building-executables.patch new file mode 100644 index 0000000..1f21b0f --- /dev/null +++ b/0004-configure-Only-use-OC_-for-building-executables.patch @@ -0,0 +1,31 @@ +From acb5dbaa8f8ece825a48814024404a1a6c5ba7b2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 26 Jan 2022 15:47:02 +0000 +Subject: [PATCH 4/4] configure: Only use OC_* for building executables + +Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for +"package notes" which contains build paths. + +In any case it seems pointless having both the OC_* variables and also +including the regular CFLAGS/LDFLAGS. Give me full control over what +ocamlopt uses. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 07c005f09..19fe3fd1b 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) \$(OC_LDFLAGS)" + + # Flags for building executable files with debugging symbols + mkexedebugflag="-g" +-- +2.32.0 + diff --git a/ocaml.spec b/ocaml.spec index 7ddabff..64b3036 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,3 +1,6 @@ +# Don't add -Wl,-dT, +%undefine _package_note_flags + # OCaml has a bytecode backend that works on anything with a C # compiler, and a native code backend available on a subset of # architectures. A further subset of architectures support native @@ -31,7 +34,7 @@ Name: ocaml Version: 4.13.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -59,6 +62,7 @@ Source0: https://github.com/ocaml/ocaml/archive/%%{version}.tar.gz Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch +Patch0004: 0004-configure-Only-use-OC_-for-building-executables.patch BuildRequires: make BuildRequires: git @@ -368,6 +372,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Wed Jan 26 2022 Richard W.M. Jones - 4.13.1-3 +- Disable package note misfeature +- Remove duplicate flags from mkexe + * Thu Jan 20 2022 Fedora Release Engineering - 4.13.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild