diff options
author | Jeffery To <jeffery.to@gmail.com> | 2020-01-15 19:36:09 +0800 |
---|---|---|
committer | Jeffery To <jeffery.to@gmail.com> | 2020-01-15 19:36:09 +0800 |
commit | b621d1b0f39cc62f25d4974643e9b02b25bb6158 (patch) | |
tree | 117b270568681282cca1997b92a797ee51cc3404 /lang | |
parent | 7f1704f357b58f93aed3a0d692a04fc08013e85d (diff) |
golang: Update for ASLR PIE tristate option change
The ASLR PIE option was changed to a tristate option
(openwrt/openwrt@19cbac7d264dfca1f75849de64beb98830fbb1e4). This updates
the Go compiler package and golang-package.mk to account for this
change.
This also adds warning messages for when the user has selected PIE but
Go does not have PIE support for the chosen target.
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang')
-rw-r--r-- | lang/golang/golang-package.mk | 14 | ||||
-rw-r--r-- | lang/golang/golang/Makefile | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lang/golang/golang-package.mk b/lang/golang/golang-package.mk index 235585b20..2d558565c 100644 --- a/lang/golang/golang-package.mk +++ b/lang/golang/golang-package.mk @@ -120,10 +120,22 @@ GO_PKG_BUILD_BIN_DIR:=$(GO_PKG_BUILD_DIR)/bin$(if $(GO_HOST_TARGET_DIFFERENT),/$ GO_PKG_BUILD_DEPENDS_SRC:=$(STAGING_DIR)$(GO_PKG_PATH)/src -ifeq ($(CONFIG_PKG_ASLR_PIE),y) +ifdef CONFIG_PKG_ASLR_PIE_ALL ifeq ($(strip $(PKG_ASLR_PIE)),1) ifeq ($(GO_TARGET_PIE_SUPPORTED),1) GO_PKG_ENABLE_PIE:=1 + else + $(warning PIE buildmode is not supported for $(GO_OS)/$(GO_ARCH)) + endif + endif +endif + +ifdef CONFIG_PKG_ASLR_PIE_REGULAR + ifeq ($(strip $(PKG_ASLR_PIE_REGULAR)),1) + ifeq ($(GO_TARGET_PIE_SUPPORTED),1) + GO_PKG_ENABLE_PIE:=1 + else + $(warning PIE buildmode is not supported for $(GO_OS)/$(GO_ARCH)) endif endif endif diff --git a/lang/golang/golang/Makefile b/lang/golang/golang/Makefile index 8bfb8260f..ca27eae94 100644 --- a/lang/golang/golang/Makefile +++ b/lang/golang/golang/Makefile @@ -92,10 +92,12 @@ BOOTSTRAP_UNPACK:=$(HOST_TAR) -C $(BOOTSTRAP_BUILD_DIR) --strip-components=1 -xz RSTRIP:=: STRIP:=: -ifeq ($(CONFIG_PKG_ASLR_PIE),y) +ifdef CONFIG_PKG_ASLR_PIE_ALL ifeq ($(GO_TARGET_PIE_SUPPORTED),1) PKG_GO_ENABLE_PIE:=1 PKG_GO_INSTALL_SUFFIX:=$(GO_TARGET_PIE_INSTALL_SUFFIX) + else + $(warning PIE buildmode is not supported for $(GO_OS)/$(GO_ARCH)) endif endif |