diff --git a/cmake/build_wrapper.sh b/cmake/build_wrapper.sh index d0a7e923..32bdf1c8 100755 --- a/cmake/build_wrapper.sh +++ b/cmake/build_wrapper.sh @@ -5,6 +5,9 @@ cleanup () { rm -f ${SYMSFILE} ${KEEPSYMS} } +NM="${NM:-nm}" +OBJCOPY="${OBJCOPY:-objcopy}" + PREFIX=$1 KEEPSYMS_IN=$2 shift 2 @@ -25,12 +28,12 @@ if [ `uname` = "FreeBSD" ]; then fi cp ${KEEPSYMS_IN} ${KEEPSYMS} # get all symbols from libc and turn them into patterns -nm ${NM_FLAG} p -g -D ${LIBC_SO} | sed 's/\([^ @]*\).*/^\1$/' >> ${KEEPSYMS} +${NM} ${NM_FLAG} posix -g -D ${LIBC_SO} | sed 's/\([^ @]*\).*/^\1$/' >> ${KEEPSYMS} # build the object "$@" # rename the symbols in the object -nm ${NM_FLAG} p -g ${OUT} | cut -f1 -d' ' | grep -v -f ${KEEPSYMS} | sed -e "s/\(.*\)/\1\ ${PREFIX}_\1/" >> ${SYMSFILE} +${NM} ${NM_FLAG} posix -g ${OUT} | cut -f1 -d' ' | grep -v -f ${KEEPSYMS} | sed -e "s/\(.*\)/\1\ ${PREFIX}_\1/" >> ${SYMSFILE} if test -s ${SYMSFILE} then - objcopy --redefine-syms=${SYMSFILE} ${OUT} + ${OBJCOPY} --redefine-syms=${SYMSFILE} ${OUT} fi diff --git a/cmake/cflags-generic.cmake b/cmake/cflags-generic.cmake index 28a05493..7551690c 100644 --- a/cmake/cflags-generic.cmake +++ b/cmake/cflags-generic.cmake @@ -36,11 +36,9 @@ if(NETBSD) set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -DHAVE_BUILTIN_POPCOUNT") endif() -if(MACOSX) - # Boost headers cause such complains on MacOS - set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter") - set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter") -endif() +# Boost headers cause such complains on MacOS or when building with LLVM toolchains +set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter") +set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter") # these end up in the config file CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAS_C_HIDDEN)