Skip to content

Commit

Permalink
Add macOS x86 support
Browse files Browse the repository at this point in the history
Bringing it back as we are now running on GitHub Actions.
  • Loading branch information
SeanTAllen committed Aug 13, 2023
1 parent 3452bc4 commit bf6c2ea
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 5 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
17 changes: 17 additions & 0 deletions .github/workflows/update-lib-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/libponyc/codegen/genexe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bf6c2ea

Please sign in to comment.