This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gnu/stubs.h misgenerated using 3.4ish gcc


> Are you sure that isn't a GCC bug also?

I think the change is that it used to omit the files from -include arguments
(i.e. include/libc-symbols.h) and now it doesn't.  It's a change, but I
don't think it's a bug.  It seems to me GCC is free to produce any valid
syntax it likes for the correct dependencies.

> If my make-fu is up to par, it will break pattern rules.  

I make no judgment on your make-fu, as mine is not what should be used as
par, for reasons that I wish could stay sealed in my juvenile record but
are at least too distasteful to bring up here.

> Not the best way to write them, necessarily, but:
> 
> a.o: a.h b.h a.c
> 
> %.o:
>         echo $<
> 
> produces a.h.

Yes, it does.  But that is not a very useful pattern rule.
A pattern rule that has a dependency is where $< normally gets used:

	a.o: a.h b.h a.c

	%.o: %.c
		compile $<

In this case, make reorders the dependency list to the one matching %.c is
first, hence $< is a.c and all is fine.  


Anyway, it's occurred to me that this whole method of discerning stubs is
broken for some cases and I want to revamp the whole thing.  For example,
in a build where some system call __NR_foobar is not defined, there may be
a sysdeps/unix/sysv/linux/foobar.c that does #ifndef __NR_foobar #include
<sysdeps/generic/foobar.c>; in this case, foobar is not flagged as a stub
in gnu/stubs.h, though it is in fact a stub with a warning.  I am thinking
of revamping the scheme not to grovel the dep files at all, but instead
examine the object (libc.so or libc.a) for what stubs there really are.
The simplest way to do this I can think of is to make the stub_warning
macro do something like strong_alias (name, _LIBC_STUB_##name) and then
grok _LIBC_STUB_* from nm/objdump output.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]