From fbe2b4b8d39352ebe227b99c6ccc0ae6bcb779b2 Mon Sep 17 00:00:00 2001 From: xfiderek Date: Tue, 20 Feb 2024 22:14:32 +0100 Subject: [PATCH] Fix compilation with ikos-scan-cc (#17). Building cobra_vendor package fails when ikos-scan-cc is used as a compiler. For a command like: ``` ikos-scan-cc -Wall -pedantic -Werror -Wshadow -O2 -DYY_NO_INPUT -I. -std=c99 -o scope_check scope_check.c cwe_util.c c.ar -pthread ``` the following error message is printed: ``` clang: error: c.ar: 'linker' input unused [-Werror,-Wunused-command-line-argument] ``` Changing the end of the compile command from `c.ar -pthread` to `-Wl,c.ar -pthread` fixes the issue. This commit addresses the issue by modifying the linker flags in the CMakeLists.txt. --- cobra_vendor/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobra_vendor/CMakeLists.txt b/cobra_vendor/CMakeLists.txt index 7399af0..27e585d 100644 --- a/cobra_vendor/CMakeLists.txt +++ b/cobra_vendor/CMakeLists.txt @@ -22,9 +22,9 @@ ExternalProject_Add(cobra-${VER} BUILD_IN_SOURCE TRUE CONFIGURE_COMMAND "" BUILD_COMMAND - ${CMAKE_COMMAND} -E chdir /src make linux && ${CMAKE_COMMAND} -E chdir /src_app make all + ${CMAKE_COMMAND} -E chdir /src make linux && ${CMAKE_COMMAND} -E chdir /src_app make all LDFLAGS=-Wl,c.ar\ -pthread INSTALL_COMMAND - ${CMAKE_COMMAND} -E chdir /src make install_linux MAN=/src_app && ${CMAKE_COMMAND} -E chdir /src_app make install_linux + ${CMAKE_COMMAND} -E chdir /src make install_linux MAN=/src_app LDFLAGS=-Wl,c.ar\ -pthread && ${CMAKE_COMMAND} -E chdir /src_app make install_linux LDFLAGS=-Wl,c.ar\ -pthread ) install(PROGRAMS