summaryrefslogtreecommitdiff
path: root/external/firebird
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-11-15 19:57:48 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2020-11-21 14:44:49 +0100
commit22b6cfa35c4cec8462785376b8543ce9cd4e422a (patch)
tree6fc9a712b579385ceeb8b3d0ce8de093966b4f4d /external/firebird
parent4486ab59348ddbfa4b050195477c2842c0a7de0a (diff)
firebird: build fixes (incl. parallel build)
The main idea is to get rid of the "unset MAKEFLAGS". AFAI can see, the whole CPU stuff isn't used anymore. So we can drop the whole FB_CPU_ARG handling. Since LO doesn't use any of make's implicit rules, the build breaks, but luckily it just requires a single rule for the btyacc build - just a Firebuild build tool. Then there is the whole broken handling of LIBTOMMATH and LIBATOMIC_OPS already in LO's configure.ac. I don't know if any internal build of Firebird with these as system libs would work. I guess people either have a system Firebird or also build with internal libtommath and libatomic_ops. This fixes just the obvious errors. I didn't try to build it, so there might still be typos (TBH I thought hard about just dropping the system build of these libraries, after seeing the broken configure.ac). And I'm not sure our / the system boost preprocessor library is ever used over the Firebird-internal copy. It also looks like it's also just used in an other build tool and nothing of the Firebird DB itself depends on it. Then there is the movement of the install_name_tool / otool patching on MacOS from the patch into the ExternalProject to further shrink the patches, as the build doesn't depend on it. This also introduces a different debug build mode for the gcc-/g++-wrapper: MSVC_USE_INDIVIDUAL_PDBS. It uses -Fd to write a separate PDB per output file instead of using -FS to use sync writes to a single PDB, which might work around the PDB access failures seen by Jenkins for linking executables. In theory it's also faster and should work with all the other wrapper users, but I don't want to open that can of additional build errors (yet), for eventually marginal gains. Change-Id: I8d4c5d2f17def9e840a67ef1004787e8baaffa83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105902 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'external/firebird')
-rw-r--r--external/firebird/ExternalProject_firebird.mk72
-rw-r--r--external/firebird/UnpackedTarball_firebird.mk1
-rw-r--r--external/firebird/firebird-btyacc-add-explicit-rule.patch12
-rw-r--r--external/firebird/firebird-cygwin-msvc.patch26
-rw-r--r--external/firebird/firebird-macosx.patch.148
5 files changed, 59 insertions, 100 deletions
diff --git a/external/firebird/ExternalProject_firebird.mk b/external/firebird/ExternalProject_firebird.mk
index ce99e909aee1..8f8a8230227f 100644
--- a/external/firebird/ExternalProject_firebird.mk
+++ b/external/firebird/ExternalProject_firebird.mk
@@ -22,34 +22,20 @@ $(eval $(call gb_ExternalProject_register_targets,firebird,\
build \
))
-ifneq ($(OS),WNT)
-INVOKE_FPA:="CPU=\$$(EMPTY) $${FB_CPU_ARG}"
-endif
-
-ifeq ($(COM_IS_CLANG),TRUE)
-firebird_NO_CXX11_NARROWING := -Wno-c++11-narrowing
-endif
-
-MAKE_PRE=LC_ALL=C
-
-MAKE_POST=$(if $(filter MACOSX,$(OS)),&& $(PERL) \
- $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
- $(EXTERNAL_WORKDIR)/gen/$(if $(ENABLE_DEBUG),Debug,Release)/firebird/plugins/libEngine12.dylib \
- $(EXTERNAL_WORKDIR)/gen/$(if $(ENABLE_DEBUG),Debug,Release)/firebird/lib/libfbclient.dylib.3.0.0)
+firebird_BUILDDIR = $(EXTERNAL_WORKDIR)/gen/$(if $(ENABLE_DEBUG),Debug,Release)/firebird
+firebird_VERSION := 3.0.0
$(call gb_ExternalProject_get_state_target,firebird,build):
$(call gb_Trace_StartRange,firebird,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- unset MAKEFLAGS \
- && FB_CPU_ARG='$(filter --jobserver-fds=%,$(MAKEFLAGS))' \
- && export PKG_CONFIG="" \
+ export PKG_CONFIG="" \
&& export CPPFLAGS=" \
+ $(BOOST_CPPFLAGS) \
$(if $(SYSTEM_LIBATOMIC_OPS),$(LIBATOMIC_OPS_CFLAGS), \
-I$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src \
) \
$(if $(SYSTEM_LIBTOMMATH),$(LIBTOMMATH_CFLAGS), \
-I$(call gb_UnpackedTarball_get_dir,libtommath) \
- -L$(call gb_UnpackedTarball_get_dir,libtommath) \
) \
$(if $(SYSTEM_ICU),$(ICU_CPPFLAGS), \
-I$(call gb_UnpackedTarball_get_dir,icu)/source \
@@ -59,30 +45,26 @@ $(call gb_ExternalProject_get_state_target,firebird,build):
$(if $(filter GCC-INTEL,$(COM)-$(CPUNAME)),-Di386=1) \
" \
&& export CXXFLAGS=" \
+ $(BOOST_CXXFLAGS) \
$(if $(filter MSC,$(COM)),$(if $(MSVC_USE_DEBUG_RUNTIME),-DMSVC_USE_DEBUG_RUNTIME)) \
$(if $(HAVE_GCC_FNO_SIZED_DEALLOCATION),-fno-sized-deallocation -fno-delete-null-pointer-checks) \
- $(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS), \
- $(BOOST_CPPFLAGS) \
- -L$(call gb_UnpackedTarball_get_dir,boost)/source/lib \
- ) \
- $(if $(SYSTEM_ICU),$(ICU_CPPFLAGS), \
- -I$(call gb_UnpackedTarball_get_dir,icu)/source \
- -I$(call gb_UnpackedTarball_get_dir,icu)/source/i18n \
- -I$(call gb_UnpackedTarball_get_dir,icu)/source/common \
- ) \
- $(if $(SYSTEM_LIBTOMMATH),$(LIBTOMMATH_CFLAGS), \
- -L$(call gb_UnpackedTarball_get_dir,libtommath) \
- ) \
$(CXXFLAGS_CXX11) \
- $(firebird_NO_CXX11_NARROWING) \
+ $(if $(filter TRUE,$(COM_IS_CLANG)), -Wno-c++11-narrowing) \
$(if $(call gb_Module__symbols_enabled,firebird),$(gb_DEBUGINFO_FLAGS)) \
" \
&& export LDFLAGS=" \
+ $(if $(SYSTEM_LIBATOMIC_OPS),$(LIBATOMIC_OPS_LIBS), \
+ -L$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src \
+ ) \
+ $(if $(SYSTEM_LIBTOMMATH),$(LIBTOMMATH_LIBS), \
+ -L$(call gb_UnpackedTarball_get_dir,libtommath) \
+ ) \
$(if $(SYSTEM_ICU),$(ICU_LIBS), \
-L$(call gb_UnpackedTarball_get_dir,icu)/source/lib \
) \
" \
&& export LIBREOFFICE_ICU_LIB="$(call gb_UnpackedTarball_get_dir,icu)/source/lib" \
+ && export MSVC_USE_INDIVIDUAL_PDBS=TRUE \
&& MAKE=$(MAKE) ./configure \
--without-editline \
--with-wire-compress=no \
@@ -97,19 +79,21 @@ $(call gb_ExternalProject_get_state_target,firebird,build):
$(shell expr '$(MAC_OS_X_VERSION_MIN_REQUIRED)' \
'<' 101200)), \
ac_cv_func_clock_gettime=no)) \
- && if [ -n "$${FB_CPU_ARG}" ]; then \
- $(MAKE_PRE) $(MAKE) \
- $(if $(filter LINUX,$(OS)),CXXFLAGS="$$CXXFLAGS -std=gnu++11") \
- $(if $(ENABLE_DEBUG),Debug) $(INVOKE_FPA) SHELL='$(SHELL)' \
- LIBO_TUNNEL_LIBRARY_PATH='$(subst ','\'',$(subst $$,$$$$,$(call gb_Helper_extend_ld_path,$(call gb_UnpackedTarball_get_dir,icu)/source/lib)))' \
- $(MAKE_POST); \
- else \
- $(MAKE_PRE) $(MAKE) \
- $(if $(filter LINUX,$(OS)),CXXFLAGS="$$CXXFLAGS -std=gnu++11") \
- $(if $(ENABLE_DEBUG),Debug) SHELL='$(SHELL)' \
- LIBO_TUNNEL_LIBRARY_PATH='$(subst ','\'',$(subst $$,$$$$,$(call gb_Helper_extend_ld_path,$(call gb_UnpackedTarball_get_dir,icu)/source/lib)))' \
- $(MAKE_POST); \
- fi \
+ && LC_ALL=C $(MAKE) \
+ $(if $(ENABLE_DEBUG),Debug) SHELL='$(SHELL)' $(if $(filter LINUX,$(OS)),CXXFLAGS="$$CXXFLAGS -std=gnu++11") \
+ MATHLIB="$(if $(SYSTEM_LIBTOMMATH),$(LIBTOMMATH_LIBS),-L$(call gb_UnpackedTarball_get_dir,libtommath) -ltommath)" \
+ LIBO_TUNNEL_LIBRARY_PATH='$(subst ','\'',$(subst $$,$$$$,$(call gb_Helper_extend_ld_path,$(call gb_UnpackedTarball_get_dir,icu)/source/lib)))' \
+ $(if $(filter MACOSX,$(OS)), \
+ && install_name_tool -id @__________________________________________________OOO/libfbclient.dylib.$(firebird_VERSION) \
+ $(firebird_BUILDDIR)/lib/libfbclient.dylib.$(firebird_VERSION) \
+ && install_name_tool -id @__________________________________________________OOO/libEngine12.dylib \
+ $(firebird_BUILDDIR)/plugins/libEngine12.dylib \
+ && install_name_tool -change $(firebird_BUILDDIR)/lib/libfbclient.dylib.$(firebird_VERSION) \
+ @loader_path/libfbclient.dylib.$(firebird_VERSION) $(firebird_BUILDDIR)/plugins/libEngine12.dylib \
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(firebird_BUILDDIR)/lib/libfbclient.dylib.$(firebird_VERSION) \
+ $(firebird_BUILDDIR)/plugins/libEngine12.dylib \
+ ) \
)
$(call gb_Trace_EndRange,firebird,EXTERNAL)
diff --git a/external/firebird/UnpackedTarball_firebird.mk b/external/firebird/UnpackedTarball_firebird.mk
index c3860673b879..25b1640755a1 100644
--- a/external/firebird/UnpackedTarball_firebird.mk
+++ b/external/firebird/UnpackedTarball_firebird.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,firebird,\
external/firebird/0001-Make-comparison-operator-member-functions-const.patch.1 \
external/firebird/0001-Fix-warning-on-Win64-build-231.patch.1 \
external/firebird/macos-arm64.patch.0 \
+ external/firebird/firebird-btyacc-add-explicit-rule.patch \
))
ifeq ($(OS),WNT)
diff --git a/external/firebird/firebird-btyacc-add-explicit-rule.patch b/external/firebird/firebird-btyacc-add-explicit-rule.patch
new file mode 100644
index 000000000000..c4d88d911a40
--- /dev/null
+++ b/external/firebird/firebird-btyacc-add-explicit-rule.patch
@@ -0,0 +1,12 @@
+--- extern/btyacc/Makefile.orig 2020-11-13 18:57:44.831455058 +0100
++++ extern/btyacc/Makefile 2020-11-13 18:59:19.071078333 +0100
+@@ -44,6 +44,9 @@
+ $(PROGRAM): $(OBJS) $(LIBS)
+ $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
+
++%.o: %.c
++ $(CC) $(CCFLAGS) -c $< -o $@
++
+ clean:; rm -f $(OBJS)
+
+ clobber:; rm -f $(OBJS) $(PROGRAM)
diff --git a/external/firebird/firebird-cygwin-msvc.patch b/external/firebird/firebird-cygwin-msvc.patch
index 317ea8026b5d..47fd322e514e 100644
--- a/external/firebird/firebird-cygwin-msvc.patch
+++ b/external/firebird/firebird-cygwin-msvc.patch
@@ -492,18 +492,15 @@ diff -ur extern/btyacc/main.c extern/btyacc/main.c
diff -ur extern/btyacc/Makefile extern/btyacc/Makefile
--- extern/btyacc/Makefile 2016-07-07 13:55:55.448234695 +0200
+++ extern/btyacc/Makefile 2016-07-07 14:57:42.284333961 +0200
-@@ -42,7 +42,10 @@
+@@ -42,7 +42,7 @@
all: $(PROGRAM)
-
+
$(PROGRAM): $(OBJS) $(LIBS)
- $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
-+ $(CC) -o $(PROGRAM).exe $(OBJS) $(LIBS) $(LDFLAGS)
-+
-+%.o: %.c
-+ $(CC) -c $< -Fo$@ $(CCFLAGS)
-
- clean:; rm -f $(OBJS)
-
++ $(CC) $(LDFLAGS) -o $(PROGRAM).exe $(OBJS) $(LIBS)
+
+ %.o: %.c
+ $(CC) $(CCFLAGS) -c $< -o $@
--- extern/cloop/src/tests/test1/CppTest.cpp 2016-07-07 15:56:27.948015300 +0200
+++ extern/cloop/src/tests/test1/CppTest.cpp 2016-07-13 18:58:48.529822600 +0200
@@ -24,6 +24,7 @@
@@ -555,6 +552,17 @@ diff -ur extern/btyacc/Makefile extern/btyacc/Makefile
$(BIN_DIR)/test1-c$(SHRLIB_EXT) \
$(BIN_DIR)/test1-c$(EXE_EXT) \
$(BIN_DIR)/test1-cpp$(SHRLIB_EXT) \
+@@ -63,6 +63,10 @@
+
+ mkdirs: $(OBJ_DIRS) $(BIN_DIR) $(LIB_DIR)
+
++# These files have the same basename, so various conflicting intermediate files break the build
++$(BIN_DIR)/test1-c$(EXE_EXT): | $(BIN_DIR)/test1-c$(SHRLIB_EXT)
++$(BIN_DIR)/test1-cpp$(EXE_EXT): | $(BIN_DIR)/test1-cpp$(SHRLIB_EXT)
++
+ $(OBJ_DIRS) $(BIN_DIR) $(LIB_DIR):
+ @mkdir -p $@
+
@@ -74,7 +74,7 @@
-include $(addsuffix .d,$(basename $(OBJS_C)))
-include $(addsuffix .d,$(basename $(OBJS_CPP)))
diff --git a/external/firebird/firebird-macosx.patch.1 b/external/firebird/firebird-macosx.patch.1
index 35e631dece68..fdd544873be7 100644
--- a/external/firebird/firebird-macosx.patch.1
+++ b/external/firebird/firebird-macosx.patch.1
@@ -20,7 +20,7 @@
#DYLD_PRINT_ENV=1
#export DYLD_PRINT_ENV
-@@ -31,15 +31,15 @@
+@@ -31,8 +31,8 @@
MACOSX_DEPLOYMENT_TARGET=10.7
export MACOSX_DEPLOYMENT_TARGET
@@ -31,52 +31,6 @@
CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden
EXE_LINK_OPTIONS:=
- UNDEF_PLATFORM=
-
- LINK_LIBS+=-liconv
--MATHLIB=/opt/local/lib/libtommath.a
-+MATHLIB=-ltommath
- SO_LINK_LIBS+=-liconv
-
- include $(ROOT)/gen/darwin.defaults
---- firebird.org/builds/posix/postfix.darwin 2016-08-01 20:02:48.000000000 +0200
-+++ firebird/builds/posix/postfix.darwin 2016-08-01 22:17:49.000000000 +0200
-@@ -54,9 +54,9 @@
- cp -r ../gen/firebird/include $(FB_FW)/Versions/A/Headers
- cp ../gen/firebird/lib/libfbembed.dylib $(FB_FW)/Versions/A/Firebird
- cp ../gen/firebird/lib/libfbclient.dylib $(FB_FW)/Versions/A/Libraries/libfbclient.dylib
-- cp ../gen/firebird/lib/libicudata.dylib $(FB_FW)/Versions/A/Libraries/libicudata.dylib
-- cp ../gen/firebird/lib/libicui18n.dylib $(FB_FW)/Versions/A/Libraries/libicui18n.dylib
-- cp ../gen/firebird/lib/libicuuc.dylib $(FB_FW)/Versions/A/Libraries/libicuuc.dylib
-+# cp ../gen/firebird/lib/libicudata.dylib $(FB_FW)/Versions/A/Libraries/libicudata.dylib
-+# cp ../gen/firebird/lib/libicui18n.dylib $(FB_FW)/Versions/A/Libraries/libicui18n.dylib
-+# cp ../gen/firebird/lib/libicuuc.dylib $(FB_FW)/Versions/A/Libraries/libicuuc.dylib
- cp ../gen/firebird/lib/libib_util.dylib $(FB_FW)/Versions/A/Libraries/libib_util.dylib
- cp ../gen/firebird/firebird.msg \
- $(FB_FW)/Resources/English.lproj/var/firebird.msg
-@@ -68,8 +68,8 @@
- $(FB_FW)/Resources/English.lproj/var/intl/fbintl.conf
- chmod a+rx $(FB_FW)/Resources/English.lproj/var/intl/fbintl
- mkdir -p $(FB_FW)/Resources/English.lproj/var/plugins
-- cp ../gen/firebird/plugins/libfbtrace.dylib \
-- $(FB_FW)/Resources/English.lproj/var/plugins/libfbtrace.dylib
-+# cp ../gen/firebird/plugins/libfbtrace.dylib \
-+# $(FB_FW)/Resources/English.lproj/var/plugins/libfbtrace.dylib
- cp -r ../gen/firebird/help $(FB_FW)/Resources/English.lproj/var/help
- cp ../gen/firebird/security2.fdb $(FB_FW)/Resources/English.lproj/var
- mkdir -p $(FB_FW)/Resources/doc
---- firebird.org/builds/posix/Makefile.in 2016-08-08 17:58:20.000000000 +0200
-+++ firebird/builds/posix/Makefile.in 2016-08-08 17:57:17.000000000 +0200
-@@ -191,6 +191,9 @@
- $(MAKE) plugins
- $(MAKE) examples
- $(MAKE) rest
-+ install_name_tool -id @__________________________________________________OOO/libfbclient.dylib.3.0.0 $(LIB)/libfbclient.dylib.3.0.0
-+ install_name_tool -id @__________________________________________________OOO/libEngine12.dylib $(PLUGINS)/libEngine12.dylib
-+ install_name_tool -change $(LIB)/libfbclient.dylib.3.0.0 @loader_path/libfbclient.dylib.3.0.0 $(PLUGINS)/libEngine12.dylib
-
-
- cross_process:
--- firebird.org/src/common/unicode_util.cpp 2016-07-07 13:55:55.992234709 +0200
+++ firebird/src/common/unicode_util.cpp 2016-08-10 11:25:46.422331020 +0200
@@ -63,8 +63,8 @@