|
|
解决方法:
/usr/include/bits/stdio-lock.h 24:26 lowlevellock.h
找不到lowlevellock.h
在stdio-lock.h里面将#include<lowlevellock.h> 注掉。
然后在其后面加上一句:
#include <stdio.h>
详见:
On Tue, Oct 28, 2003 at 01:25:16PM +1100, Greg Schafer wrote:
> Now that I look at this more closely, I think the correct fix is to simply
> delete the line in "bits/stdio-lock.h" that includes lowlevellock.h
>
> The line directly above that line does this:
>
> #include <bits/libc-lock.h>
>
> and inside bits/libc-lock.h we have:
>
> #ifdef _LIBC
> # include <lowlevellock.h>
> # include <tls.h>
> # include <pthread-functions.h>
> #endif
>
> Therefore lowlevellock.h gets included anyway (when compiling glibc itself).
>
> I've confirmed that glibc still builds with my suggested change. Just have
> to run the test suite and some BLFS stuff and see if all is well to be 100%
> certain.
Well, that didn't work. As noted by Ryan, some stuff in bits/libc-lock.h is
still needed from lowlevellock.h even when not inside _LIBC.
Teemu, the instruction in the current NPTL hint to manually install the
lowlevellock.h header would appear to be bogus. Could you please explain why
it was added in the first place?
The only app I've stumbled across that won't build due to this situation is
the old gcc-2.95 libstdc++ stuff. But even when adding the lowlevellock.h
header, it still won't build.
AFAICT, the problem is only tickled when "_IO_MTSAFE_IO" is defined, which is
almost never (apart from Glibc itself and the old gcc as mentioned above).
The problem can be reproduced by adding '#include <stdio.h>' to a dummy
prog then compiling like so:
root:~# gcc dummy.c -D_IO_MTSAFE_IO
In file included from /usr/include/libio.h:168,
from /usr/include/stdio.h:72,
from dummy.c:1:
/usr/include/bits/stdio-lock.h:24:26: lowlevellock.h: No such file or directory
Now, add the lowlevellock.h header:
root:~# gcc dummy.c -D_IO_MTSAFE_IO
In file included from /usr/include/bits/stdio-lock.h:24,
from /usr/include/libio.h:168,
from /usr/include/stdio.h:72,
from dummy.c:1:
/usr/include/lowlevellock.h:95: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:99: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:102: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:208: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:210: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:211: error: parse error before "attribute_hidden"
In file included from /usr/include/bits/stdio-lock.h:24,
from /usr/include/libio.h:168,
from /usr/include/stdio.h:72,
from dummy.c:1:
/usr/include/lowlevellock.h:229:18: tls.h: No such file or directory
/usr/include/lowlevellock.h:318: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:335: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:338: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:340: error: parse error before "attribute_hidden"
/usr/include/lowlevellock.h:342: error: parse error before "attribute_hidden" |
|