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

Compilation failure on OS X 10.10.5 (darwin 14.5.0) #443

Closed
andaru opened this issue Feb 17, 2018 · 0 comments
Closed

Compilation failure on OS X 10.10.5 (darwin 14.5.0) #443

andaru opened this issue Feb 17, 2018 · 0 comments

Comments

@andaru
Copy link
Contributor

andaru commented Feb 17, 2018

Problem: libyang doesn't build on an OS X 10.10.5 systems (perhaps all versions 10.10 or less, judging by similar bugs in other repositories).

$ make 
Scanning dependencies of target yangobj
[  2%] Building C object CMakeFiles/yangobj.dir/src/common.c.o
[  5%] Building C object CMakeFiles/yangobj.dir/src/context.c.o
[  8%] Building C object CMakeFiles/yangobj.dir/src/log.c.o
[ 10%] Building C object CMakeFiles/yangobj.dir/src/dict.c.o
[ 13%] Building C object CMakeFiles/yangobj.dir/src/resolve.c.o
[ 16%] Building C object CMakeFiles/yangobj.dir/src/validation.c.o
[ 18%] Building C object CMakeFiles/yangobj.dir/src/xml.c.o
[ 21%] Building C object CMakeFiles/yangobj.dir/src/parser.c.o
/Users/me/go/src/github.com/CESNET/libyang/src/parser.c:288:74: error: use of undeclared identifier 'MAP_ANONYMOUS'
        addr = mmap(NULL, *length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                                                                         ^
1 error generated.
make[2]: *** [CMakeFiles/yangobj.dir/src/parser.c.o] Error 1
make[1]: *** [CMakeFiles/yangobj.dir/all] Error 2
make: *** [all] Error 2

Darwin's POSIX headers only define MAP_ANON, hence adding this to src/parser.c corrects the issue for me.

#ifdef __APPLE__
#define MAP_ANONYMOUS MAP_ANON
#endif
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