rbutil: Pass isysroot to rbutil libs on macOS.

On macOS we pass the full path to the compiler. On recent versions this
causes the compiler to not find its SDK path, this needs to get passed
via the isysroot option.

Change-Id: Iea2820e1755cc80e12691119dfa31d70938ea511
This commit is contained in:
Dominik Riebeling 2020-10-18 18:53:48 +02:00
parent d097742155
commit a05d061aa3
6 changed files with 20 additions and 0 deletions

View file

@ -75,6 +75,9 @@ ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
# that to determine if we need to set arch and isysroot.
ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__)
GCCFLAGS += -mmacosx-version-min=10.5
ifneq ($(ISYSROOT),)
GCCFLAGS += -isysroot $(ISYSROOT)
endif
else
# when building libs for OS X 10.4+ build for both i386 and ppc at the same time.
# This creates fat objects, and ar can only create the archive but not operate

View file

@ -32,6 +32,7 @@ export CXXFLAGS=$(EXTRALIB_CXXFLAGS)
export CC=$(EXTRALIBS_CC)
export CXX=$(EXTRALIBS_CXX)
export AR=$(EXTRALIBS_AR)
export ISYSROOT=$(EXTRALIB_ISYSROOT)
libs: librbspeex libucl libipodpatcher libsansapatcher libmkamsboot libmktccboot libmkmpioboot libchinachippatcher libmkimxboot libmks5lboot libbzip2 libbspatch librbtomcrypt

View file

@ -35,6 +35,12 @@ EXTRALIBS_OPTS += EXTRALIBS_CC=\"$$QMAKE_CC\"
EXTRALIBS_OPTS += EXTRALIBS_CXX=\"$$QMAKE_CXX\"
EXTRALIBS_OPTS += EXTRALIB_CFLAGS=\"$$MACHINEFLAGS\"
EXTRALIBS_OPTS += EXTRALIB_CXXFLAGS=\"$$MACHINEFLAGS\"
macx {
# on recent macOS we need to pass isysroot to the libs, otherwise it won't find
# the standard libaries. This is caused by the passed compiler (doesn't rely on
# default compiler but passed full path)
EXTRALIBS_OPTS += EXTRALIB_ISYSROOT=\"$$QMAKE_MAC_SDK.macosx.Path\"
}
MYBUILDDIR = $$OUT_PWD/build/
MYLIBBUILDDIR = $$MYBUILDDIR/libs/

View file

@ -41,6 +41,9 @@ ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
# that to determine if we need to set arch and isysroot.
ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__)
CFLAGS += -mmacosx-version-min=10.5
ifneq ($(ISYSROOT),)
CFLAGS += -isysroot $(ISYSROOT)
endif
else
# when building libs for OS X 10.4+ build for both i386 and ppc at the same time.
# This creates fat objects, and ar can only create the archive but not operate

View file

@ -36,6 +36,9 @@ ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
# that to determine if we need to set arch and isysroot.
ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__)
CFLAGS += -mmacosx-version-min=10.5
ifneq ($(ISYSROOT),)
CFLAGS += -isysroot $(ISYSROOT)
endif
else
# when building libs for OS X 10.4+ build for both i386 and ppc at the same time.
# This creates fat objects, and ar can only create the archive but not operate

View file

@ -16,6 +16,10 @@ endif
CFLAGS := -O3 -g -std=c99 -Wall $(DEFINES) -Isrc/headers
LDFLAGS :=
ifneq ($(ISYSROOT),)
CFLAGS += -isysroot $(ISYSROOT)
endif
SOURCES := \
src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c \
src/misc/crypt/crypt_argchk.c src/misc/crypt/crypt_register_cipher.c src/misc/crypt/crypt_cipher_is_valid.c src/misc/crypt/crypt_cipher_descriptor.c \