Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Cross-compilation settings for arm-apple-darwin ("M1 Macs") #33

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,47 @@ jobs:
ifconfig
- name: Install build dependencies of VDE
run: brew install autoconf automake
- name: Install VDE
- name: Make and Install VDE
run: |
git clone https://github.com/virtualsquare/vde-2.git /tmp/vde-2
cd /tmp/vde-2
# Dec 12, 2021
git checkout 74278b9b7cf816f0356181f387012fdeb6d65b52
autoreconf -fis
# compile for x86_64
./configure --prefix=/opt/vde
make
sudo make install
- name: Make
run: make PREFIX=/opt/vde
- name: Install
run: sudo make PREFIX=/opt/vde install
make PREFIX=/opt/vde
sudo make PREFIX=/opt/vde install
# cleanup
make distclean
# cross-compile for arm64
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export CC=$(xcrun --sdk macosx --find clang)
export CXX=$(xcrun --sdk macosx --find clang++)
export CFLAGS="-arch arm64e -isysroot $SDKROOT -Wno-error=implicit-function-declaration"
export CXXFLAGS=$CFLAGS
./configure --prefix=/opt/vde.arm64 --host=arm-apple-darwin --target=arm-apple-darwin --build=x86_64-apple-darwin
make PREFIX=/opt/vde.arm64
sudo make PREFIX=/opt/vde.arm64 install
unset SDKROOT CC CXX CFLAGS CXXFLAGS
- name: Make and Install vde_vmnet (x86_64)
run: |
git clone https://github.com/lima-vm/vde_vmnet.git /tmp/vde_vmnet
cd /tmp/vde_vmnet
make PREFIX=/opt/vde
sudo make PREFIX=/opt/vde install
- name: Cleanup
run: |
make clean
- name: Make and Install vde_vmnet (arm64)
run: |
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export CC=$(xcrun --sdk macosx --find clang)
export CXX=$(xcrun --sdk macosx --find clang++)
export CFLAGS="-arch arm64e -isysroot $SDKROOT -Wno-error=implicit-function-declaration"
export CXXFLAGS=$CFLAGS
make PREFIX=/opt/vde.arm64
sudo make PREFIX=/opt/vde.arm64 install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to install arm64 binary.

Probably you should install the binaries in name: Make section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment.

This should fix the issue, I assume.

- name: Print launchd status (shared mode)
run: launchctl print system/io.github.lima-vm.vde_vmnet.plist
- name: Install test dependencies
Expand Down