Build on AIX failed
(1) By anonymous on 2025-02-20 15:59:08 [source]
Hi, I have a problem with building SQLite 3.49.1 on AIX 7.2.0
I run the configure script with the --disable-shared
because I need only a static library. At the configuration phase I see:
[2025-02-19T13:21:43.090Z] Checking whether the C compiler accepts -rpath /home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/package/f171bd302a253053fbdd876b4a2f380bca0deba7/lib...no
[2025-02-19T13:21:43.090Z] Checking whether the C compiler accepts -Wl,-rpath,/home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/package/f171bd302a253053fbdd876b4a2f380bca0deba7/lib...yes
But when it goes to the compilation and linking:
[2025-02-19T13:21:43.892Z] Library feature flags: -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1
[2025-02-19T13:21:43.892Z] Created Makefile from Makefile.in
[2025-02-19T13:21:43.892Z] Created sqlite3.pc from sqlite3.pc.in
[2025-02-19T13:21:43.892Z] Created sqlite_cfg.h
[2025-02-19T13:21:43.892Z] /opt/gcc-9.5.0/bin/gcc -c /home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/build/f171bd302a253053fbdd876b4a2f380bca0deba7/source_subfolder/sqlite3.c -o sqlite3.o -maix64 -Os -pthread -fPIC -fexceptions -maix64 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -DPPC405_ERRATA -I. -fPIC -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1
[2025-02-19T13:21:43.892Z] /opt/gcc-9.5.0/bin/gcc -o sqlite3
[2025-02-19T13:21:43.892Z] /home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/build/f171bd302a253053fbdd876b4a2f380bca0deba7/source_subfolder/shell.c /home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/build/f171bd302a253053fbdd876b4a2f380bca0deba7/source_subfolder/sqlite3.c -Wl,-rpath,/home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/package/f171bd302a253053fbdd876b4a2f380bca0deba7/lib -lm -maix64
[2025-02-19T13:21:43.892Z] -I. -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1
[2025-02-19T13:21:43.892Z] -maix64 -Os -pthread -fPIC -fexceptions -maix64 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -DPPC405_ERRATA
[2025-02-19T13:21:43.892Z] -maix64
[2025-02-19T13:22:05.792Z] /opt/gcc-9.5.0/bin/gcc -o libsqlite3.so sqlite3.o -shared
[2025-02-19T13:22:05.792Z] -maix64 -Wl,-rpath,/home/labuser/jenkins/workspace/lite-subscription-release-3-49-1/.conan/data/sqlite/3.49.0100.20250219-141849/ci/stable/package/f171bd302a253053fbdd876b4a2f380bca0deba7/lib -lm -maix64
[2025-02-19T13:22:05.792Z]
[2025-02-19T13:22:05.792Z] /usr/bin/ar -X64 cr libsqlite3.a sqlite3.o
[2025-02-19T13:22:05.792Z] ld: 0706-012 The -p flag is not recognized.
[2025-02-19T13:22:05.792Z] ld: 0706-012 The -a flag is not recognized.
[2025-02-19T13:22:05.792Z] ld: 0706-012 The -t flag is not recognized.
[2025-02-19T13:22:05.792Z] ld: 0706-012 The -h flag is not recognized.
As you can see, it's also trying to build the shared library. Is that intentional, or can you fix that?
(2.1) By Stephan Beal (stephan) on 2025-02-20 16:24:06 edited from 2.0 in reply to 1 [link] [source]
[2025-02-19T13:22:05.792Z] ld: 0706-012 The -p flag is not recognized. [2025-02-19T13:22:05.792Z] ld: 0706-012 The -a flag is not recognized. [2025-02-19T13:22:05.792Z] ld: 0706-012 The -t flag is not recognized. [2025-02-19T13:22:05.792Z] ld: 0706-012 The -h flag is not recognized.
Insofar as i can tell from that output, it's choking because the feature test for the -rpath flag is saying "yes, -rpath is supported," but then the linker does not actually support it.
We've had this problem with at least one other flag as well and it's not clear how to resolve it without making that flag explicitly opt-in instead automatic. Requiring rpath to be explicitly opt-in would be highly undesirable for most builds, and yours is the exotic outlier, so...
How about if we add a flag which specifically disables the rpath check, e.g. --disable-rpath
or --without-rpath
?
The only quick workaround i can currently offer is to edit autosetup/proj.tcl
and change this part:
proc proj-check-rpath {} { define LDFLAGS_RPATH ""; return 0; # ADD THIS LINE set rc 1 ...
Meanwhile i will:
- Make a change similar to the above which automatically fails that check on AIX systems.
- Search for an alternative solution for that feature check and the other one which is known to pass-then-fail in the same way on some platforms.
Edit: it's also not clear whey --disable-shared
is not stopping the DLL from being build. If you are able, please post a link to the full configure output or email it to me at stephan at this domain.
(3) By anonymous on 2025-02-20 16:16:55 in reply to 2.0 [link] [source]
I can try with that code, and disable rpath for that.
But do you know why the .so library is even built when I use ./configure --disable-shared
? Maybe this can be somehow fixed?
(4) By Stephan Beal (stephan) on 2025-02-20 16:25:12 in reply to 3 [link] [source]
But do you know why the .so library is even built when I use ./configure --disable-shared ? Maybe this can be somehow fixed?
i didn't notice that part until later and will look into that as well. If you are able, please post a link to the full configure input (all flags) and output or email it to me at stephan at this domain (it will be treated confidentially).
(7.1) Originally by anonymous with edits by Dan Kennedy (dan) on 2025-02-21 15:03:19 from 7.0 in reply to 4 [link] [source]
Sure, I can there is no sensitive data there. We are using only one config flag, --disable-shared
> ./configure '--disable-shared' '--prefix=/home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142'
Host System...powerpc-ibm-aix7.2.5.0
Build System...powerpc-ibm-aix7.2.5.0
C compiler...ccache /opt/gcc-9.5.0/bin/gcc -maix64 -O3 -s -pthread -fPIC -fexceptions -maix64 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -DPPC405_ERRATA
C++ compiler...ccache /opt/gcc-9.5.0/bin/g++ -maix64 -O3 -s -pthread -fPIC -fexceptions -maix64 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -DPPC405_ERRATA
Build C compiler...gcc
Checking for stdlib.h...ok
Source dir = /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/build/bfeca2787e85f0b312aae5be67a9ae19b353b142/source_subfolder
Build dir = /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/build/bfeca2787e85f0b312aae5be67a9ae19b353b142/source_subfolder
Configuring SQLite version 3.49.1
Looking for install ... /usr/bin/install
Checking for int8_t...ok
Checking for int16_t...ok
Checking for int32_t...ok
Checking for int64_t...ok
Checking for intptr_t...ok
Checking for uint8_t...ok
Checking for uint16_t...ok
Checking for uint32_t...ok
Checking for uint64_t...ok
Checking for uintptr_t...ok
Checking for gmtime_r...ok
Checking for isnan...not found
Checking for localtime_r...ok
Checking for localtime_s...not found
Checking for malloc_usable_size...not found
Checking for strchrnul...not found
Checking for usleep...ok
Checking for utime...ok
Checking for pread...ok
Checking for pread64...ok
Checking for pwrite...ok
Checking for pwrite64...ok
Checking libs for fdatasync...none needed
Checking libs for nanosleep...none needed
Checking for sys/types.h...ok
Checking for sys/stat.h...ok
Checking for dlfcn.h...ok
Checking for unistd.h...ok
Checking for stdlib.h...(cached) ok
Checking for malloc.h...ok
Checking for memory.h...ok
Checking for string.h...ok
Checking for strings.h...ok
Checking for inttypes.h...ok
Checking for zlib.h...not found
Checking whether the C compiler accepts -rpath /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142/lib...no
Checking whether the C compiler accepts -Wl,-rpath,/home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142/lib...yes
SQLITE_DEBUG build? no
Support threadsafe operation? Checking for libs...
Checking libs for pthread_create...none needed
Checking libs for pthread_mutexattr_init...none needed
Checking for line-editing capability...
Line-editing support for the sqlite3 shell: none
Checking libs for dlopen...none needed
Loadable extension support enabled.
Checking libs for ceil...-lm
Enabling math SQL functions -lm
ICU support is disabled.
Feature flags...
- fts4
- fts5
- geopoly
- rtree
- session
- update-limit
- memsys5
- memsys3
- scanstatus
+ json
Library feature flags: -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1
Created Makefile from Makefile.in
Created sqlite3.pc from sqlite3.pc.in
Created sqlite_cfg.h
/opt/gcc-9.5.0/bin/gcc -c /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/build/bfeca2787e85f0b312aae5be67a9ae19b353b142/source_subfolder/sqlite3.c -o sqlite3.o -maix64 -O3 -s -pthread -fPIC -fexceptions -maix64 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -DPPC405_ERRATA -I. -fPIC -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1
/opt/gcc-9.5.0/bin/gcc -o sqlite3 \
/home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/build/bfeca2787e85f0b312aae5be67a9ae19b353b142/source_subfolder/shell.c /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/build/bfeca2787e85f0b312aae5be67a9ae19b353b142/source_subfolder/sqlite3.c -Wl,-rpath,/home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142/lib -lm -maix64 \
-I. -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_THREADSAFE=1 \
-maix64 -O3 -s -pthread -fPIC -fexceptions -maix64 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -DPPC405_ERRATA \
-maix64
/opt/gcc-9.5.0/bin/gcc -o libsqlite3.so sqlite3.o -shared \
-maix64 -Wl,-rpath,/home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142/lib -lm -maix64 \
/usr/bin/ar -X64 cr libsqlite3.a sqlite3.o
ld: 0706-012 The -p flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
ld: 0706-012 The -t flag is not recognized.
ld: 0706-012 The -h flag is not recognized.
ld: 0706-005 Cannot find or open file: /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142/lib
ld:open(): A file or directory in the path name does not exist.
collect2: error: ld returned 255 exit status
make: *** [Makefile:149: libsqlite3.so] Error 1
make: *** Waiting for unfinished jobs....
ld: 0706-012 The -p flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
ld: 0706-012 The -t flag is not recognized.
ld: 0706-012 The -h flag is not recognized.
ld: 0706-005 Cannot find or open file: /home/labuser/.conan/data/sqlite/3.49.0100.local/ci/stable/package/bfeca2787e85f0b312aae5be67a9ae19b353b142/lib
ld:open(): A file or directory in the path name does not exist.
collect2: error: ld returned 255 exit status
make: *** [Makefile:214: sqlite3] Error 1
(8) By Stephan Beal (stephan) on 2025-02-21 15:18:32 in reply to 7.1 [link] [source]
ld: 0706-012 The -p flag is not recognized. ld: 0706-012 The -a flag is not recognized. ld: 0706-012 The -t flag is not recognized. ld: 0706-012 The -h flag is not recognized.
That and the defective --disable-shared/static handling are now fixed in the trunk and 3.49 branches. If you are able, please try the 3.49.x snapshot build which is currently at https://wasm-testing.sqlite.org/tmp/ (and will be deleted automatically in 48 hours). If that one is still broken on AIX, please post the log output (or email it if you prefer: stephan at this domain). We don't have access to an AIX system to test this on ourselves.
Whether or not "make install" will work as-is on AIX, i have no idea. If its conventions are akin to those of Linux and BSD then it should be okay, otherwise you'll likely need to customize the installation process for AIX.
(5.1) By Stephan Beal (stephan) on 2025-02-20 16:56:22 edited from 5.0 in reply to 3 [link] [source]
library is even built when I use ./configure --disable-shared ? Maybe this can be somehow fixed?
This was a bug in the recent makefile port. It's now fixed in the trunk and 3.49 branch.
A workaround which doesn't require a patch is to invoke make as:
$ make libsqlite3.a sqlite3
The problem in the current makefile is that the "all" target unconditionally invokes the DLL target, so avoiding the "all" (default) target will bypass that problem.
Alternately, here's a simple patch you can apply if you like, noting that you'll need to strip the "autoconf/" part of the path from it:
Index: autoconf/Makefile.in ================================================================== --- autoconf/Makefile.in +++ autoconf/Makefile.in @@ -147,15 +147,19 @@ $(libsqlite3.SO): sqlite3.o $(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \ $(LDFLAGS) $(LDFLAGS.libsqlite3) \ $(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname) -all: $(libsqlite3.SO) +$(libsqlite3.SO)-1: $(libsqlite3.SO) +$(libsqlite3.SO)-0: +all: $(libsqlite3.SO)-$(ENABLE_LIB_SHARED) $(libsqlite3.LIB): sqlite3.o $(AR) $(AR.flags) $@ sqlite3.o -all: $(libsqlite3.LIB) +$(libsqlite3.LIB)-1: $(libsqlite3.LIB) +$(libsqlite3.LIB)-0: +all: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC) install-so-1: $(install-dir.lib) $(libsqlite3.SO) $(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)" @if [ -f $(libsqlite3.SO).a ]; then \ $(INSTALL) $(libsqlite3.SO).a "$(install-dir.lib)"; \
One caveat, though: if --disable-static-shell
is used then --disable-shared
will have no effect, as the former flag requires building the DLL.
(6) By Stephan Beal (stephan) on 2025-02-21 03:24:41 in reply to 2.1 [link] [source]
Meanwhile i will: ... Search for an alternative solution for that feature check and the other one which is known to pass-then-fail in the same way on some platforms.
FWI: a more robust solution was found with support from Autosetup's creator, so the kludge patch from the post this one is responding to will no longer be necessary in 3.50.0 or 3.49.2. The configure-time check for the rpath flag should no longer produce false positives.