Skip to content

Commit

Permalink
no sysroot?
Browse files Browse the repository at this point in the history
  • Loading branch information
iameli committed Oct 10, 2023
1 parent 7abf893 commit 9682239
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ ifeq ($(BUILDOS),linux)
ifeq ($(BUILDARCH),amd64)
ifeq ($(GOARCH),arm64)
ifeq ($(GOOS),linux)
SYSROOT ?= /usr/aarch64-linux-gnu
cgo_cflags += --target=aarch64-linux-gnu
cgo_ldflags += --target=aarch64-linux-gnu
cc = clang --sysroot=$(SYSROOT)
cc = clang
endif
endif
endif
Expand Down
8 changes: 3 additions & 5 deletions install_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ function check_sysroot() {
}

if [[ "$BUILDARCH" == "amd64" && "$BUILDOS" == "linux" && "$GOARCH" == "arm64" && "$GOOS" == "linux" ]]; then
SYSROOT="${SYSROOT:-"/usr/aarch64-linux-gnu"}"
check_sysroot
echo "cross-compiling linux-amd64 --> linux-arm64"
export CC="clang --sysroot=$SYSROOT"
export CC="clang"
EXTRA_CFLAGS="--target=aarch64-linux-gnu -I/usr/local/cuda_arm64/include $EXTRA_CFLAGS"
EXTRA_LDFLAGS="--target=aarch64-linux-gnu -L/usr/local/cuda_arm64/lib64 $EXTRA_LDFLAGS"
EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --arch=aarch64 --enable-cross-compile --cc=clang --sysroot=$SYSROOT"
EXTRA_LDFLAGS="-fuse-ld=lld --target=aarch64-linux-gnu -L/usr/local/cuda_arm64/lib64 $EXTRA_LDFLAGS"
EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --arch=aarch64 --enable-cross-compile --cc=clang"
HOST_OS="--host=aarch64-linux-gnu"
fi

Expand Down

0 comments on commit 9682239

Please sign in to comment.