build: cleanup SSP_SUPPORT configure option

Configure variable SSP_SUPPORT is ambiguous for packages (tor, openssh,
avahi, freeswitch). It means 'toolchain supporting SSP', but for toolchain
and depends it means 'build gcc with libssp'.

Musl no longer uses libssp (1877bc9d8f), it has internal support, so
SSP_SUPPORT was disabled leading some package to not use SSP.

No information why Glibc and uClibc use libssp, but they may also provide
their own SSP support. uClibc used it own with commit 933b588e25 but it was
reverted in f3cacb9e84 without details.

Create an new configure GCC_LIBSSP and automatically enable SSP_SUPPORT
if either USE_MUSL or GCC_LIBSSP.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
owl
Julien Dusser 2018-01-07 18:47:21 +01:00 committed by Hauke Mehrtens
parent 55779569eb
commit 241e6dd3e9
6 changed files with 11 additions and 7 deletions

View File

@ -210,11 +210,11 @@ menu "Global build settings"
bool "None" bool "None"
config PKG_CC_STACKPROTECTOR_REGULAR config PKG_CC_STACKPROTECTOR_REGULAR
bool "Regular" bool "Regular"
select SSP_SUPPORT if !USE_MUSL select GCC_LIBSSP if !USE_MUSL
depends on KERNEL_CC_STACKPROTECTOR_REGULAR depends on KERNEL_CC_STACKPROTECTOR_REGULAR
config PKG_CC_STACKPROTECTOR_STRONG config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong" bool "Strong"
select SSP_SUPPORT if !USE_MUSL select GCC_LIBSSP if !USE_MUSL
depends on !GCC_VERSION_4_8 depends on !GCC_VERSION_4_8
depends on KERNEL_CC_STACKPROTECTOR_STRONG depends on KERNEL_CC_STACKPROTECTOR_STRONG
endchoice endchoice

View File

@ -5,7 +5,7 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
PKG_DEFAULT_DEPENDS = +libc +SSP_SUPPORT:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread PKG_DEFAULT_DEPENDS = +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
ifneq ($(PKG_NAME),toolchain) ifneq ($(PKG_NAME),toolchain)
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2))) PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))

View File

@ -83,7 +83,7 @@ endef
define Package/libssp define Package/libssp
$(call Package/gcc/Default) $(call Package/gcc/Default)
DEPENDS+=@SSP_SUPPORT DEPENDS+=@GCC_LIBSSP
TITLE:=GCC support library TITLE:=GCC support library
endef endef

View File

@ -286,6 +286,10 @@ config USE_MUSL
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64) default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64)
bool bool
config SSP_SUPPORT
default y if USE_MUSL || GCC_LIBSSP
bool
config USE_EXTERNAL_LIBC config USE_EXTERNAL_LIBC
bool bool
default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN

View File

@ -52,9 +52,9 @@ config GCC_DEFAULT_SSP
help help
Use gcc configure option --enable-default-ssp to turn on -fstack-protector-strong by default. Use gcc configure option --enable-default-ssp to turn on -fstack-protector-strong by default.
config SSP_SUPPORT config GCC_LIBSSP
bool bool
prompt "Enable Stack-Smashing Protection support" if TOOLCHAINOPTS prompt "Build gcc libssp" if TOOLCHAINOPTS
depends on !USE_MUSL depends on !USE_MUSL
default y if !USE_MUSL default y if !USE_MUSL
help help

View File

@ -143,7 +143,7 @@ ifneq ($(CONFIG_GCC_DEFAULT_SSP),)
--enable-default-ssp --enable-default-ssp
endif endif
ifneq ($(CONFIG_SSP_SUPPORT),) ifneq ($(CONFIG_GCC_LIBSSP),)
GCC_CONFIGURE+= \ GCC_CONFIGURE+= \
--enable-libssp --enable-libssp
else else