@ -115,14 +115,14 @@ GO_PKG_PATH:=/usr/share/gocode
GO_PKG_BUILD_PKG ?= $( strip $( GO_PKG) ) /...
GO_PKG_WORK_DIR_NAME := .go_work
GO_PKG_WORK_DIR : =$( PKG_BUILD_DIR) /$( GO_PKG_WORK_DIR_NAME)
GO_PKG_WORK_DIR = $( PKG_BUILD_DIR) /$( GO_PKG_WORK_DIR_NAME)
GO_PKG_BUILD_DIR : =$( GO_PKG_WORK_DIR) /build
GO_PKG_CACHE_DIR : =$( GO_PKG_WORK_DIR) /cache
GO_PKG_BUILD_DIR = $( GO_PKG_WORK_DIR) /build
GO_PKG_CACHE_DIR = $( GO_PKG_WORK_DIR) /cache
GO_PKG_BUILD_BIN_DIR : =$( GO_PKG_BUILD_DIR) /bin$( if $( GO_HOST_TARGET_DIFFERENT) ,/$( GO_OS_ARCH) )
GO_PKG_BUILD_BIN_DIR = $( GO_PKG_BUILD_DIR) /bin$( if $( GO_HOST_TARGET_DIFFERENT) ,/$( GO_OS_ARCH) )
GO_PKG_BUILD_DEPENDS_SRC : =$( STAGING_DIR) $( GO_PKG_PATH) /src
GO_PKG_BUILD_DEPENDS_SRC = $( STAGING_DIR) $( GO_PKG_PATH) /src
i f d e f C O N F I G _ P K G _ A S L R _ P I E _ A L L
ifeq ( $( strip $( PKG_ASLR_PIE) ) ,1)
@ -194,37 +194,20 @@ GO_PKG_DEFAULT_LDFLAGS= \
-linkmode external \
-extldflags '$(patsubst -z%,-Wl$(comma)-z$(comma)%,$(TARGET_LDFLAGS))'
GO_PKG_INSTALL_ARGS = \
-v \
-trimpath \
-ldflags " all= $( GO_PKG_DEFAULT_LDFLAGS) "
i f e q ( $( GO_PKG_ENABLE_PIE ) , 1 )
GO_PKG_INSTALL_ARGS += -buildmode pie
e n d i f
i f e q ( $( GO_ARCH ) , a r m )
GO_PKG_INSTALL_ARGS += -installsuffix " v $( GO_ARM) "
e l s e i f n e q ( $( filter $ ( GO_ARCH ) ,mips mipsle ) , )
GO_PKG_INSTALL_ARGS += -installsuffix " $( GO_MIPS) "
e l s e i f n e q ( $( filter $ ( GO_ARCH ) ,mips 64 mips 64le ) , )
GO_PKG_INSTALL_ARGS += -installsuffix " $( GO_MIPS64) "
e n d i f
i f n e q ( $( strip $ ( GO_PKG_GCFLAGS ) ) , )
GO_PKG_INSTALL_ARGS += -gcflags " $( GO_PKG_GCFLAGS) "
e n d i f
GO_PKG_CUSTOM_LDFLAGS = \
$( GO_PKG_LDFLAGS) \
$( patsubst %,-X %,$( GO_PKG_LDFLAGS_X) )
i f n e q ( $( strip $ ( GO_PKG_CUSTOM_LDFLAGS ) ) , )
GO_PKG_INSTALL_ARGS += -ldflags " $( GO_PKG_CUSTOM_LDFLAGS) $( GO_PKG_DEFAULT_LDFLAGS) "
e n d i f
GO_PKG_INSTALL_ARGS = \
-v \
-trimpath \
-ldflags " all= $( GO_PKG_DEFAULT_LDFLAGS) " \
$( if $( filter $( GO_PKG_ENABLE_PIE) ,1) ,-buildmode pie) \
$( if $( filter $( GO_ARCH) ,arm) ,-installsuffix " v $( GO_ARM) " ) \
$( if $( filter $( GO_ARCH) ,mips mipsle) ,-installsuffix " $( GO_MIPS) " ) \
$( if $( filter $( GO_ARCH) ,mips64 mips64le) ,-installsuffix " $( GO_MIPS64) " ) \
$( if $( GO_PKG_GCFLAGS) ,-gcflags " $( GO_PKG_GCFLAGS) " ) \
$( if $( GO_PKG_CUSTOM_LDFLAGS) ,-ldflags " $( GO_PKG_CUSTOM_LDFLAGS) $( GO_PKG_DEFAULT_LDFLAGS) " )
# false if directory does not exist
G o P a c k a g e / is_dir_not_empty = $$ $$ ( $( FIND) $( 1) -maxdepth 0 -type d \! -empty 2>/dev/null)