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

Broken build with libcheck >= 0.13.0 #22

Closed
bkuhls opened this issue Aug 29, 2020 · 3 comments · Fixed by #39
Closed

Broken build with libcheck >= 0.13.0 #22

bkuhls opened this issue Aug 29, 2020 · 3 comments · Fixed by #39

Comments

@bkuhls
Copy link

bkuhls commented Aug 29, 2020

Quoted from signalwire/freeswitch#681

When building freeswitch in buildroot I see the following build failure.

Making all in s2check
make[8]: Entering directory '/home/buildroot/autobuild/instance-0/output-1/build/freeswitch-1.10.3/libs/sofia-sip/s2check'
	 COMPILE s2tcase.o
	 COMPILE s2base.o
	 COMPILE s2sip.o
	 COMPILE s2_localinfo.o
s2tcase.c: In function 's2_tcase_add_test':
s2tcase.c:60:27: warning: passing argument 2 of '_tcase_add_test' from incompatible pointer type [-Wincompatible-pointer-types]
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
                           ^~
In file included from s2tcase.c:35:
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:331:69: note: expected 'const TTest *' {aka 'const struct TTest *'} but argument is of type 'TFun' {aka 'void (*)(int)'}
 CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest,
                                                       ~~~~~~~~~~~~~~^~~~~
s2tcase.c:60:31: warning: passing argument 3 of '_tcase_add_test' makes integer from pointer without a cast [-Wint-conversion]
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
                               ^~~~
In file included from s2tcase.c:35:
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:332:47: note: expected 'int' but argument is of type 'const char *'
                                           int _signal, int allowed_exit_value,
                                           ~~~~^~~~~~~
s2tcase.c:60:7: error: too many arguments to function '_tcase_add_test'
       _tcase_add_test(tc, tf, name, signo, 0, start, end);
       ^~~~~~~~~~~~~~~
In file included from s2tcase.c:35:_tcase_add_test(tc, tf, name, signo, 0, start, end);
/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-musleabihf/sysroot/usr/include/check.h:331:27: note: declared here
 CK_DLL_EXP void CK_EXPORT _tcase_add_test(TCase * tc, const TTest * ttest,
                           ^~~~~~~~~~~~~~~
@bkuhls
Copy link
Author

bkuhls commented Aug 29, 2020

Quoted from signalwire/freeswitch#681 (comment)

The root cause is that the check API changed in commit libcheck/check@3987c1d where the number of parameters decreased from 7 to 6, when it lost the const char * fname (third) parameter.

This change is present in check version 0.13.0 onward, relased 2019-10-21. Note that the previous relase, 0.12.0 was from 2017-10-20, more than two years before...

So, as time passes, distros will get updated with a newer check version, and the problem will occur on newer systems.

@bkuhls
Copy link
Author

bkuhls commented Aug 29, 2020

Possible fix from signalwire/freeswitch#681 (comment)

Reverting only the changes in s2tcase.c fixes the problem seen in buildroot for me:
2dced93#diff-f47ff3b577412018f6faa1db68dae9c9

@mjerris
Copy link
Member

mjerris commented Aug 29, 2020

The issue is that libcheck changed api multiple times. i’d be happy to review a patch that properly handles the 3 different api changes that happened in libcheck so it can build with all of them. in the mean time it will build fine if you uninstall the libcheck dev packages or headers before running configure or force configure to not detect it.

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

Successfully merging a pull request may close this issue.

2 participants