office-gobmx/external/firebird/configure-include.patch
Stephan Bergmann f6be6cd82b 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>
2022-04-25 16:50:59 +02:00

18 lines
359 B
Diff

--- 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;