OpenSmalltalk / opensmalltalk-vm

Cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak.
http://opensmalltalk.org/
Other
557 stars 111 forks source link

Fails to compile on EndeavourOS #685

Open Kirtai opened 3 months ago

Kirtai commented 3 months ago

Fails to compile on EndeavourOS (Arch Linux derivative with the following errors.

clang version 17.0.6 (gcc version 14.1.1 also fails)

clang -Wall  -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -I/usr/include -I/usr/include  -DHAVE_CONFIG_H  -DSQUEAK_BUILTIN_PLUGIN -I/home/faith/tmp/build/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/faith/tmp/build/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm -I/home/faith/tmp/build/opensmalltalk-vm/platforms/Cross/vm -I/home/faith/tmp/build/opensmalltalk-vm/src/spur64.cog -I/usr/local/include -I/home/faith/tmp/build/opensmalltalk-vm/platforms/Cross/vm -I/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm -I/home/faith/tmp/build/opensmalltalk-vm/src/spur64.cog -I/home/faith/tmp/build/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin -I/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -I/usr/include -I/usr/include   -c -o sqUnixMain.o /home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c
/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1792:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
 1792 |                 printf(optionStrings[count]);
      |                        ^~~~~~~~~~~~~~~~~~~~
/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1792:10: note: treat the string as an argument to avoid this
 1792 |                 printf(optionStrings[count]);
      |                        ^
      |                        "%s", 
/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2107:79: warning: result of comparison of constant 139 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
 2107 |                 fd = ((char *)embeddedImage)[0] == GZIPMagic0 && ((char *)embeddedImage)[1] == GZIPMagic1
      |                                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~
/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2266:38: error: incompatible function pointer types assigning to 'void (*)(int, siginfo_t *, void *)' from 'void (int, siginfo_t *, ucontext_t *)' (aka 'void (int, siginfo_t *, struct ucontext_t *)') [-Wincompatible-function-pointer-types]
 2266 |         sigsegv_handler_action.sa_sigaction = sigsegv;
      |                                             ^ ~~~~~~~
/home/faith/tmp/build/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2273:38: error: incompatible function pointer types assigning to 'void (*)(int, siginfo_t *, void *)' from 'void (int, siginfo_t *, ucontext_t *)' (aka 'void (int, siginfo_t *, struct ucontext_t *)') [-Wincompatible-function-pointer-types]
 2273 |         sigusr1_handler_action.sa_sigaction = sigusr1;
      |                                             ^ ~~~~~~~
2 warnings and 2 errors generated.
make[1]: *** [Makefile:301: sqUnixMain.o] Error 1
make: *** [Makefile:413: vm/vm.a] Error 2
nafiz1001 commented 3 months ago

Can confirm I get similar error on tag 202312181441 (and also on the recent Cog branch)

/home/nafiz/projects/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2324:38: error: incompatible function pointer types assigning to 'void (*)(int, siginfo_t *, void *)' from 'void (int, siginfo_t *, ucontext_t *)' (aka 'void (int, siginfo_t *, struct ucontext_t *)') [-Wincompatible-function-pointer-types]
 2324 |         sigsegv_handler_action.sa_sigaction = sigsegv;
      |                                             ^ ~~~~~~~
/home/nafiz/projects/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2331:38: error: incompatible function pointer types assigning to 'void (*)(int, siginfo_t *, void *)' from 'void (int, siginfo_t *, ucontext_t *)' (aka 'void (int, siginfo_t *, struct ucontext_t *)') [-Wincompatible-function-pointer-types]
 2331 |         sigusr1_handler_action.sa_sigaction = sigusr1;
      |                                             ^ ~~~~~~~
1 warning and 2 errors generated.
make[1]: *** [Makefile:299: sqUnixMain.o] Error 1
make: *** [Makefile:413: vm/vm.a] Error 2

Clang version:

clang version 18.1.6 (Fedora 18.1.6-3.fc40)

I'm on Fedora 40 Workstation.

nafiz1001 commented 2 months ago

@Kirtai I think this commit should fix your problem?

I'm on a different OS which already compiled successfully so I can't verify this on my side.