From 6a9b586a6fd78b2113812794adad96781ef3cb52 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 9 Jun 2022 11:45:42 +0200 Subject: [PATCH] Add -DPIC to pic flags Because `/usr/bin/libtool` has that line of code: ```shell pic_flag=" -fPIC -DPIC" ``` That macro definition `PIC` can trigger different assembler code, as for example in GMP assembler code. --- scripts/toolchains/linux.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index 2fac4922deacf7..699b6d232ffb03 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -48,8 +48,8 @@ endif() get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if(NOT _CMAKE_IN_TRY_COMPILE) - string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ") - string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ") + string(APPEND CMAKE_C_FLAGS_INIT " -fPIC -DPIC ${VCPKG_C_FLAGS} ") + string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC -DPIC ${VCPKG_CXX_FLAGS} ") string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ") string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ") string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")