This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH] Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h


On 06/08/2016 04:54 PM, Florian Weimer wrote:
> On 06/08/2016 10:03 PM, Carlos O'Donell wrote:
>> On 06/08/2016 11:08 AM, Florian Weimer wrote:
>>> Otherwise, /usr/include/stdlib.h turns up as a make dependency, 
>>> and an implicit rule will kick and make will try to install 
>>> stdlib/stdlib.h as /usr/include/stdlib.h because the target is
>>> out of date.
>>> 
>>> 2016-06-08  Florian Weimer  <fweimer@redhat.com>
>>> 
>>> Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h. *
>>> stdlib/tst-quick_exit.cc: Include <stdlib.h> before <cstdlib>. *
>>> stdlib/tst-thread-quick_exit.cc: Likewise.
>> 
>> OK, with source code comment explaining why 'stdlib.h' is being
>> included.
> 
> I must have botched my initial testing.  Including <stdlib.h> first
> does not fix this problem.  It seems the only way is to use
> <stdlib.h> exclusively and drop the std:: namespace usage, and use
> <pthread.h> instead of <thread>. (<thread> indirectly pulls in
> /usr/include/c++/6.1.1/ext/string_conversions.h, which includes
> <cstdlib>).

That sounds terrible.

>> What's going to be our long-term solution to this problem?
> 
> Merge the C and C++ run-time library implementations. :)

No, the real solution is installed-tree testing.

We install glibc into a sysroot and properly use --sysroot
for building test.

This would move us one step closer to having our tests resemble
real user applications.
 
> Various kludges are possible: List the GCC default search paths,
> patch them, and specify them along with -nostdinc.  Do not use
> #include_next, but an #include with an absolute path, where the path
> prefix can be configured with a preprocessor macro (#include
> arguments are subject to macro expansion, although this feature is
> used rarely).  I'll ask Jonathan, maybe he has some ideas.

Thanks.

In the meantime, please checkin whatever fix you have.

-- 
Cheers,
Carlos.


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