-
Notifications
You must be signed in to change notification settings - Fork 296
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
Unable to build libyang on FreeBSD #17
Comments
Seems that the -coverage option is not very portable (#17), so move it from DEBUG build in cmake into the Travis config file, since we codecov from Travis.
Sorry, my previous post was a bit misleading, the build has failed there due to missing libprofile, which is actually not needed for Release build. However, the build is still failing even in Release mode. This can be work-arounded with omitting build of lint (without it the build passes, but still with quite a lot of warnings). The full log from Release build: $ make Stop. Stop. Stop. |
I'm not able to provide support on FreeBSD, but: ad asprintf() - the warnings are strange, according to freeBSD man pages the asprintf() should be available since FreeBSD 2.2 and from that man page I don't see if there is a need for some special header. ad linker error - seems to be the problem of -coverage option, I'll try to fix the problem. |
Seems that the -coverage option is not very portable (#17), so move it from DEBUG build in cmake into the Travis config file, since we codecov from Travis.
strdupa() and get_current_dir_name() issues are expected on FreeBSD, in these cases we use GNU extensions that are probably not available on BSD systems. |
Please try it now with the devel branch, I'm not able to test it. If it will be ok, I'll merge the changes into the master branch. |
Thanks, I really appreciate your efforts to make libyang working also on Unixes. I have tested the code in devel. Some minor changes in includes are still needed in common.c:
Unfortunately, there are still two issues by linking: Regarding asprintf() warnings: FreeBSD supports asprintf(), and it is available there by default, but the #define _XOPEN_SOURCE 700 hides it, since asprintf() is not part of the POSIX 2008 standard. I have tried to remove this define from affected sources - the warning has disappeared |
Seems that the undefined references relates to forgotten linkage of libmath. Please try 0.6.6 from devel branch. |
The #ifdef linux above including limits.h and sys/syscall.h common.c is wrong, should be #ifndef linux (although I think that these includes are also valid for Linux and the ifdef may not be needed at all). Apart of it, the build works without any errors and warnings! |
Sorry, to be more precise... We still need #include of limits.h on BSD, otherwise we get: I see that sys/sycall.h is not needed anymore on non-Linux platforms due to #ifdef in the code of ly_errno_location. |
At the end I removed the preprocessor directives from the include part to avoid multiple if(n)defs there - one would be for |
Right, I think that this is the best solution. The build works fine now, thanks! |
Seems that the -coverage option is not very portable (#17), so move it from DEBUG build in cmake into the Travis config file, since we codecov from Travis.
$ cc -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix
2 warnings generated.
[ 33%] Building C object CMakeFiles/yang.dir/src/parser_yin.c.o
[ 37%] Building C object CMakeFiles/yang.dir/src/parser_xml.c.o
[ 40%] Building C object CMakeFiles/yang.dir/src/parser_json.c.o
[ 44%] Building C object CMakeFiles/yang.dir/src/tree_schema.c.o
[ 48%] Building C object CMakeFiles/yang.dir/src/tree_data.c.o
/usr/home/rasto/lib/libyang/src/tree_data.c:360:5: warning: implicit declaration of function 'asprintf' is invalid in C99 [-Wimplicit-function-declaration]
asprintf(&xml, "<%s>%s</%s>", schema->name, (val_xml ? val_xml : ""), schema->name);
^
1 warning generated.
[ 51%] Building C object CMakeFiles/yang.dir/src/printer.c.o
[ 55%] Building C object CMakeFiles/yang.dir/src/xpath.c.o
/usr/home/rasto/lib/libyang/src/xpath.c:842:13: warning: implicit declaration of function 'asprintf' is invalid in C99 [-Wimplicit-function-declaration]
asprintf(&str_num, "%lld", (long long)set->value.num);
^
1 warning generated.
[ 59%] Building C object CMakeFiles/yang.dir/src/printer_yang.c.o
[ 62%] Building C object CMakeFiles/yang.dir/src/printer_xml.c.o
[ 66%] Building C object CMakeFiles/yang.dir/src/printer_tree.c.o
[ 70%] Building C object CMakeFiles/yang.dir/src/printer_info.c.o
[ 74%] Building C object CMakeFiles/yang.dir/src/printer_json.c.o
[ 77%] Building C object CMakeFiles/yang.dir/src/yang_types.c.o
[ 81%] Linking C shared library libyang.so
/usr/bin/ld: /usr/bin/../lib/libprofile_rt.a: No such file: No such file or directory
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Stop.
make[2]: stopped in /usr/home/rasto/lib/libyang/build
*** Error code 1
Stop.
make[1]: stopped in /usr/home/rasto/lib/libyang/build
*** Error code 1
Stop.
make: stopped in /usr/home/rasto/lib/libyang/build
The text was updated successfully, but these errors were encountered: