diff mbox

[RFA,1/2] : Don't ignore target_header_dir when deciding inhibit_libc

Message ID 20151012095840.63E773CDC@oc7340732750.ibm.com
State New
Headers show

Commit Message

Ulrich Weigand Oct. 12, 2015, 9:58 a.m. UTC
Hans-Peter Nilsson wrote:
> > > So, ISTM we should change --with-headers (=yes) to either look
> > > in sys-include or in include.  Setting it to sys-include
> > > wouldn't help you or anyone else as it's already the default...
> > 
> > On the other hand, the current docs appear to imply that the
> > intent was for --with-headers (=yes) to look into a pre-existing
> > sys-include directory for headers.
> 
> Right.  So, if you'd prefer to align the implementation with
> that, I don't mind.  But, these are odd cases as-is, so current
> use and users matter when aligning the documentation and
> implementation and I wouldn't be surprised if the entire
> usage-space is between ours...

So overall, I now this is probably the best way forward:

1) Fix --with-headers to work just like no argument does now,
   i.e. look in sys-include.

This is a simple bugfix that brings behavior in line with
documentation.  It does imply that everybody has to use
sys-include, but that seems to be accepted practice anyway.
(For me, it just means adding a symlink.)

If at some point we do want to make things work without sys-include,
I see two options:

2a) Change <no argument> to not look into sys-include, but include.

This would be a change in existing behavior that would affect some
users.  (They could get the old behavior back by simply adding
--with-headers to their configure line, however.)

--or--

2b) Change target_header_dir from a single directory to a list of
    directories, and check all of these for header files.  This list
    would typically include both sys-include and include.

This should not change behavior for any existing user, and would
bring the header search at configure time in line with the actual
search order used by the compiler at run time, which will probably
be the least surprise to users anyway ...


For 1), something like the following should probably suffice:



I'll probably not spend any more time right now to try to implement
either of the 2) variants; I can live with using sys-include for now.

Bye,
Ulrich

Comments

Bernd Schmidt Oct. 23, 2015, 11:31 a.m. UTC | #1
On 10/12/2015 11:58 AM, Ulrich Weigand wrote:
>
> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac	(revision 228530)
> +++ gcc/configure.ac	(working copy)
> @@ -1993,7 +1993,7 @@ elif test "x$TARGET_SYSTEM_ROOT" != x; t
>   fi
>
>   if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
> -  if test "x$with_headers" != x; then
> +  if test "x$with_headers" != x && test "x$with_headers" != xyes; then
>       target_header_dir=$with_headers
>     elif test "x$with_sysroot" = x; then
>       target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"

I'm missing the beginning of this conversation, but this looks like a 
reasonable change (avoiding target_header_dir=yes for --with-headers). 
So, approved.


Bernd
Andre Vieira (lists) March 17, 2016, 4:33 p.m. UTC | #2
On 23/10/15 12:31, Bernd Schmidt wrote:
> On 10/12/2015 11:58 AM, Ulrich Weigand wrote:
>>
>> Index: gcc/configure.ac
>> ===================================================================
>> --- gcc/configure.ac    (revision 228530)
>> +++ gcc/configure.ac    (working copy)
>> @@ -1993,7 +1993,7 @@ elif test "x$TARGET_SYSTEM_ROOT" != x; t
>>   fi
>>
>>   if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
>> -  if test "x$with_headers" != x; then
>> +  if test "x$with_headers" != x && test "x$with_headers" != xyes; then
>>       target_header_dir=$with_headers
>>     elif test "x$with_sysroot" = x; then
>>      
>> target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
>>
> 
> I'm missing the beginning of this conversation, but this looks like a
> reasonable change (avoiding target_header_dir=yes for --with-headers).
> So, approved.
> 
> 
> Bernd
> 
Hi there,

I was wondering why this never made it to trunk. I am currently running
into an issue that this patch would fix.

Cheers,
Andre
Andre Vieira (lists) March 30, 2016, 3:55 p.m. UTC | #3
On 17/03/16 16:33, Andre Vieira (lists) wrote:
> On 23/10/15 12:31, Bernd Schmidt wrote:
>> On 10/12/2015 11:58 AM, Ulrich Weigand wrote:
>>>
>>> Index: gcc/configure.ac
>>> ===================================================================
>>> --- gcc/configure.ac    (revision 228530)
>>> +++ gcc/configure.ac    (working copy)
>>> @@ -1993,7 +1993,7 @@ elif test "x$TARGET_SYSTEM_ROOT" != x; t
>>>   fi
>>>
>>>   if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
>>> -  if test "x$with_headers" != x; then
>>> +  if test "x$with_headers" != x && test "x$with_headers" != xyes; then
>>>       target_header_dir=$with_headers
>>>     elif test "x$with_sysroot" = x; then
>>>      
>>> target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
>>>
>>
>> I'm missing the beginning of this conversation, but this looks like a
>> reasonable change (avoiding target_header_dir=yes for --with-headers).
>> So, approved.
>>
>>
>> Bernd
>>
> Hi there,
> 
> I was wondering why this never made it to trunk. I am currently running
> into an issue that this patch would fix.
> 
> Cheers,
> Andre
> 
We decided to apply this to the embedded-5-branch at revision r234576.

Cheers,
Andre
Andre Vieira (lists) April 7, 2016, 9:30 a.m. UTC | #4
On 17/03/16 16:33, Andre Vieira (lists) wrote:
> On 23/10/15 12:31, Bernd Schmidt wrote:
>> On 10/12/2015 11:58 AM, Ulrich Weigand wrote:
>>>
>>> Index: gcc/configure.ac
>>> ===================================================================
>>> --- gcc/configure.ac    (revision 228530)
>>> +++ gcc/configure.ac    (working copy)
>>> @@ -1993,7 +1993,7 @@ elif test "x$TARGET_SYSTEM_ROOT" != x; t
>>>   fi
>>>
>>>   if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
>>> -  if test "x$with_headers" != x; then
>>> +  if test "x$with_headers" != x && test "x$with_headers" != xyes; then
>>>       target_header_dir=$with_headers
>>>     elif test "x$with_sysroot" = x; then
>>>      
>>> target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
>>>
>>
>> I'm missing the beginning of this conversation, but this looks like a
>> reasonable change (avoiding target_header_dir=yes for --with-headers).
>> So, approved.
>>
>>
>> Bernd
>>
> Hi there,
> 
> I was wondering why this never made it to trunk. I am currently running
> into an issue that this patch would fix.
> 
> Cheers,
> Andre
> 
Ping.
Andre Vieira (lists) May 25, 2016, 5:06 p.m. UTC | #5
On 07/04/16 10:30, Andre Vieira (lists) wrote:
> On 17/03/16 16:33, Andre Vieira (lists) wrote:
>> On 23/10/15 12:31, Bernd Schmidt wrote:
>>> On 10/12/2015 11:58 AM, Ulrich Weigand wrote:
>>>>
>>>> Index: gcc/configure.ac
>>>> ===================================================================
>>>> --- gcc/configure.ac    (revision 228530)
>>>> +++ gcc/configure.ac    (working copy)
>>>> @@ -1993,7 +1993,7 @@ elif test "x$TARGET_SYSTEM_ROOT" != x; t
>>>>   fi
>>>>
>>>>   if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
>>>> -  if test "x$with_headers" != x; then
>>>> +  if test "x$with_headers" != x && test "x$with_headers" != xyes; then
>>>>       target_header_dir=$with_headers
>>>>     elif test "x$with_sysroot" = x; then
>>>>      
>>>> target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
>>>>
>>>
>>> I'm missing the beginning of this conversation, but this looks like a
>>> reasonable change (avoiding target_header_dir=yes for --with-headers).
>>> So, approved.
>>>
>>>
>>> Bernd
>>>
>> Hi there,
>>
>> I was wondering why this never made it to trunk. I am currently running
>> into an issue that this patch would fix.
>>
>> Cheers,
>> Andre
>>
> Ping.
> 
Ping.
diff mbox

Patch

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 228530)
+++ gcc/configure.ac	(working copy)
@@ -1993,7 +1993,7 @@  elif test "x$TARGET_SYSTEM_ROOT" != x; t
 fi
 
 if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
-  if test "x$with_headers" != x; then
+  if test "x$with_headers" != x && test "x$with_headers" != xyes; then
     target_header_dir=$with_headers
   elif test "x$with_sysroot" = x; then
     target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"