From 7dda58097a1e0365ffa00ecd1d3dbd4c23af6d38 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 22 Feb 2019 14:53:51 +0000 Subject: [PATCH] cmake: do not use -fPIC on 32 bit x86, breaks asm Do not add the -fPIC (position independent code) compiler flag on 32 bit x86 architectures because that breaks inline assembly, and some included libraries like fex require inline assembly to work. Signed-off-by: Rafael Kitover --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c624a9ed..8073871a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -417,7 +417,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) # common flags set(MY_C_FLAGS -pipe -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -feliminate-unused-debug-types) - if(NOT WIN32) + if(NOT (WIN32 OR X86_32)) # inline asm is not allowed with -fPIC set(MY_C_FLAGS ${MY_C_FLAGS} -fPIC) endif()