office-gobmx/external/firebird/configure-c99.patch
Stephan Bergmann 0dd3785462 external/firebird: Adapt more configure checks to C99
...similar to f6be6cd82b "external/firebird:
Missing include in configure check" and 7e1ff1cee5
"external/firebird: Implicit int in configure check".  With recent Clang on
Linux it had still failed to detected

> configure:20511: checking for working sem_init()
[...]
> conftest.c:166:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
>         main () {
>         ^
>         int
> conftest.c:168: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(sem_init(&s,0,0));
>                 ^
> conftest.c:168:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

and

> configure:21256: checking for native large file support
[...]
> conftest.c:167:5: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
>     main () {
>     ^
>     int
> conftest.c:168:5: 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(!(sizeof(off_t) == 8));
>     ^
> conftest.c:168:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

And at least the former, which erroneously suppressed setting WORKING_SEM_INIT,
sporadically caused CppunitTest_dbaccess_hsql_binary_import to SIGABRT for me at

> #10 0x00007f087fce37fc in __GI_abort ()
> #11 0x00007f085a7e32e8 in Firebird::system_call_failed::system_call_failed(char const*, int) (this=0x55fbb11e5650, syscall=0x7f085a19ac06 "sem_open", error_code=17) at workdir/UnpackedTarball/firebird/src/common/fb_exception.cpp:244
> #12 0x00007f085a7e33ba in Firebird::system_call_failed::raise(char const*) (syscall=0x7f085a19ac06 "sem_open") at workdir/UnpackedTarball/firebird/src/common/fb_exception.cpp:255
> #13 0x00007f085a81ff4e in Firebird::SignalSafeSemaphore::init() (this=0x55fbb1268c80) at workdir/UnpackedTarball/firebird/src/common/classes/semaphore.cpp:138
> #14 0x00007f085a38ee85 in Firebird::SignalSafeSemaphore::SignalSafeSemaphore() (this=0x55fbb1268c80) at workdir/UnpackedTarball/firebird/src/common/classes/semaphore.h:156
> #15 0x00007f085a38c931 in (anonymous namespace)::MappingIpc::MappingIpc(Firebird::MemoryPool&) (this=0x55fbb1268bf0) at workdir/UnpackedTarball/firebird/src/jrd/Mapping.cpp:602
> #16 0x00007f085a38176b in Firebird::GlobalPtr<(anonymous namespace)::MappingIpc, (Firebird::InstanceControl::DtorPriority)2>::GlobalPtr() (this=0x7f085a93e780 <(anonymous namespace)::mappingIpc>) at workdir/UnpackedTarball/firebird/src/common/classes/init.h:143
> #17 0x00007f085a38d270 in __cxx_global_var_init.15(void) () at workdir/UnpackedTarball/firebird/src/jrd/Mapping.cpp:901
[...]
> #32 0x00007f085bb37626 in ModuleLoader::loadModule(long*, Firebird::StringBase<Firebird::PathNameComparator> const&) (status=0x7ffd9f8b42a0, modPath=...) at workdir/UnpackedTarball/firebird/src/common/os/posix/mod_loader.cpp:95
[...]

Change-Id: I082be878d95a020a7c419d6852614b711754cc23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141549
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-20 12:27:30 +02:00

45 lines
899 B
Diff

--- configure
+++ configure
@@ -20518,8 +20518,9 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
#include <semaphore.h>
- main () {
+ int main () {
sem_t s;
exit(sem_init(&s,0,0));
}
@@ -21263,8 +21264,9 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
#include <unistd.h>
- main () {
+ int main () {
exit(!(sizeof(off_t) == 8));
}
_ACEOF
@@ -21478,8 +21480,9 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
#include <semaphore.h>
-main () {
+int main () {
struct s {
char a;
union { long long x; sem_t y; } b;
@@ -21514,7 +21517,8 @@
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-main () {
+#include <stdlib.h>
+int main () {
struct s {
char a;
double b;