* Re: Compiler issue due to 'reduce spurious inclusion of libc.h'
[not found] <2460319.yjTd4jG3Ff@debian64>
@ 2018-09-14 20:29 ` Rich Felker
0 siblings, 0 replies; only message in thread
From: Rich Felker @ 2018-09-14 20:29 UTC (permalink / raw)
To: Christian Lamparter; +Cc: musl
On Fri, Sep 14, 2018 at 10:18:15PM +0200, Christian Lamparter wrote:
> Hello,
>
> I noticed that you published a ton of new patches for 1.1.20+ and since
> I'm currently doing a OpenWrt patch to include musl 1.1.20 I had to test
> them out on my OpenWrt powerpc target.
>
> I can report that everything compiled fine, but I had this little hick-up
> along the way:
>
> |src/conf/sysconf.c: In function 'sysconf':
> |src/conf/sysconf.c:190:10: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'JT_PAGE_SIZE'?
> | return PAGE_SIZE;
> | ^~~~~~~~~
> |src/conf/sysconf.c:190:10: note: each undeclared identifier is reported only once for each function it appears in
>
> >From what I can tell, the file had a #include "libc.h" that got
> removed by the 'reduce spurious inclusion of libc.h' patch. For
> my local testing, I just added it back.
>
> Thank you for your great work,
> Christian
Thanks for the catch! I was testing on i386 where PAGE_SIZE is a
constant and libc.h is not needed to get it.
$ grep -L libc.h $(grep -rl PAGE_SIZE src/)
src/aio/lio_listio.c
src/internal/libc.h
src/conf/sysconf.c
Looks like in principle there's one other file that has the issue, but
it's including pthread_arch.h which includes libc.h.
I'm thinking about breaking up the libc struct -- the original purpose
of it was to be a single point where declaring hidden visibility was
needed, with a fallback to using an accessor function call and
-Bsymbolic to achieve the same thing on theoretical compilers without
visibility, but that was dropped a long time ago. If I do this, I'll
just make it an external hidden __page_size and have a wrapper for
limits.h that defines it, so libc.h isn't needed. This situation of
having whether it breaks being arch-specific is not nice.
Rich
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-14 20:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <2460319.yjTd4jG3Ff@debian64>
2018-09-14 20:29 ` Compiler issue due to 'reduce spurious inclusion of libc.h' Rich Felker
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).