external/firebird: Missing include in configure check

...so that with Clang 15 trunk after
<7d644e1215>
"[C11/C2x] Change the behavior of the implicit function declaration warning" the
check now failed to compile with

> configure:21471: checking alignment of long
[...]
> conftest.c:177:3: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>   exit((int)&((struct s*)1024)->b - 1024);
>   ^
> conftest.c:177:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

and an exit code of 1 from the compiler invocation, which the check than
silently mistook as an alignment requirement of 1.  (Which then caused the
somewhat obscure fallout of

> workdir/UnpackedTarball/firebird/src/gpre/msc.cpp:463:10: runtime error: member access within misaligned address 0x7f59d8e68196 for type 'gpre_sym', which requires 8 byte alignment

while building ExternalProject_firebird with UBSan.)

The corresponding "checking alignment of double" a few lines further down had
already been modified in ccd0e5f445 "Make firebird
build for macOS on arm64", but without stating what actual problem (if any) it
fixed.  I thus moved that patch into the new
external/firebird/configure-include.patch too, to have them grouped together.

(An alternative fix could be to replace the use of exit with return from main
in those configure checks.)

Change-Id: Iefa02a06d45c83add5f56fad5d726aaecee6d815
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133368
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2022-04-25 10:49:33 +02:00
parent dec2c5f3ca
commit f6be6cd82b
4 changed files with 21 additions and 10 deletions

View File

@@ -49,6 +49,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,firebird,\
external/firebird/msvc.patch \
external/firebird/wnt-per-process-trace-storage.patch.1 \
external/firebird/0001-extern-cloop-Missing-dependencies-of-compilations-on.patch.1 \
external/firebird/configure-include.patch \
))
ifeq ($(OS),WNT)

View File

@@ -0,0 +1,18 @@
--- configure
+++ configure
@@ -21478,6 +21478,7 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
#include <semaphore.h>
main () {
struct s {
@@ -21514,6 +21515,7 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
main () {
struct s {
char a;

View File

@@ -29,10 +29,10 @@
--- configure 2016-07-07 15:57:04.538983200 +0200
+++ configure 2016-07-13 11:31:18.132820200 +0200
@@ -21473,13 +21473,12 @@
else
@@ -21490,13 +21490,12 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
-#include <semaphore.h>
main () {
struct s {

View File

@@ -24,14 +24,6 @@
i*86-*-darwin*)
MAKEFILE_PREFIX=darwin_i386
MAKEFILE_POSTFIX=darwin
@@ -21344,6 +21344,7 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
main () {
struct s {
char a;
--- src/common/common.h
+++ src/common/common.h
@@ -234,6 +234,12 @@