From 0c2853f007ad89373ac86b92a481def61d565527 Mon Sep 17 00:00:00 2001 From: Andy Li Date: Sun, 19 Nov 2017 17:32:16 +0800 Subject: [PATCH] disable profiling since it is not support in aarch64 and s390x --- obuild-arg-parsing.patch | 34 ++++++++++++++++++++++++++++++++++ ocaml-obuild.spec | 4 ++++ 2 files changed, 38 insertions(+) create mode 100644 obuild-arg-parsing.patch diff --git a/obuild-arg-parsing.patch b/obuild-arg-parsing.patch new file mode 100644 index 0000000..b5b0964 --- /dev/null +++ b/obuild-arg-parsing.patch @@ -0,0 +1,34 @@ +From 6bdda41644e9b5e5dd059885a0f3bacdfa946f9a Mon Sep 17 00:00:00 2001 +From: Andy Li +Date: Sun, 19 Nov 2017 21:26:07 +0800 +Subject: [PATCH] do not call set_target_options when just parsing -g -pg + +--- + src/main.ml | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/src/main.ml b/src/main.ml +index 67fd4b0..cae01d8 100644 +--- a/src/main.ml ++++ b/src/main.ml +@@ -42,12 +42,14 @@ let configure argv = + ("--flag", Arg.String user_set_flags, "enable or disable a project's flag"); + ("--executable-as-obj", Arg.Unit (set_target_options "executable-as-obj" true), "output executable as obj file"); + ("--annot", Arg.Unit (set_target_options "annot" true), "generate .annot files"); +- ("-g", Arg.Unit ( +- (set_target_options "library-debugging" true) (); +- (set_target_options "executable-debugging" true)), "compilation with debugging"); +- ("-pg", Arg.Unit ( +- (set_target_options "library-profiling" true) (); +- (set_target_options "executable-profiling" true)), "compilation with profiling") ++ ("-g", Arg.Unit (fun () -> ++ (set_target_options "library-debugging" true)(); ++ (set_target_options "executable-debugging" true)(); ++ ), "compilation with debugging"); ++ ("-pg", Arg.Unit (fun () -> ++ (set_target_options "library-profiling" true)(); ++ (set_target_options "executable-profiling" true)(); ++ ), "compilation with profiling") + ] in + Arg.parse_argv (Array.of_list argv) ( + enable_disable_opt "library-bytecode" "library compilation as bytecode" diff --git a/ocaml-obuild.spec b/ocaml-obuild.spec index c7d4f6e..1a6bbca 100644 --- a/ocaml-obuild.spec +++ b/ocaml-obuild.spec @@ -9,6 +9,9 @@ License: BSD URL: https://github.com/ocaml-obuild/obuild Source0: https://github.com/ocaml-obuild/obuild/archive/obuild-v%{version}/%{name}-%{version}.tar.gz +# https://github.com/ocaml-obuild/obuild/issues/169 +Patch0: obuild-arg-parsing.patch + BuildRequires: ocaml BuildRequires: help2man @@ -27,6 +30,7 @@ way of working, adapting parts where necessary to fully support OCaml. %prep %setup -q -n obuild-obuild-v%{version} +%patch0 -p1 %build