Skip to content

Commit

Permalink
Add clang check for -nopie option
Browse files Browse the repository at this point in the history
The -no-pie option is not available in clang until 6.0. Per the
documentation, -nopie serves the same purpose as -no-pie (but not
-fno-pie). Hence, use the -nopie option when clang is in use as the CC.

Fixes: iovisor#1237
Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
drzaeus77 committed Aug 15, 2017
1 parent 8e26b49 commit a2afe8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ if (LUAJIT_LIBRARIES AND LUAJIT)
set_target_properties(bcc-lua PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(bcc-lua ${LUAJIT_LIBRARIES})
target_link_libraries(bcc-lua -Wl,--whole-archive bcc-static -Wl,--no-whole-archive)
target_link_libraries(bcc-lua -no-pie)
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
target_link_libraries(bcc-lua -nopie)
else()
target_link_libraries(bcc-lua -no-pie)
endif()

install(TARGETS bcc-lua RUNTIME DESTINATION bin)
endif()

0 comments on commit a2afe8d

Please sign in to comment.