Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] firebird3: add patches to fix ppc64 builds and respect c(xx)flags
@ 2019-07-08 13:53 voidlinux-github
  2019-07-08 14:38 ` voidlinux-github
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: voidlinux-github @ 2019-07-08 13:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-power/void-packages firebird3
https://github.com/void-linux/void-packages/pull/12904

firebird3: add patches to fix ppc64 builds and respect c(xx)flags
These are from Fedora. If I don't apply these, build fails on `ppc64le` with

```
make[3]: Entering directory '/builddir/Firebird-3.0.4.33054-0/gen'
rm -f metadata.fdb
/builddir/Firebird-3.0.4.33054-0/gen/Release/firebird/bin/isql -q -i /builddir/Firebird-3.0.4.33054-0/src/dbs/metadata.sql
rm -f msg.fdb
double free or corruption (out)
```

@pullmoll

A patch file from https://github.com/void-linux/void-packages/pull/12904.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3-12904.patch --]
[-- Type: application/text/x-diff, Size: 8173 bytes --]

From 781064f51010c860c65a99bfba63cd42aabdde80 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 8 Jul 2019 15:48:52 +0200
Subject: [PATCH] firebird3: add patches to fix ppc64 builds and respect
 c(xx)flags

These are from Fedora.

[ci skip]
---
 ...lobal-delete-operators-when-compiled.patch | 36 +++++++++
 .../patches/cloop-honour-build-flags.patch    | 27 +++++++
 .../firebird3/patches/honour-buildflags.patch | 78 +++++++++++++++++++
 .../firebird3/patches/musl-os_utils_h.patch   |  4 +-
 srcpkgs/firebird3/template                    |  6 +-
 5 files changed, 148 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/firebird3/patches/Provide-sized-global-delete-operators-when-compiled.patch
 create mode 100644 srcpkgs/firebird3/patches/cloop-honour-build-flags.patch
 create mode 100644 srcpkgs/firebird3/patches/honour-buildflags.patch

diff --git a/srcpkgs/firebird3/patches/Provide-sized-global-delete-operators-when-compiled.patch b/srcpkgs/firebird3/patches/Provide-sized-global-delete-operators-when-compiled.patch
new file mode 100644
index 00000000000..1302d1dafe7
--- /dev/null
+++ b/srcpkgs/firebird3/patches/Provide-sized-global-delete-operators-when-compiled.patch
@@ -0,0 +1,36 @@
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Mon, 25 Apr 2016 08:55:36 +0200
+Subject: Provide sized global delete operators when compiled in C++14 mode
+Patch-mainline: submitted
+Git-commit: 038f9fbf559e56032e4cb49eb7ce4c3ead23fda9
+References: bsc#964466 CORE-5099
+
+---
+ src/common/classes/alloc.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h
+index b1026ce2aac4..fda5bfebb0cc 100644
+--- a/src/common/classes/alloc.h
++++ b/src/common/classes/alloc.h
+@@ -331,6 +331,16 @@ inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS
+ 	MemoryPool::globalFree(mem);
+ }
+ 
++#if __cplusplus >= 201402L
++inline void operator delete(void* mem, std::size_t s ALLOC_PARAMS) throw()
++{
++	MemoryPool::globalFree(mem);
++}
++inline void operator delete[](void* mem, std::size_t s ALLOC_PARAMS) throw()
++{
++	MemoryPool::globalFree(mem);
++}
++#endif
+ #ifdef DEBUG_GDS_ALLOC
+ 
+ #ifdef __clang__
+-- 
+2.8.2
+
+
diff --git a/srcpkgs/firebird3/patches/cloop-honour-build-flags.patch b/srcpkgs/firebird3/patches/cloop-honour-build-flags.patch
new file mode 100644
index 00000000000..1f556e0fcb9
--- /dev/null
+++ b/srcpkgs/firebird3/patches/cloop-honour-build-flags.patch
@@ -0,0 +1,27 @@
+Description: make cloop build honor compiler/linker flags from the environment
+Author: Damyan Ivanov <dmn@debian.org>
+Forwarded: no
+
+--- a/extern/cloop/Makefile
++++ b/extern/cloop/Makefile
+@@ -6,7 +6,7 @@ TARGET	:= release
+ 
+ CC	:= gcc
+ CXX	:= g++
+-LD	:= $(CXX)
++LD	:= $(CXX) $(LDFLAGS)
+ 
+ SRC_DIR		:= src
+ BUILD_DIR	:= build
+@@ -27,8 +27,9 @@ SRCS_CPP := $(foreach sdir,$(SRC_DIRS),$
+ OBJS_C := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRCS_C))
+ OBJS_CPP := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS_CPP))
+ 
+-C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter
+-CXX_FLAGS := $(C_FLAGS)
++COMMON_C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter
++C_FLAGS := $(COMMON_C_FLAGS) $(CFLAGS) $(CPPFLAGS)
++CXX_FLAGS := $(COMMON_C_FLAGS) $(CXXFLAGS) $(CPPFLAGS)
+ FPC_FLAGS := -Mdelphi
+ 
+ ifeq ($(TARGET),release)
diff --git a/srcpkgs/firebird3/patches/honour-buildflags.patch b/srcpkgs/firebird3/patches/honour-buildflags.patch
new file mode 100644
index 00000000000..221241d18ec
--- /dev/null
+++ b/srcpkgs/firebird3/patches/honour-buildflags.patch
@@ -0,0 +1,78 @@
+Description: improved support for build flags
+ The first change makes linking makeHeader use the same CPP/CXX/LD flags as the
+ rest of the sources.
+ The second change stops btyacc/Makefile from ignoring CFLAGS from the
+ environment.
+ The third change stops overriding CXXFLAGS
+ The result is using hardening flags from the environment when compiling and
+ linking.
+Author: Damyan Ivanov <dmn@debian.org>
+
+--- a/builds/posix/Makefile.in
++++ b/builds/posix/Makefile.in
+@@ -623,7 +623,7 @@ MAKE_HEADER_Src = $(addprefix $(SRC_ROOT
+ MAKE_HEADER_Bin = ./makeHeader
+ 
+ $(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
+-	$(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
++	$(STATICEXE_LINK) $(EXE_LINK_OPTIONS) $(LINK_OPTS) $(CPPFLAGS) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
+ 	$(CP) $^ .
+ 	$(MAKE_HEADER_Bin) <ibase.h >$@
+ 	$(RM) -f ibase.h
+--- a/extern/btyacc/Makefile
++++ b/extern/btyacc/Makefile
+@@ -42,7 +42,7 @@ OTHERS	      = README README.BYACC \
+ all:		$(PROGRAM)
+ 
+ $(PROGRAM):     $(OBJS) $(LIBS)
+-		$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
++		$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
+ 
+ clean:;		rm -f $(OBJS)
+ 
+--- a/builds/posix/make.defaults
++++ b/builds/posix/make.defaults
+@@ -166,8 +166,8 @@ LD =	@CXX@
+ 
+ LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
+ STATICLIB_LINK = $(AR) crus
+-EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
+-STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
++EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(LDFLAGS)
++STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(LDFLAGS)
+ 
+ LINK_LIBS = @LIBS@
+ STATICLINK_LIBS = @LIBS@
+--- a/builds/posix/prefix.linux
++++ b/builds/posix/prefix.linux
+@@ -19,7 +19,7 @@
+ # 2 Oct 2002, Nickolay Samofatov - Major cleanup
+ 
+ COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -pipe -MMD -fPIC -fmessage-length=0 -fno-delete-null-pointer-checks
+-CXXFLAGS=-std=gnu++03
++CXXFLAGS+=-std=gnu++03
+ OPTIMIZE_FLAGS=-O3 -march=i586 -mtune=i686 -fno-omit-frame-pointer
+ WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-narrowing
+ 
+--- a/builds/posix/prefix.linux_amd64
++++ b/builds/posix/prefix.linux_amd64
+@@ -19,7 +19,7 @@
+ # 2 Oct 2002, Nickolay Samofatov - Major cleanup
+ 
+ COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -pipe -MMD -fPIC -fmessage-length=0 -fno-delete-null-pointer-checks
+-CXXFLAGS=-std=gnu++03
++CXXFLAGS+=-std=gnu++03
+ OPTIMIZE_FLAGS=-O3 -fno-omit-frame-pointer
+ WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof -Wno-narrowing -Wno-unused-local-typedefs
+ 
+--- a/builds/posix/prefix.linux_generic
++++ b/builds/posix/prefix.linux_generic
+@@ -19,7 +19,7 @@
+ # 2 Oct 2002, Nickolay Samofatov - Major cleanup
+ 
+ COMMON_FLAGS=-DLINUX -pipe -MMD -fPIC -DFB_SEND_FLAGS=MSG_NOSIGNAL -fno-delete-null-pointer-checks
+-CXXFLAGS=-std=gnu++03
++CXXFLAGS+=-std=gnu++03
+ 
+ PROD_FLAGS=-ggdb -O3 $(COMMON_FLAGS)
+ DEV_FLAGS=-ggdb -p -Wall -Wno-switch $(COMMON_FLAGS) -Wno-non-virtual-dtor
diff --git a/srcpkgs/firebird3/patches/musl-os_utils_h.patch b/srcpkgs/firebird3/patches/musl-os_utils_h.patch
index b3cee228b18..68432c931ff 100644
--- a/srcpkgs/firebird3/patches/musl-os_utils_h.patch
+++ b/srcpkgs/firebird3/patches/musl-os_utils_h.patch
@@ -1,5 +1,5 @@
---- src/common/os/os_utils.h	2016-04-14 16:07:29.000000000 +0200
-+++ src/common/os/os_utils.h	2019-02-15 02:22:49.698708718 +0100
+--- a/src/common/os/os_utils.h	2016-04-14 16:07:29.000000000 +0200
++++ b/src/common/os/os_utils.h	2019-02-15 02:22:49.698708718 +0100
 @@ -40,6 +40,7 @@
  #define mode_t int
  #define DEFAULT_OPEN_MODE (_S_IREAD | _S_IWRITE)
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 6dc751ec251..f163475c253 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,7 +1,7 @@
 # Template file for 'firebird3'
 pkgname=firebird3
 version=3.0.4.33054
-revision=2
+revision=3
 _build=0
 _uver=${version//./_}
 wrksrc="Firebird-${version}-${_build}"
@@ -36,6 +36,10 @@ homepage="https://www.firebirdsql.org/en/start/"
 distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2"
 checksum=b208931d309029d05dbcd8f6c1b4fd9d21be1d60cee2ff29c08b5002db83756b
 replaces="firebird>=0"
+patch_args="-Np1"
+
+CFLAGS="-fno-strict-aliasing"
+CXXFLAGS="-fno-delete-null-pointer-checks"
 
 pre_configure() {
 	# Avoid errors telling we are not 'root' and

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: firebird3: add patches to fix ppc64 builds and respect c(xx)flags
  2019-07-08 13:53 [PR PATCH] firebird3: add patches to fix ppc64 builds and respect c(xx)flags voidlinux-github
@ 2019-07-08 14:38 ` voidlinux-github
  2019-07-08 14:44 ` voidlinux-github
  2019-07-08 14:47 ` [PR PATCH] [Merged]: " voidlinux-github
  2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-07-08 14:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/12904#issuecomment-509252651
Comment:
Nice, thank you @q66 !

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: firebird3: add patches to fix ppc64 builds and respect c(xx)flags
  2019-07-08 13:53 [PR PATCH] firebird3: add patches to fix ppc64 builds and respect c(xx)flags voidlinux-github
  2019-07-08 14:38 ` voidlinux-github
@ 2019-07-08 14:44 ` voidlinux-github
  2019-07-08 14:47 ` [PR PATCH] [Merged]: " voidlinux-github
  2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-07-08 14:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/12904#issuecomment-509255236
Comment:
The revision bump is in order to build things with our hardening flags on all official platforms

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: firebird3: add patches to fix ppc64 builds and respect c(xx)flags
  2019-07-08 13:53 [PR PATCH] firebird3: add patches to fix ppc64 builds and respect c(xx)flags voidlinux-github
  2019-07-08 14:38 ` voidlinux-github
  2019-07-08 14:44 ` voidlinux-github
@ 2019-07-08 14:47 ` voidlinux-github
  2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-07-08 14:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

There's a merged pull request on the void-packages repository

firebird3: add patches to fix ppc64 builds and respect c(xx)flags
https://github.com/void-linux/void-packages/pull/12904
Description: These are from Fedora. If I don't apply these, build fails on `ppc64le` with

```
make[3]: Entering directory '/builddir/Firebird-3.0.4.33054-0/gen'
rm -f metadata.fdb
/builddir/Firebird-3.0.4.33054-0/gen/Release/firebird/bin/isql -q -i /builddir/Firebird-3.0.4.33054-0/src/dbs/metadata.sql
rm -f msg.fdb
double free or corruption (out)
```

@pullmoll

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-08 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 13:53 [PR PATCH] firebird3: add patches to fix ppc64 builds and respect c(xx)flags voidlinux-github
2019-07-08 14:38 ` voidlinux-github
2019-07-08 14:44 ` voidlinux-github
2019-07-08 14:47 ` [PR PATCH] [Merged]: " voidlinux-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).