Add -fno-common for Darwin builds

This commit is contained in:
Jeffrey Walton 2021-03-23 05:55:07 -04:00
parent f6a2792353
commit a70662dae8
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 7 additions and 4 deletions

View File

@ -155,6 +155,9 @@ endif
ifneq ($(IS_DARWIN),0)
CXX ?= c++
# CRYPTOPP_CXXFLAGS += -stdlib=libc++
ifeq ($(findstring -fno-common,$(CXXFLAGS)),)
CRYPTOPP_CXXFLAGS += -fno-common
endif
IS_APPLE_LIBTOOL=$(shell libtool -V 2>&1 | $(GREP) -i -c 'Apple')
ifeq ($(IS_APPLE_LIBTOOL),1)
AR = libtool

View File

@ -273,8 +273,8 @@ if [ -z "${XCODE_SDK}" ]; then
[ "$0" = "${BASH_SOURCE[0]}" ] && exit 1 || return 1
fi
IOS_CFLAGS="-arch ${IOS_CPU} ${MIN_VER}"
IOS_CXXFLAGS="-arch ${IOS_CPU} ${MIN_VER} -stdlib=libc++"
IOS_CFLAGS="-arch ${IOS_CPU} ${MIN_VER} -fno-common"
IOS_CXXFLAGS="-arch ${IOS_CPU} ${MIN_VER} -stdlib=libc++ -fno-common"
IOS_SYSROOT="${XCODE_DEVELOPER_SDK}/${XCODE_SDK}"
if [ ! -d "${IOS_SYSROOT}" ]; then

View File

@ -290,8 +290,8 @@ if [ ! -d "${XCODE_TOOLCHAIN}" ]; then
[ "$0" = "${BASH_SOURCE[0]}" ] && exit 1 || return 1
fi
MACOS_CFLAGS="-arch $MACOS_CPU $MIN_VER"
MACOS_CXXFLAGS="-arch $MACOS_CPU $MIN_VER ${MACOS_STDLIB}"
MACOS_CFLAGS="-arch $MACOS_CPU $MIN_VER -fno-common"
MACOS_CXXFLAGS="-arch $MACOS_CPU $MIN_VER ${MACOS_STDLIB} -fno-common"
MACOS_SYSROOT="${XCODE_DEVELOPER_SDK}/${XCODE_SDK}"
if [ ! -d "${MACOS_SYSROOT}" ]; then