Skip to content

Commit

Permalink
Build v8 for linux_arm64 (rogchap#223)
Browse files Browse the repository at this point in the history
* Build v8 for linux_arm64

* Update V8 static library for ubuntu-18.04 arm64

Co-authored-by: epk <[email protected]>
  • Loading branch information
epk and epk authored Dec 22, 2021
1 parent e635d48 commit 943fcf9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/v8build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode
platform: [ubuntu-18.04, macos-11]
arch: [x86_64, arm64]
exclude:
- platform: ubuntu-18.04
arch: arm64
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
Expand All @@ -29,6 +26,9 @@ jobs:
- name: Update depot_tools fetch config
run: cd deps/depot_tools && git config --unset-all remote.origin.fetch; git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
shell: bash
- name: Install g++-aarch64-linux-gnu
if: matrix.platform == 'ubuntu-18.04' && matrix.arch == 'arm64'
run: sudo apt update && sudo apt install g++-aarch64-linux-gnu -y
- name: Build V8 linux
if: matrix.platform == 'ubuntu-18.04'
run: cd deps && ./build.py --no-clang --arch ${{ matrix.arch }}
Expand Down
4 changes: 3 additions & 1 deletion cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ package v8go
// #cgo LDFLAGS: -pthread -lv8
// #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/deps/darwin_x86_64
// #cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/deps/darwin_arm64
// #cgo linux LDFLAGS: -L${SRCDIR}/deps/linux_x86_64 -ldl
// #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/deps/linux_x86_64 -ldl
// #cgo linux,arm64 LDFLAGS: -L${SRCDIR}/deps/linux_arm64 -ldl
import "C"

// These imports forces `go mod vendor` to pull in all the folders that
Expand All @@ -20,5 +21,6 @@ import (
_ "rogchap.com/v8go/deps/darwin_arm64"
_ "rogchap.com/v8go/deps/darwin_x86_64"
_ "rogchap.com/v8go/deps/include"
_ "rogchap.com/v8go/deps/linux_arm64"
_ "rogchap.com/v8go/deps/linux_x86_64"
)
2 changes: 1 addition & 1 deletion deps/depot_tools
Submodule depot_tools updated from 85d7fe to db41ee
Binary file added deps/linux_arm64/libv8.a
Binary file not shown.
3 changes: 3 additions & 0 deletions deps/linux_arm64/vendor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package linux_arm64 is required to provide support for vendoring modules
// DO NOT REMOVE
package linux_arm64

0 comments on commit 943fcf9

Please sign in to comment.