From 2e58ecb3c9d167600c77aed54d985ac124dea9c0 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sat, 16 Aug 2025 05:43:10 +0800 Subject: [PATCH] build exern btyacc with fPIC --- btyacc-honour-build-flags.patch | 12 ++++++++++++ examples-honour-build-flags.patch | 28 ++++++++++++++++++++++++++++ firebird.spec | 8 +++++++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 btyacc-honour-build-flags.patch create mode 100644 examples-honour-build-flags.patch diff --git a/btyacc-honour-build-flags.patch b/btyacc-honour-build-flags.patch new file mode 100644 index 0000000..cb9f38c --- /dev/null +++ b/btyacc-honour-build-flags.patch @@ -0,0 +1,12 @@ +--- a/extern/btyacc/Makefile 2022-08-12 15:24:40.846774310 +0200 ++++ a/extern/btyacc/Makefile 2022-08-12 15:26:20.954809720 +0200 +@@ -12,7 +12,7 @@ + # across all of our supported compilers/platforms. + + # Vanilla CFLAGS +-CFLAGS= ++CFLAGS=-fPIC -pie + + # No LDFLAGS + #LDFLAGS= + diff --git a/examples-honour-build-flags.patch b/examples-honour-build-flags.patch new file mode 100644 index 0000000..fc7ebd9 --- /dev/null +++ b/examples-honour-build-flags.patch @@ -0,0 +1,28 @@ +diff --git a/builds/posix/Makefile.in.plugins_examples b/builds/posix/Makefile.in.plugins_examples +index 989e80d..344f487 100644 +--- a/builds/posix/Makefile.in.plugins_examples ++++ b/builds/posix/Makefile.in.plugins_examples +@@ -101,7 +101,7 @@ AllObjects += $(CA_Objects) + crypt_app: $(CRYPT_APP) + + $(CRYPT_APP): $(CA_Objects) +- $(EXE_LINK) $(LSB_UNDEF) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) ++ $(EXE_LINK) $(EXE_LINK_OPTIONS) $(LSB_UNDEF) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) + + + include $(ROOT)/gen/make.shared.targets +diff --git a/examples/extauth/Makefile b/examples/extauth/Makefile +index 3c8b878..7de22a8 100644 +--- a/examples/extauth/Makefile ++++ b/examples/extauth/Makefile +@@ -61,8 +61,8 @@ KEYGEN_objects=$(INTERMED)/keygen.o + TCWRAP_objects=$(INTERMED)/TcWrapper.o + KEY_AUTH_objects=$(INTERMED)/ExtAuth.o + +-CXXFLAGS=-std=c++17 -pthread -I$(ROOT)/include -fPIC $(TOMCRYPT_COMPILE) +-LDFLAGS=-pthread -L$(LIB) -Wl,-rpath,'$$ORIGIN/../lib' $(TOMCRYPT_LINK) ++CXXFLAGS+=-std=c++17 -pthread -I$(ROOT)/include -fPIC $(TOMCRYPT_COMPILE) ++LDFLAGS+=-pthread -L$(LIB) -Wl,-rpath,'$$ORIGIN/../lib' $(TOMCRYPT_LINK) + + LINK_LIBS=-lfbclient -ltomcrypt -ltommath + diff --git a/firebird.spec b/firebird.spec index fabb9cc..9f3a51b 100644 --- a/firebird.spec +++ b/firebird.spec @@ -8,7 +8,7 @@ Name: firebird Version: %{ver}.%{rev} -Release: 1 +Release: 2 Summary: SQL relational database management system License: Interbase-1.0 @@ -25,6 +25,8 @@ Patch0001: no-copy-from-icu.patch Patch0002: cloop-honour-build-flags.patch Patch0003: 0001-add-loongarch64-support-for-Firebird.patch Patch0004: 0002-Add-riscv64-define-for-cds.patch +Patch0005: btyacc-honour-build-flags.patch +Patch0006: examples-honour-build-flags.patch BuildRequires: autoconf BuildRequires: automake @@ -316,6 +318,10 @@ fi %{_bindir}/gsplit %changelog +* Sat Aug 16 2025 Funda Wang - 5.0.3.1683-2 +- build extern btyacc with fPIC +- build examples with system build flags + * Mon Jul 14 2025 Funda Wang - 5.0.3.1683-1 - update to 5.0.3.1683 -- Gitee