From bf6c2ea9ab712a8215154840085357a141c30067 Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Fri, 11 Aug 2023 02:31:55 +0000 Subject: [PATCH] Add macOS x86 support Bringing it back as we are now running on GitHub Actions. --- .github/workflows/pr.yml | 74 ++++++++++++++++++++++++++ .github/workflows/update-lib-cache.yml | 17 ++++++ README.md | 2 +- RELEASE_PROCESS.md | 1 + src/libponyc/codegen/genexe.c | 4 -- 5 files changed, 93 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 299f6d2020..200d810618 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -286,6 +286,7 @@ jobs: run: make cross-libponyrt config=release CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ arch=armv7-a cross_cflags="-march=armv7-a -mtune=cortex-a9" cross_lflags="-O3;-march=arm" - name: Test with Release Cross-Compiled Runtime run: make test-cross-ci config=release PONYPATH=../armv7-a/release cross_triple=arm-unknown-linux-gnueabihf cross_arch=armv7-a cross_cpu=cortex-a9 cross_linker=arm-linux-gnueabihf-gcc cross_runner="qemu-arm-static -cpu cortex-a9 -L /usr/local/arm-linux-gnueabihf/libc" +<<<<<<< HEAD aarch64-linux: runs-on: ubuntu-latest @@ -335,3 +336,76 @@ jobs: run: make cross-libponyrt config=release CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ arch=armv8-a cross_cflags="-march=armv8-a -mtune=cortex-a53" cross_lflags="-O3;-march=aarch64" - name: Test with Release Cross-Compiled Runtime run: make test-cross-ci config=release PONYPATH=../armv8-a/release cross_triple=aarch64-unknown-linux-gnu cross_arch=armv8-a cross_cpu=cortex-a53 cross_linker=aarch64-linux-gnu-gcc cross_runner="qemu-aarch64-static -cpu cortex-a53 -L /usr/local/aarch64-linux-gnu/libc" +||||||| parent of 41daaac1 (Add macOS x86 support) +======= + + x86_64-macos: + runs-on: macos-13 + + name: x86-64 Apple Darwin + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v3 + with: + path: build/libs + key: libs-x86-macos-13-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.restore-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: build/libs + key: libs-x86-macos-13-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Debug Runtime + run: | + make configure arch=x86-64 config=debug + make build config=debug + - name: Test with Debug Runtime + run: make test-ci config=debug usedebugger=lldb + - name: Build Release Runtime + run: | + make configure arch=x86-64 config=release + make build config=release + - name: Test with Release Runtime + run: make test-ci config=release usedebugger=lldb + + x86_64-macos-12: + runs-on: macos-12 + + name: x86-64 Apple Darwin - 12 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v3 + with: + path: build/libs + key: libs-x86-macos-12-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.restore-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: build/libs + key: libs-x86-macos-12-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Debug Runtime + run: | + make configure arch=x86-64 config=debug + make build config=debug + - name: Test with Debug Runtime + run: make test-ci config=debug + - name: Build Release Runtime + run: | + make configure arch=x86-64 config=release + make build config=release + - name: Test with Release Runtime + run: make test-ci config=release +>>>>>>> 41daaac1 (Add macOS x86 support) diff --git a/.github/workflows/update-lib-cache.yml b/.github/workflows/update-lib-cache.yml index aba9980509..70b6fbe114 100644 --- a/.github/workflows/update-lib-cache.yml +++ b/.github/workflows/update-lib-cache.yml @@ -41,3 +41,20 @@ jobs: - name: Build Libs if: steps.cache-libs.outputs.cache-hit != 'true' run: make libs build_flags=-j8 + + x86_64-macos: + runs-on: macos-13 + + name: x86-64 Apple Darwin + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache Libs + id: restore-libs + uses: actions/cache@v3 + with: + path: build/libs + key: libs-x86-macos-13-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }} + - name: Build Libs + if: steps.restore-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 diff --git a/README.md b/README.md index 78f705172b..0676723ad9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Pony is still pre-1.0 and as such, semi-regularly introduces breaking changes. T * FreeBSD * Linux -* macOS (Apple Silicon only) +* macOS * Windows 10 ### CPUs diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 0a97c5eec9..8e5f5db5ba 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -45,6 +45,7 @@ You can verify that the release artifacts were successfully built and uploaded b Package names will be: * ponyc-arm64-apple-darwin.tar.gz +* ponyc-x86-64-apple-darwin.tar.gz * ponyc-x86-64-unknown-freebsd-13.1.tar.gz * ponyc-x86-64-pc-windows-msvc.zip * ponyc-x86-64-unknown-linux-musl.tar.gz diff --git a/src/libponyc/codegen/genexe.c b/src/libponyc/codegen/genexe.c index 2144834833..106fbe2094 100644 --- a/src/libponyc/codegen/genexe.c +++ b/src/libponyc/codegen/genexe.c @@ -293,11 +293,7 @@ static bool link_exe(compile_t* c, ast_t* program, char* ld_cmd = (char*)ponyint_pool_alloc_size(ld_len); snprintf(ld_cmd, ld_len, -#if defined(PLATFORM_IS_ARM) "%s -execute -arch %.*s " -#else - "%s -execute -no_pie -arch %.*s " -#endif "-o %s %s %s %s " "-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem %s", linker, (int)arch_len, c->opt->triple, file_exe, file_o,