diff options
| author | Paul Spooren | 2026-10-07 13:54:31 +0000 |
|---|---|---|
| committer | Paul Spooren | 2026-10-10 11:04:30 +0000 |
| commit | b71d03a79cabe2d9d627e365046d99858287b21c (patch) | |
| tree | 4119c9ac8f5ab411a9ddbf80a02300882930e869 | |
| parent | 53ec2d05a487e6011cfa096de9211d15197c501b (diff) | |
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 <mail@aparcar.org>
| -rw-r--r-- | package/libs/openssl/Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 222bbffb66..affcde8204 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)" \ |