Closed Bug 1128184 Opened 11 years ago Closed 10 years ago

Build with musl libc

Categories

(NSS :: Libraries, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: felix.janda, Assigned: felix.janda)

References

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (X11; U; Unix; en-US) AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 Safari/537.15 Surf/0.6 Steps to reproduce: Try to build on a musl libc based system http://musl-libc.org Actual results: Compilation failure because lib/dbm/mcom_db.h tries to include sys/cdefs.h although it does not exist.
A possible fix is to remove all support code in lib/dbm for pre-ANSI-C compilers, which is what <sys/cdefs.h> had been used for. The rest of nss will not build without an ANSI-C compiler anyway.
Forgot also to remove HAVE_CDEFS_H in the Makefile.
Attachment #8557513 - Attachment is obsolete: true
To document the patch: * expand __P(x) to x (valid on ANSI C) * expand __BEGIN_DECLS and __END_DECLS * remove code behind #ifndef __STDC__ * remove all references to cdefs.h (snprintf() in snprintf.c is a nice example for the difference between function declarations in K&R and ANSI C.)
Attachment #8557573 - Flags: review?(kaie)
Attachment #8557573 - Flags: review?(kaie) → review?(wtc)
Hi Felix, Thanks for the patch. I made the following two changes to your patch. 1. I removed the space before the __P macros. 2. I found that the mpool.h header, which uses the __BEGIN_DECLS and __END_DECLS macros, is not used. So I simply removed it. Please review and test this patch. Thanks.
Assignee: nobody → wtc
Attachment #8557573 - Attachment is obsolete: true
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8557573 - Flags: review?(wtc)
Attachment #8625378 - Flags: review?(felix.janda)
Comment on attachment 8625378 [details] [diff] [review] Remove support for pre-ANSI-C compilers, v2, by Felix Janda Review of attachment 8625378 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me and builds fine. Thanks!
Attachment #8625378 - Flags: review?(felix.janda) → review+
Comment on attachment 8625378 [details] [diff] [review] Remove support for pre-ANSI-C compilers, v2, by Felix Janda Thanks for the review. Patch checked in to the NSS repository: https://hg.mozilla.org/projects/nss/rev/1c628bb28ce0
Attachment #8625378 - Flags: checked-in+
Assignee: wtc → felix.janda
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Component: Build → Libraries
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → 3.20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: