1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00

Merge pull request #194 from Ysurac/develop

Fix compilation using GO
This commit is contained in:
suyuan 2021-12-17 15:37:40 +08:00 committed by GitHub
commit 1e434abd98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,10 +13,11 @@ endif
# Unset environment variables # Unset environment variables
# There are more magic variables to track down, but ain't nobody got time for that # There are more magic variables to track down, but ain't nobody got time for that
# From https://golang.org/cmd/go/#hdr-Environment_variables # From https://pkg.go.dev/cmd/go#hdr-Environment_variables
# General-purpose environment variables: # General-purpose environment variables:
unexport \ unexport \
GO111MODULE \
GCCGO \ GCCGO \
GOARCH \ GOARCH \
GOBIN \ GOBIN \
@ -36,6 +37,7 @@ unexport \
# GONOPROXY # GONOPROXY
# GOSUMDB # GOSUMDB
# GONOSUMDB # GONOSUMDB
# GOVCS
# Environment variables for use with cgo: # Environment variables for use with cgo:
unexport \ unexport \
@ -63,23 +65,20 @@ unexport \
# Special-purpose environment variables: # Special-purpose environment variables:
unexport \ unexport \
GCCGOTOOLDIR \ GCCGOTOOLDIR \
GOEXPERIMENT \
GOROOT_FINAL \ GOROOT_FINAL \
GO_EXTLINK_ENABLED GO_EXTLINK_ENABLED
# Unmodified: # Unmodified:
# GIT_ALLOW_PROTOCOL # GIT_ALLOW_PROTOCOL
# From https://golang.org/cmd/go/#hdr-Module_support # From https://pkg.go.dev/runtime#hdr-Environment_Variables
unexport \
GO111MODULE
# From https://golang.org/pkg/runtime/#hdr-Environment_Variables
unexport \ unexport \
GOGC \ GOGC \
GOMAXPROCS \ GOMAXPROCS \
GORACE \ GORACE \
GOTRACEBACK GOTRACEBACK
# From https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command # From https://pkg.go.dev/cmd/cgo#hdr-Using_cgo_with_the_go_command
unexport \ unexport \
CC_FOR_TARGET \ CC_FOR_TARGET \
CXX_FOR_TARGET CXX_FOR_TARGET
@ -111,10 +110,6 @@ unexport \
BOOT_GO_GCFLAGS \ BOOT_GO_GCFLAGS \
BOOT_GO_LDFLAGS BOOT_GO_LDFLAGS
# From https://golang.org/src/cmd/dist/buildruntime.go
unexport \
GOEXPERIMENT
# From https://golang.org/src/cmd/dist/buildtool.go # From https://golang.org/src/cmd/dist/buildtool.go
unexport \ unexport \
GOBOOTSTRAP_TOOLEXEC GOBOOTSTRAP_TOOLEXEC
@ -148,8 +143,11 @@ else
endif endif
ifeq ($(GO_ARCH),386) ifeq ($(GO_ARCH),386)
# ensure binaries can run on older CPUs ifeq ($(CONFIG_TARGET_x86_geode)$(CONFIG_TARGET_x86_legacy),y)
GO_386:=387 GO_386:=softfloat
else
GO_386:=sse2
endif
# -fno-plt: causes "unexpected GOT reloc for non-dynamic symbol" errors # -fno-plt: causes "unexpected GOT reloc for non-dynamic symbol" errors
GO_CFLAGS_TO_REMOVE:=-fno-plt GO_CFLAGS_TO_REMOVE:=-fno-plt
@ -195,19 +193,23 @@ GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mips64||mips64el||mipsel||pow
# ASLR/PIE # ASLR/PIE
# From https://golang.org/src/cmd/internal/sys/supported.go
GO_PIE_SUPPORTED_OS_ARCH:= \ GO_PIE_SUPPORTED_OS_ARCH:= \
android_386 android_amd64 android_arm android_arm64 \ android_386 android_amd64 android_arm android_arm64 \
linux_386 linux_amd64 linux_arm linux_arm64 \ linux_386 linux_amd64 linux_arm linux_arm64 \
\ \
windows_386 windows_amd64 windows_arm \ windows_386 windows_amd64 windows_arm \
\ \
darwin_amd64 \ darwin_amd64 darwin_arm64 \
ios_amd64 ios_arm64 \
\
freebsd_amd64 \ freebsd_amd64 \
\ \
aix_ppc64 \ aix_ppc64 \
\ \
linux_ppc64le linux_s390x linux_ppc64le linux_riscv64 linux_s390x
# From https://golang.org/src/cmd/go/internal/work/init.go
go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm),,shared) go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm),,shared)
ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),) ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)
@ -236,7 +238,7 @@ endif
# General build info # General build info
GO_BUILD_CACHE_DIR:=$(or $(call qstrip,$(CONFIG_GOLANG_BUILD_CACHE_DIR)),$(TOPDIR)/.go-build) GO_BUILD_CACHE_DIR:=$(or $(call qstrip,$(CONFIG_GOLANG_BUILD_CACHE_DIR)),$(TMP_DIR)/go-build)
GO_MOD_CACHE_DIR:=$(DL_DIR)/go-mod-cache GO_MOD_CACHE_DIR:=$(DL_DIR)/go-mod-cache
GO_MOD_ARGS= \ GO_MOD_ARGS= \
@ -249,6 +251,6 @@ GO_GENERAL_BUILD_CONFIG_VARS= \
GO_MOD_ARGS="$(GO_MOD_ARGS)" GO_MOD_ARGS="$(GO_MOD_ARGS)"
define Go/CacheCleanup define Go/CacheCleanup
$(GENERAL_BUILD_CONFIG_VARS) \ $(GO_GENERAL_BUILD_CONFIG_VARS) \
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh cache_cleanup $(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh cache_cleanup
endef endef