Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTBFS: division by zero error while building on s390x #1297

Closed
mcepl opened this issue Jul 20, 2024 · 2 comments
Closed

FTBFS: division by zero error while building on s390x #1297

mcepl opened this issue Jul 20, 2024 · 2 comments

Comments

@mcepl
Copy link

mcepl commented Jul 20, 2024

While building the package (9.3.7) the build breaks on the s390x architecture:

[   92s] FAILED: src/CMakeFiles/swiplobjs.dir/pl-wam.c.o 
[   92s] /usr/bin/cc  -I/home/abuild/rpmbuild/BUILD/swipl-9.3.7/build/src -I/home/abuild/rpmbuild/BUILD/swipl-9.3.7/src -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -O2 -gdwarf-2 -g3  -std=gnu11 -fPIC -fvisibility=hidden -Wall -fno-strict-aliasing -MD -MT src/CMakeFiles/swiplobjs.dir/pl-wam.c.o -MF src/CMakeFiles/swiplobjs.dir/pl-wam.c.o.d -o src/CMakeFiles/swiplobjs.dir/pl-wam.c.o -c /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-wam.c
[   92s] In file included from /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-wam.h:38,
[   92s]                  from /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-wam.c:42:
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-vmi.c: In function ‘PL_next_solution___LD’:
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-incl.h:593:45: error: division by zero in #if
[   92s]   593 | #define CODES_PER_WORD          (SIZEOF_WORD/SIZEOF_CODE)
[   92s]       |                                             ^
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-vmi.c:491:5: note: in expansion of macro ‘CODES_PER_WORD’
[   92s]   491 | #if CODES_PER_WORD > 1
[   92s]       |     ^~~~~~~~~~~~~~
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-incl.h:593:45: error: division by zero in #if
[   92s]   593 | #define CODES_PER_WORD          (SIZEOF_WORD/SIZEOF_CODE)
[   92s]       |                                             ^
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-vmi.c:954:5: note: in expansion of macro ‘CODES_PER_WORD’
[   92s]   954 | #if CODES_PER_WORD > 1
[   92s]       |     ^~~~~~~~~~~~~~
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-incl.h:593:45: error: division by zero in #if
[   92s]   593 | #define CODES_PER_WORD          (SIZEOF_WORD/SIZEOF_CODE)
[   92s]       |                                             ^
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-vmi.c:2485:5: note: in expansion of macro ‘CODES_PER_WORD’
[   92s]  2485 | #if CODES_PER_WORD > 1
[   92s]       |     ^~~~~~~~~~~~~~
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-incl.h:593:45: error: division by zero in #if
[   92s]   593 | #define CODES_PER_WORD          (SIZEOF_WORD/SIZEOF_CODE)
[   92s]       |                                             ^
[   92s] /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-vmi.c:3865:5: note: in expansion of macro ‘CODES_PER_WORD’
[   92s]  3865 | #if CODES_PER_WORD > 1
[   92s]       |     ^~~~~~~~~~~~~~
[   93s] [42/2598] /usr/bin/cc  -I/home/abuild/rpmbuild/BUILD/swipl-9.3.7/build/src -I/home/abuild/rpmbuild/BUILD/swipl-9.3.7/src -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -O2 -gdwarf-2 -g3  -std=gnu11 -fPIC -fvisibility=hidden -Wall -fno-strict-aliasing -MD -MT src/CMakeFiles/swiplobjs.dir/pl-arith.c.o -MF src/CMakeFiles/swiplobjs.dir/pl-arith.c.o.d -o src/CMakeFiles/swiplobjs.dir/pl-arith.c.o -c /home/abuild/rpmbuild/BUILD/swipl-9.3.7/src/pl-arith.c
[   93s] ninja: build stopped: subcommand failed.

Complete build log with all details of reproducing the issue.

@JanWielemaker
Copy link
Member

Hmm. This means SIZEOF_VOIDP is 0. That is set from check_type_size("void *" SIZEOF_VOIDP). CMake says this is 0 if the type is unknown (should not be the case) or the value is architecture dependent. Could that be our problem? We do need these sizes at compile time.

@mcepl
Copy link
Author

mcepl commented Jul 22, 2024

Oh, shut, it is a duplicate of #1286

@mcepl mcepl closed this as completed Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants