Menu

#68 sqsh 2.5 configure 32/64 bit detection fails

v2.5
open
nobody
None
5
2025-05-29
2025-05-29
No

The 32/64 bit detection in the configure script of sqsh 2.5 fails because the C code cannot be compiled:

configure:3832: checking Compiling 32/64 bit mode
configure:3856: gcc -o conftest -O2 -DSYB_LP64   conftest.c  >&5
conftest.c:21:1: error: return type defaults to 'int' [-Wimplicit-int]
   21 | main() {
      | ^~~~
conftest.c: In function 'main':
conftest.c:23:5: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   23 |     exit (0);
      |     ^~~~
conftest.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | /* confdefs.h */
conftest.c:23:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]   23 |     exit (0);
      |     ^~~~
conftest.c:23:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
configure:3856: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_VOLATILE 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
|
| main() {
| #if defined (__LP64__) || defined (__LP64) || defined (_LP64) || defined (__arch64__)
|     exit (0);
| #else
|     exit (1);
| #endif
| }
|
configure:3869: result: 32

This is with gcc 15.1.1 on Fedora 42. configure command was:

./configure --with-readline --without-x CFLAGS=-O2 -DSYB_LP64

To make it work I had to add #include <stdlib.h> and change main() to int main() in configure.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB