From b71d03a79cabe2d9d627e365046d99858287b21c Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 7 Oct 2026 15:54:31 +0200 Subject: [PATCH] openssl: probe the cross compiler regardless of the host CC libopenssl3 differs between builds depending on the environment of the build host, e.g. in the images of the Turris Omnia: -compiler: arm-openwrt-linux-muslgnueabi-gcc -fPIC -pthread -Os ... +compiler: arm-openwrt-linux-muslgnueabi-gcc -fPIC -pthread -Wa,--noexecstack -Os ... - GNU_STACK ... RWE 0x10 + GNU_STACK ... RW 0x10 Configure probes whether the assembler supports --noexecstack by running $CROSS_COMPILE$CC, with CC taken from the environment. A host which sets CC to select its compiler, e.g. CC=gcc-13, makes it run arm-openwrt-linux-muslgnueabi-gcc-13, which does not exist, so the flag is silently dropped and libcrypto ends up with an executable stack. Pass CC=gcc to Configure, so that it always probes the cross compiler. With CC=gcc-13 in the environment, the configuration now gets -Wa,--noexecstack like a build without CC set. Link: https://github.com/openwrt/openwrt/pull/25719 Signed-off-by: Paul Spooren --- package/libs/openssl/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 222bbffb66f..affcde82043 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_VERSION:=3.5.9 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto PKG_BUILD_PARALLEL:=1 @@ -366,6 +366,7 @@ TARGET_LDFLAGS += -Wl,--as-needed define Build/Configure (cd $(PKG_BUILD_DIR); \ + CC="gcc" \ CFLAGS="$(TARGET_CFLAGS)" \ CPPFLAGS="$(TARGET_CPPFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \