If I try to build with -DSWIPL_STATIC_LIB=ON -DSTATIC_EXTENSIONS=ON
the first problem is that -DCMAKE_BUILD_TYPE=PGO
doesn’t work, but even if I switch to -DCMAKE_BUILD_TYPE=Release
the build blows up:
[382/2559] Building C object src/CMakeFiles/swiplobjs.dir/os/pl-cstack.c.o
FAILED: src/CMakeFiles/swiplobjs.dir/os/pl-cstack.c.o
/opt/rh/devtoolset-12/root/usr/bin/cc -Isrc -I../src -O2 -fvisibility=hidden -Wall -fno-strict-aliasing -std=gnu11 -MD -MT src/CMakeFiles/swiplobjs.dir/os/pl-cstack.c.o -MF src/CMakeFiles/swiplobjs.dir/os/pl-cstack.c.o.d -o src/CMakeFiles/swiplobjs.dir/os/pl-cstack.c.o -c ../src/os/pl-cstack.c
../src/os/pl-cstack.c: In function ‘print_trace’:
../src/os/pl-cstack.c:425:15: warning: unused variable ‘info’ [-Wunused-variable]
425 | { Dl_info info;
| ^~~~
../src/os/pl-cstack.c: At top level:
../src/os/pl-cstack.c:456:5: error: expected identifier or ‘(’ before ‘else’
456 | } else
| ^~~~
../src/os/pl-cstack.c:459:1: error: expected identifier or ‘(’ before ‘}’ token
459 | }
| ^
../src/os/pl-cstack.c:356:1: warning: ‘addr2line’ defined but not used [-Wunused-function]
356 | addr2line(const char *fname, uintptr_t offset, char *buf, size_t size)
| ^~~~~~~~~
[404/2559] Building C object src/CMakeFiles/swiplobjs.dir/pl-index.c.o
In file included from ../src/pl-incl.h:2968,
from ../src/pl-index.h:37,
from ../src/pl-index.c:37:
../src/pl-data.h: In function ‘update_primary_index___LD’:
../src/pl-data.h:213:30: warning: ‘key’ may be used uninitialized [-Wmaybe-uninitialized]
213 | #define tagex(w) ((w) & (TAG_MASK|STG_MASK))
| ^
../src/pl-index.c:3629:10: note: ‘key’ was declared here
3629 | word key;
| ^~~
[415/2559] Building C object src/CMakeFiles/swiplobjs.dir/pl-wam.c.o
ninja: build stopped: subcommand failed.