Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
iameli committed Oct 13, 2023
1 parent 9682239 commit d137d4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ifeq ($(BUILDOS),darwin)
ifeq ($(GOARCH),arm64)
LLVM_PATH ?= /opt/homebrew/opt/llvm/bin
SYSROOT ?= /tmp/sysroot-aarch64-linux-gnu
cgo_cflags += --target=aarch64-linux-gnu -Wno-error=unused-command-line-argument
cgo_cflags += --target=aarch64-linux-gnu -Wno-error=unused-command-line-argument -fuse-ld=$(LLVM_PATH)/ld.lld
cgo_ldflags += --target=aarch64-linux-gnu
cc = $(LLVM_PATH)/clang -fuse-ld=$(LLVM_PATH)/ld.lld --sysroot=$(SYSROOT)
endif
Expand All @@ -84,7 +84,7 @@ endif
.PHONY: livepeer livepeer_bench livepeer_cli livepeer_router docker

livepeer:
GO111MODULE=on CGO_ENABLED=1 CC="$(cc)" CGO_CFLAGS="$(cgo_cflags)" CGO_LDFLAGS="$(cgo_ldflags) ${CGO_LDFLAGS}" go build -o $(GO_BUILD_DIR) -tags "$(BUILD_TAGS)" -ldflags="$(ldflags)" cmd/livepeer/*.go
GO111MODULE=on CGO_ENABLED=1 CC="$(cc)" CGO_CFLAGS="$(cgo_cflags)" CGO_LDFLAGS="$(cgo_ldflags) ${CGO_LDFLAGS}" go build -x -o $(GO_BUILD_DIR) -tags "$(BUILD_TAGS)" -ldflags="$(ldflags)" cmd/livepeer/*.go

livepeer_cli:
GO111MODULE=on CGO_ENABLED=1 CC="$(cc)" CGO_CFLAGS="$(cgo_cflags)" CGO_LDFLAGS="$(cgo_ldflags) ${CGO_LDFLAGS}" go build -o $(GO_BUILD_DIR) -tags "$(BUILD_TAGS)" -ldflags="$(ldflags)" cmd/livepeer_cli/*.go
Expand Down
12 changes: 7 additions & 5 deletions install_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ if [[ "$BUILDARCH" == "arm64" && "$BUILDOS" == "darwin" && "$GOARCH" == "arm64"
exit 1
fi
export CC="$LLVM_PATH/clang --sysroot=$SYSROOT"
export AR="/opt/homebrew/opt/llvm/bin/llvm-ar"
export RANLIB="/opt/homebrew/opt/llvm/bin/llvm-ranlib"
EXTRA_CFLAGS="--target=aarch64-linux-gnu $EXTRA_CFLAGS"
EXTRA_LDFLAGS="--target=aarch64-linux-gnu -fuse-ld=$LLVM_PATH/ld.lld $EXTRA_LDFLAGS"
EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --arch=aarch64 --enable-cross-compile --cc=$LLVM_PATH/clang --sysroot=$SYSROOT --target-os=linux"
EXTRA_X264_FLAGS="$EXTRA_X264_FLAGS --sysroot=$SYSROOT"
EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --arch=aarch64 --enable-cross-compile --cc=$LLVM_PATH/clang --sysroot=$SYSROOT --ar=$AR --ranlib=$RANLIB --target-os=linux"
EXTRA_X264_FLAGS="$EXTRA_X264_FLAGS --sysroot=$SYSROOT --ar=$AR --ranlib=$RANLIB"
HOST_OS="--host=aarch64-linux-gnu"
fi

Expand Down Expand Up @@ -136,14 +138,14 @@ fi
if [[ ! -e "$ROOT/x264" ]]; then
git clone http://git.videolan.org/git/x264.git "$ROOT/x264"
cd "$ROOT/x264"
if [[ $GOARCH == "arm64" && $GOOS == "darwin" ]]; then
if [[ $GOARCH == "arm64" ]]; then
# newer git master, compiles on Apple Silicon
git checkout 66a5bc1bd1563d8227d5d18440b525a09bcf17ca
else
# older git master, does not compile on Apple Silicon
git checkout 545de2ffec6ae9a80738de1b2c8cf820249a2530
fi
./configure --prefix="$ROOT/compiled" --enable-pic --enable-static ${HOST_OS:-} --disable-cli --extra-cflags="$EXTRA_CFLAGS" --extra-asflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" --disable-asm $EXTRA_X264_FLAGS || (cat $ROOT/x264/config.log && exit 1)
./configure --prefix="$ROOT/compiled" --enable-pic --enable-static ${HOST_OS:-} --disable-cli --extra-cflags="$EXTRA_CFLAGS" --extra-asflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" $EXTRA_X264_FLAGS || (cat $ROOT/x264/config.log && exit 1)
make -j$NPROC
make -j$NPROC install-lib-static
fi
Expand Down Expand Up @@ -173,7 +175,7 @@ fi
DISABLE_FFMPEG_COMPONENTS=""
EXTRA_FFMPEG_LDFLAGS="$EXTRA_LDFLAGS"
# all flags which should be present for production build, but should be replaced/removed for debug build
DEV_FFMPEG_FLAGS="--disable-programs"
DEV_FFMPEG_FLAGS=""

if [[ "$BUILDOS" == "darwin" && "$GOOS" == "darwin" ]]; then
EXTRA_FFMPEG_LDFLAGS="$EXTRA_FFMPEG_LDFLAGS -framework CoreFoundation -framework Security"
Expand Down

0 comments on commit d137d4c

Please sign in to comment.