Skip to content

Commit

Permalink
Remove -lpthread and -ldl from ldflags
Browse files Browse the repository at this point in the history
There is no need in those flags now when we use amalgamated sqlite3 from
mattn/go-sqlite3.

Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Sep 9, 2015
1 parent a8d6b03 commit 8845eb4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,9 @@ BUILDFLAGS=( $BUILDFLAGS "${ORIG_BUILDFLAGS[@]}" )
: ${TIMEOUT:=60m}
TESTFLAGS+=" -test.timeout=${TIMEOUT}"

# A few more flags that are specific just to building a completely-static binary (see hack/make/binary)
# PLEASE do not use these anywhere else.
EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -ldl"
LDFLAGS_STATIC_DOCKER="
$LDFLAGS_STATIC
-extldflags \"$EXTLDFLAGS_STATIC_DOCKER\"
-extldflags \"$EXTLDFLAGS_STATIC\"
"

if [ "$(uname -s)" = 'FreeBSD' ]; then
Expand Down
2 changes: 1 addition & 1 deletion hack/make/.dockerinit-gccgo
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ go build --compiler=gccgo \
--gccgoflags "
-g
-Wl,--no-export-dynamic
$EXTLDFLAGS_STATIC_DOCKER
$EXTLDFLAGS_STATIC
-lnetgo
" \
./dockerinit
Expand Down
2 changes: 1 addition & 1 deletion hack/make/dyngccgo
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi

(
export IAMSTATIC="false"
export EXTLDFLAGS_STATIC_DOCKER=''
export EXTLDFLAGS_STATIC=''
export LDFLAGS_STATIC_DOCKER=''
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
export BUILDFLAGS=( "${BUILDFLAGS[@]/static_build /}" ) # we're not building a "static" binary here
Expand Down
4 changes: 2 additions & 2 deletions hack/make/gccgo
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
source "${MAKEDIR}/.go-autogen"

if [[ "${BUILDFLAGS[@]}" =~ 'netgo ' ]]; then
EXTLDFLAGS_STATIC_DOCKER+=' -lnetgo'
EXTLDFLAGS_STATIC+=' -lnetgo'
fi
go build -compiler=gccgo \
-o "$DEST/$BINARY_FULLNAME" \
"${BUILDFLAGS[@]}" \
-gccgoflags "
-g
$EXTLDFLAGS_STATIC_DOCKER
$EXTLDFLAGS_STATIC
-Wl,--no-export-dynamic
-ldl
" \
Expand Down

0 comments on commit 8845eb4

Please sign in to comment.