From efff5510a696b195f23b7572ac5023bc46c4e498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Sun, 19 Jul 2020 22:45:00 +0200 Subject: [PATCH] Use %build_ldflags instead of $RPM_LD_FLAGS --- ocaml-base.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ocaml-base.spec b/ocaml-base.spec index 9df28a3..60a23ae 100644 --- a/ocaml-base.spec +++ b/ocaml-base.spec @@ -46,17 +46,17 @@ dune build %{?_smp_mflags} # TODO: Once odoc is available, BR it and run this to generate documentation: # dune build %{?_smp_mflags} @doc -# Dune passes RPM_LD_FLAGS to ocamlmklib without -ldopt, resulting in "Unknown -# option" warnings from ocamlmklib and a library that has not been linked with -# the correct flags. We can't add -ldopt ourselves, since that breaks -# compilation of the cmxs files. This seems to be a weakness of dune; linker -# flags and libraries to be linked with have to be specified together, and -# nothing takes care of separating them and adding ldopt as necessary. We +# Dune passes %%build_ldflags to ocamlmklib without -ldopt, resulting in +# "Unknown option" warnings from ocamlmklib and a library that has not been +# linked with the correct flags. We can't add -ldopt ourselves, since that +# breaks compilation of the cmxs files. This seems to be a weakness of dune; +# linker flags and libraries to be linked with have to be specified together, +# and nothing takes care of separating them and adding ldopt as necessary. We # relink manually to address the problem. pushd _build/default/src -ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -o base_stubs *.o +ocamlmklib -g -ldopt "%build_ldflags" -o base_stubs *.o cd ../hash_types/src -ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -o base_internalhash_types_stubs *.o +ocamlmklib -g -ldopt "%build_ldflags" -o base_internalhash_types_stubs *.o popd %install