Skip to content

Commit 5b03948

Browse files
authored
Merge pull request #33 from reishoku/arm64-cross-compile
Cross-compilation settings for arm-apple-darwin ("M1 Macs")
2 parents 7d5463a + 4ffc5f7 commit 5b03948

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,47 @@ jobs:
2626
ifconfig
2727
- name: Install build dependencies of VDE
2828
run: brew install autoconf automake
29-
- name: Install VDE
29+
- name: Make and Install VDE
3030
run: |
3131
git clone https://github.com/virtualsquare/vde-2.git /tmp/vde-2
3232
cd /tmp/vde-2
3333
# Dec 12, 2021
3434
git checkout 74278b9b7cf816f0356181f387012fdeb6d65b52
3535
autoreconf -fis
36+
# compile for x86_64
3637
./configure --prefix=/opt/vde
37-
make
38-
sudo make install
39-
- name: Make
40-
run: make PREFIX=/opt/vde
41-
- name: Install
42-
run: sudo make PREFIX=/opt/vde install
38+
make PREFIX=/opt/vde
39+
sudo make PREFIX=/opt/vde install
40+
# cleanup
41+
make distclean
42+
# cross-compile for arm64
43+
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
44+
export CC=$(xcrun --sdk macosx --find clang)
45+
export CXX=$(xcrun --sdk macosx --find clang++)
46+
export CFLAGS="-arch arm64e -isysroot $SDKROOT -Wno-error=implicit-function-declaration"
47+
export CXXFLAGS=$CFLAGS
48+
./configure --prefix=/opt/vde.arm64 --host=arm-apple-darwin --target=arm-apple-darwin --build=x86_64-apple-darwin
49+
make PREFIX=/opt/vde.arm64
50+
sudo make PREFIX=/opt/vde.arm64 install
51+
unset SDKROOT CC CXX CFLAGS CXXFLAGS
52+
- name: Make and Install vde_vmnet (x86_64)
53+
run: |
54+
git clone https://github.com/lima-vm/vde_vmnet.git /tmp/vde_vmnet
55+
cd /tmp/vde_vmnet
56+
make PREFIX=/opt/vde
57+
sudo make PREFIX=/opt/vde install
58+
- name: Cleanup
59+
run: |
60+
make clean
61+
- name: Make and Install vde_vmnet (arm64)
62+
run: |
63+
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
64+
export CC=$(xcrun --sdk macosx --find clang)
65+
export CXX=$(xcrun --sdk macosx --find clang++)
66+
export CFLAGS="-arch arm64e -isysroot $SDKROOT -Wno-error=implicit-function-declaration"
67+
export CXXFLAGS=$CFLAGS
68+
make PREFIX=/opt/vde.arm64
69+
sudo make PREFIX=/opt/vde.arm64 install
4370
- name: Print launchd status (shared mode)
4471
run: launchctl print system/io.github.lima-vm.vde_vmnet.plist
4572
- name: Install test dependencies

0 commit comments

Comments
 (0)