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

arm-linux: undefined reference to `WIFSIGNALED' #144

Open
Miaou opened this issue Nov 20, 2017 · 1 comment
Open

arm-linux: undefined reference to `WIFSIGNALED' #144

Miaou opened this issue Nov 20, 2017 · 1 comment

Comments

@Miaou
Copy link

Miaou commented Nov 20, 2017

In a cross compilation environment targeting arm-linux, linking libbcheck 0.11.0 fails after cmake .. && cmake --build . --target install:

Linking C executable check_check
../src/libcheck.a(check_run.c.o): In function `set_fork_info':
/tmp/check-0.11.0/src/check_run.c:569: undefined reference to `WIFSIGNALED'
/tmp/check-0.11.0/src/check_run.c:570: undefined reference to `WIFEXITED'
/tmp/check-0.11.0/src/check_run.c:571: undefined reference to `WEXITSTATUS'
/tmp/check-0.11.0/src/check_run.c:572: undefined reference to `WTERMSIG'
../src/libcheck.a(check_run.c.o): In function `waserror':
/tmp/check-0.11.0/src/check_run.c:714: undefined reference to `WIFSIGNALED'
/tmp/check-0.11.0/src/check_run.c:715: undefined reference to `WIFEXITED'
/tmp/check-0.11.0/src/check_run.c:716: undefined reference to `WEXITSTATUS'
/tmp/check-0.11.0/src/check_run.c:717: undefined reference to `WTERMSIG'

Adding #include <sys/wait.h> to src/check_run.c fixes the problem.

@brarcher
Copy link
Contributor

Do you know if cross compiling with the configure script is successful? The CMake support was initially added to support non-Unix platforms (e.g. Windows), and is not as mature for *unix or cross compiling.

I see that there is a check in configure.ac for the sys/wait.h header, which then controls an optional include in libcompat.h that is included in check_run.c. There is no such check in the CMake scripts, which was likely overlooked as Windows does not support fork() so that code is never compiled.

If using the configure script is sufficient, then perhaps go with that. If not, and you are up for adding the necessary support to the CMake scripts, I'll gladly accept your fixes. (:

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