[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#869869: kalzium FTBFS with OCaml 4.05.0: Options -c and -o are incompatible when compiling C files



tags 869869 + patch
thanks

On 27/07/2017 11:40, Stéphane Glondu wrote:
kalzium FTBFS with OCaml 4.05.0. Relevant log:
[...]
[ 55%] Generating modwrap.o
cd /tmp/kalzium-16.08.3/obj-x86_64-linux-gnu/src && /usr/bin/ocamlopt -I /usr/lib/ocaml/facile -c /tmp/kalzium-16.08.3/src/solver/modwrap.c -o /tmp/kalzium-16.08.3/obj-x86_64-linux-gnu/src/modwrap.o
Options -c and -o are incompatible when compiling C files
src/CMakeFiles/kalzium.dir/build.make:107: recipe for target 'src/modwrap.o' failed
make[4]: *** [src/modwrap.o] Error 2
make[4]: Leaving directory '/tmp/kalzium-16.08.3/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:305: recipe for target 'src/CMakeFiles/kalzium.dir/all' failed
make[3]: *** [src/CMakeFiles/kalzium.dir/all] Error 2
[...]

Attached is a patch that forwards the -o option to the underlying C compiler. It should work with the ocaml currently in unstable as well.


Cheers,

--
Stéphane
Description: Fix compilation with OCaml 4.05.0

Bug-Debian: https://bugs.debian.org/869869
Forwarded: no
Last-Update: 2017-07-28

--- kalzium-16.08.3.orig/src/CMakeOCamlInstructions.cmake
+++ kalzium-16.08.3/src/CMakeOCamlInstructions.cmake
@@ -58,7 +58,7 @@ ocaml_ml_to_cmx(${CMAKE_CURRENT_BINARY_D
 # object files
 
 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/modwrap.o
-                   COMMAND ${OCAML_OCAMLOPT_EXECUTABLE} -I ${LIBFACILE_INCLUDE_DIR} -c ${CMAKE_CURRENT_SOURCE_DIR}/solver/modwrap.c -o ${CMAKE_CURRENT_BINARY_DIR}/modwrap.o
+                   COMMAND ${OCAML_OCAMLOPT_EXECUTABLE} -I ${LIBFACILE_INCLUDE_DIR} -c ${CMAKE_CURRENT_SOURCE_DIR}/solver/modwrap.c -ccopt -o -ccopt ${CMAKE_CURRENT_BINARY_DIR}/modwrap.o
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/solver/modwrap.c ${CMAKE_CURRENT_BINARY_DIR}/solver.o
                    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/modwrap.o)

Reply to: