Skip to content

Commit

Permalink
bugfix: Fix glibc linking for linux. (#559)
Browse files Browse the repository at this point in the history
This commit fixes glibc linking for linux by statically linking the
entire binary instead of only the libwebp dependencies. This issue will
persist under linux arm64, but it will require more work to resolve that
static linking issue given we are cross compiling.
  • Loading branch information
betterengineering authored Jan 10, 2023
1 parent 46e166a commit 7425af3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ do
CC=aarch64-linux-gnu-gcc CGO_LDFLAGS="-Wl,-Bstatic -lwebp -lwebpdemux -lwebpmux -Wl,-Bdynamic" CGO_ENABLED=1 GOOS=$RELEASE_PLATFORM GOARCH=$RELEASE_ARCH go build -ldflags="-X 'tidbyt.dev/pixlet/cmd.Version=${PIXLET_VERSION}'" -o build/${RELEASE_PLATFORM}_${RELEASE_ARCH}/pixlet tidbyt.dev/pixlet
elif [[ $ARCH == "linux-amd64" ]]; then
echo "linux-amd64"
CGO_LDFLAGS="-Wl,-Bstatic -lwebp -lwebpdemux -lwebpmux -Wl,-Bdynamic" CGO_ENABLED=1 GOOS=$RELEASE_PLATFORM GOARCH=$RELEASE_ARCH go build -ldflags="-X 'tidbyt.dev/pixlet/cmd.Version=${PIXLET_VERSION}'" -o build/${RELEASE_PLATFORM}_${RELEASE_ARCH}/pixlet tidbyt.dev/pixlet
CGO_ENABLED=1 GOOS=$RELEASE_PLATFORM GOARCH=$RELEASE_ARCH go build -ldflags="-s -extldflags=-static -X 'tidbyt.dev/pixlet/cmd.Version=${PIXLET_VERSION}'" -o build/${RELEASE_PLATFORM}_${RELEASE_ARCH}/pixlet tidbyt.dev/pixlet
elif [[ $ARCH == "windows-amd64" ]]; then
echo "windows-amd64"
go build -ldflags="-s -extldflags=-static -X 'tidbyt.dev/pixlet/cmd.Version=${PIXLET_VERSION}'" -o build/${RELEASE_PLATFORM}_${RELEASE_ARCH}/pixlet.exe tidbyt.dev/pixlet
Expand Down

0 comments on commit 7425af3

Please sign in to comment.