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

sys/cdefs.h is an internal glibc header and should not be used #2

Open
alex-v77 opened this issue Sep 13, 2018 · 3 comments
Open

sys/cdefs.h is an internal glibc header and should not be used #2

alex-v77 opened this issue Sep 13, 2018 · 3 comments

Comments

@alex-v77
Copy link

The include/db.h file includes sys/cdefs.h which is an internal glibc header that may not exist in other libc implementations and thus should not be used.

Compilation with musl libc fails:

In file included from ../../lib/berkeley-db-1.xx/btree/bt_seq.c:48:0:
../../lib/berkeley-db-1.xx/PORT/include/db.h:40:23: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
In file included from ../../lib/berkeley-db-1.xx/btree/bt_split.c:48:0:
../../lib/berkeley-db-1.xx/PORT/include/db.h:40:23: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
In file included from ../../lib/berkeley-db-1.xx/btree/bt_utils.c:47:0:
../../lib/berkeley-db-1.xx/PORT/include/db.h:40:23: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
In file included from ../../lib/berkeley-db-1.xx/mpool/mpool.c:46:0:
../../lib/berkeley-db-1.xx/PORT/include/db.h:40:23: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
[...other files of berkeley-db include db.h too...]

@pfalcon
Copy link
Owner

pfalcon commented Sep 13, 2018

Did you try to report this to musl, that they aren't compatible with well-known software like BerkeleyDB?

I hope to get to building with musl eventually and see what should be done.

@alex-v77
Copy link
Author

They are aware of the issues with sys/cdefs.h.

From their FAQ:

https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

"Q: When compiling something against musl, I get error messages about sys/cdefs.h"
[...]
"The bug is in the application that uses this internal glibc header. This header is not intended to be used by any program."

and in my opinion they're right, this header should not be used.

@pfalcon
Copy link
Owner

pfalcon commented Sep 13, 2018

They're apparently wrong with at least one point - that it's internal glibc header, apparently it comes from BSD and/or SysV times.

Feel free to propose a patch, should be simple I guess. But please feel free to test with glibc, musl, newlib, uclibc, bionic. (Or somebody else might need to test.)

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