mailing list of musl libc
 help / color / mirror / code / Atom feed
* Missing header(s)
@ 2012-02-20 17:24 Isaac Dunham
  2012-02-20 19:17 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Isaac Dunham @ 2012-02-20 17:24 UTC (permalink / raw)
  To: musl

ar.h is a header that defines struct ar_hdr and several components.
Needed for at least GNU make-3.81 (I'm sticking with the last GPL2+ version, myself).
Included in NetBSD libc and glibc.
Copying the NetBSD version over worked fine for me; it doesn't define anything internal to the libc, and different implementations are functionally equivalent.

By the way, I've put together a sys/cdefs.h header that gets a lot of stuff to compile; ~95% of it is backwards-compatability macros. If you want, I can submit it; I'd add 
#warn "sys/cdefs.h is not standard, and the macros are easily removed"
or some such message.
#include'ing <sys/cdefs.h> is semi-portable, though (NetBSD, GNU libc)--and the only option if you need to support some old systems as well as c99.

-- 
Isaac Dunham <idunham@lavabit.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Missing header(s)
  2012-02-20 17:24 Missing header(s) Isaac Dunham
@ 2012-02-20 19:17 ` Rich Felker
  2012-02-21  1:15   ` Isaac Dunham
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2012-02-20 19:17 UTC (permalink / raw)
  To: musl

On Mon, Feb 20, 2012 at 09:24:59AM -0800, Isaac Dunham wrote:
> ar.h is a header that defines struct ar_hdr and several components.

Yeah, I've gotten this report before and just haven't gotten around to
adding it. I have no objection to adding ar.h though.

> Needed for at least GNU make-3.81 (I'm sticking with the last GPL2+
> version, myself).

Doesn't 3.81 already have some important bugs you need to patch
anyway? If so you could add ar.h at the same time. This won't be
needed for musl once I get ar.h added, but it would make the resulting
build more portable anyway.

> By the way, I've put together a sys/cdefs.h header that gets a lot
> of stuff to compile; ~95% of it is backwards-compatability macros.
> If you want, I can submit it; I'd add

I wouldn't mind seeing it, and as long as it's clean I'll probably add
it...

> #include'ing <sys/cdefs.h> is semi-portable, though (NetBSD, GNU
> #libc)--and the only option if you need to support some old systems
> #as well as c99.

I'm confused how it would be necessary for this. The __STDC__ and
__STDC_VERSION__ macros give you all you need to make the appropriate
definitions yourself if you really need to support pre-standardized C.
If you just need to support C89 and C99, you'd rarely have to test
anything anyway; just use the intersection of the 2 languages (which
is equivalent to C89, except that you can't use C99 keywords like
inline, restrict, _Bool, etc.).

As such, I still see apps that include sys/cdefs.h as buggy.

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Missing header(s)
  2012-02-20 19:17 ` Rich Felker
@ 2012-02-21  1:15   ` Isaac Dunham
  0 siblings, 0 replies; 3+ messages in thread
From: Isaac Dunham @ 2012-02-21  1:15 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1804 bytes --]

On Mon, 20 Feb 2012 14:17:03 -0500
Rich Felker <dalias@aerifal.cx> wrote:
 
> Doesn't 3.81 already have some important bugs you need to patch
> anyway? If so you could add ar.h at the same time. This won't be
> needed for musl once I get ar.h added, but it would make the resulting
> build more portable anyway.

It's running OK without patches, but I haven't pushed too hard.  As mentioned, I just copied ar.h to /usr/include.
 
> > By the way, I've put together a sys/cdefs.h header that gets a lot
> > of stuff to compile; ~95% of it is backwards-compatability macros.
> > If you want, I can submit it; I'd add
> I wouldn't mind seeing it, and as long as it's clean I'll probably add
> it...
> 
> > #include'ing <sys/cdefs.h> is semi-portable, though (NetBSD, GNU
> > libc)--and the only option if you need to support some old systems
> > as well as c99.
> 
> I'm confused how it would be necessary for this. The __STDC__ and
> __STDC_VERSION__ macros give you all you need to make the appropriate
> definitions yourself if you really need to support pre-standardized C.
> If you just need to support C89 and C99, you'd rarely have to test
> anything anyway; just use the intersection of the 2 languages (which
> is equivalent to C89, except that you can't use C99 keywords like
> inline, restrict, _Bool, etc.).

It looks like it's meant to have one header allow the same source to build 
with anything from K&R to C99 (in theory).

> As such, I still see apps that include sys/cdefs.h as buggy.
> Rich

I view it like features.h: nonsense, but if it's a choice between getting it building in a minute or an hour, I'd rather get it building sooner.  Once I know how broken it is, I can decide whether to clean it up, forget it, or delete it.  I'd rather not waste my time on completely broken code.


[-- Attachment #2: cdefs.h --]
[-- Type: text/x-chdr, Size: 653 bytes --]

/* Legacy, meant only for glibc compatability 
 * These were ripped off from glibc sys/cdefs.h
 */
#warn "sys/cdefs.h is only meant as a temporary measure"
#warn "Any code that requires it needs cleanup"
#ifndef _SYS_CDEFS_H_
#define _SYS_CDEFS_H_

#undef __P
#undef __PMT
#undef __NTH
#define __THROW
#define __P(param)	param
#define __PMT(param)	param
#define __NTH(param)	param
#define __CONCAT(x,y)	x ## y
#define __STRING(x)	#x
#define __ptr_t void *
#define __long_double_t  long double

#ifdef	__cplusplus
# define __BEGIN_DECLS	extern "C" {
# define __END_DECLS	}
#else
# define __BEGIN_DECLS
# define __END_DECLS
#endif
#endif /* _SYS_CDEFS_H_

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-21  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-20 17:24 Missing header(s) Isaac Dunham
2012-02-20 19:17 ` Rich Felker
2012-02-21  1:15   ` Isaac Dunham

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).