Skip to content

Commit

Permalink
Ensure C pre-processor and compiler are correctly configured for x86 …
Browse files Browse the repository at this point in the history
…builds.
  • Loading branch information
freakboy3742 committed Sep 23, 2022
1 parent ea77c27 commit 7b4e73e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}

build:
runs-on: macOS-12.0
runs-on: macOS-12
needs: make-release
strategy:
max-parallel: 4
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,12 @@ TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))-simulato
endif

SDK_ROOT-$(target)=$$(shell xcrun --sdk $$(SDK-$(target)) --show-sdk-path)
CC-$(target)=xcrun --sdk $$(SDK-$(target)) clang
CC-$(target)=xcrun --sdk $$(SDK-$(target)) clang -target $$(TARGET_TRIPLE-$(target))
CPP-$(target)=xcrun --sdk $$(SDK-$(target)) clang -target $$(TARGET_TRIPLE-$(target)) -E
CXX-$(target)=xcrun --sdk $$(SDK-$(target)) clang
AR-$(target)=xcrun --sdk $$(SDK-$(target)) ar
CFLAGS-$(target)=\
-target $$(TARGET_TRIPLE-$(target)) \
$$(CFLAGS-$(os))
LDFLAGS-$(target)=\
-target $$(TARGET_TRIPLE-$(target)) \
$$(CFLAGS-$(os))
CFLAGS-$(target)=$$(CFLAGS-$(os))
LDFLAGS-$(target)=$$(CFLAGS-$(os))

###########################################################################
# Target: BZip2
Expand Down Expand Up @@ -550,6 +547,7 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
./configure \
AR="$$(AR-$(target))" \
CC="$$(CC-$(target))" \
CPP="$$(CPP-$(target))" \
CXX="$$(CXX-$(target))" \
CFLAGS="$$(CFLAGS-$(target))" \
LDFLAGS="$$(LDFLAGS-$(target))" \
Expand Down Expand Up @@ -598,6 +596,7 @@ vars-$(target):
@echo "TARGET_TRIPLE-$(target): $$(TARGET_TRIPLE-$(target))"
@echo "SDK_ROOT-$(target): $$(SDK_ROOT-$(target))"
@echo "CC-$(target): $$(CC-$(target))"
@echo "CPP-$(target): $$(CPP-$(target))"
@echo "CFLAGS-$(target): $$(CFLAGS-$(target))"
@echo "LDFLAGS-$(target): $$(LDFLAGS-$(target))"
@echo "BZIP2_SRCDIR-$(target): $$(BZIP2_SRCDIR-$(target))"
Expand Down Expand Up @@ -652,10 +651,9 @@ SDK_SLICE-$(sdk)=$$(OS_LOWER-$(sdk))-$$(shell echo $$(SDK_ARCHES-$(sdk)) | sed "
endif

CC-$(sdk)=xcrun --sdk $(sdk) clang
CFLAGS-$(sdk)=\
$$(CFLAGS-$(os))
LDFLAGS-$(sdk)=\
$$(CFLAGS-$(os))
CPP-$(sdk)=xcrun --sdk $(sdk) clang -E
CFLAGS-$(sdk)=$$(CFLAGS-$(os))
LDFLAGS-$(sdk)=$$(CFLAGS-$(os))

# Predeclare SDK constants that are used by the build-target macro

Expand Down Expand Up @@ -770,6 +768,7 @@ $$(PYTHON_SRCDIR-$(sdk))/Makefile: \
cd $$(PYTHON_SRCDIR-$(sdk)) && \
./configure \
CC="$$(CC-$(sdk))" \
CPP="$$(CPP-$(sdk))" \
CFLAGS="$$(CFLAGS-$(sdk))" \
LDFLAGS="$$(LDFLAGS-$(sdk))" \
LIBLZMA_CFLAGS="-I$$(XZ_MERGE-$(sdk))/include" \
Expand Down Expand Up @@ -873,6 +872,7 @@ vars-$(sdk):
@echo "SDK_ARCHES-$(sdk): $$(SDK_ARCHES-$(sdk))"
@echo "SDK_SLICE-$(sdk): $$(SDK_SLICE-$(sdk))"
@echo "CC-$(sdk): $$(CC-$(sdk))"
@echo "CPP-$(sdk): $$(CPP-$(sdk))"
@echo "CFLAGS-$(sdk): $$(CFLAGS-$(sdk))"
@echo "LDFLAGS-$(sdk): $$(LDFLAGS-$(sdk))"
@echo "BZIP2_MERGE-$(sdk): $$(BZIP2_MERGE-$(sdk))"
Expand Down
16 changes: 8 additions & 8 deletions patch/libffi-3.4.2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ index 9921b0d..5b60ccc 100755
- copy_src_platform_files(ios_simulator64_platform)
- copy_src_platform_files(ios_device_platform)
- copy_src_platform_files(ios_device64_platform)
+ copy_src_platform_files(ios_simulator_i386_platform)
+ # copy_src_platform_files(ios_simulator_i386_platform)
+ copy_src_platform_files(ios_simulator_x86_64_platform)
+ copy_src_platform_files(ios_simulator_arm64_platform)
+ copy_src_platform_files(ios_device_armv7_platform)
+ # copy_src_platform_files(ios_device_armv7_platform)
+ copy_src_platform_files(ios_device_arm64_platform)
if generate_osx:
- copy_src_platform_files(desktop64_platform)
Expand All @@ -240,9 +240,9 @@ index 9921b0d..5b60ccc 100755
if generate_watchos:
- copy_src_platform_files(watchos_simulator_platform)
- copy_src_platform_files(watchos_device_platform)
+ copy_src_platform_files(watchos_simulator_i386_platform)
+ # copy_src_platform_files(watchos_simulator_i386_platform)
+ copy_src_platform_files(watchos_simulator_x86_64_platform)
+ copy_src_platform_files(watchos_simulator_arm64_platform)
+ # copy_src_platform_files(watchos_simulator_arm64_platform)
+ copy_src_platform_files(watchos_device_armv7k_platform)
+ copy_src_platform_files(watchos_device_arm64_32_platform)

Expand All @@ -253,10 +253,10 @@ index 9921b0d..5b60ccc 100755
- build_target(ios_simulator64_platform, platform_headers)
- build_target(ios_device_platform, platform_headers)
- build_target(ios_device64_platform, platform_headers)
+ build_target(ios_simulator_i386_platform, platform_headers)
+ # build_target(ios_simulator_i386_platform, platform_headers)
+ build_target(ios_simulator_x86_64_platform, platform_headers)
+ build_target(ios_simulator_arm64_platform, platform_headers)
+ build_target(ios_device_armv7_platform, platform_headers)
+ # build_target(ios_device_armv7_platform, platform_headers)
+ build_target(ios_device_arm64_platform, platform_headers)
if generate_osx:
- build_target(desktop64_platform, platform_headers)
Expand All @@ -271,10 +271,10 @@ index 9921b0d..5b60ccc 100755
if generate_watchos:
- build_target(watchos_simulator_platform, platform_headers)
- build_target(watchos_device_platform, platform_headers)
+ build_target(watchos_simulator_i386_platform, platform_headers)
+ # build_target(watchos_simulator_i386_platform, platform_headers)
+ build_target(watchos_simulator_x86_64_platform, platform_headers)
+ build_target(watchos_simulator_arm64_platform, platform_headers)
+ build_target(watchos_device_armv7k_platform, platform_headers)
+ # build_target(watchos_device_armv7k_platform, platform_headers)
+ build_target(watchos_device_arm64_32_platform, platform_headers)

mkdir_p('darwin_common/include')
Expand Down

0 comments on commit 7b4e73e

Please sign in to comment.