diff mbox

Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573]

Message ID 230d2cab-8085-bb7e-68cc-38de409397a7@redhat.com
State New
Headers show

Commit Message

Florian Weimer June 13, 2017, 8:13 p.m. UTC
On 06/13/2017 01:54 PM, H.J. Lu wrote:
> -    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
> +    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
>    }
>    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
> +  # Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
> +  # including /usr/include/stdlib.h.
> +  CXX_CSTDLIB_HEADER="$CXX_CSTDLIB_HEADER $(find_cxx_header bits/std_abs.h)"

I think the attached patch is needed to suppress the error message if
the header does not exist.  (Regenerated configure file not shown in the
patch.)

Thanks,
Florian

Comments

H.J. Lu June 13, 2017, 8:21 p.m. UTC | #1
On Tue, Jun 13, 2017 at 1:13 PM, Florian Weimer <fweimer@redhat.com> wrote:
> On 06/13/2017 01:54 PM, H.J. Lu wrote:
>> -    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
>> +    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
>>    }
>>    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
>> +  # Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
>> +  # including /usr/include/stdlib.h.
>> +  CXX_CSTDLIB_HEADER="$CXX_CSTDLIB_HEADER $(find_cxx_header bits/std_abs.h)"
>
> I think the attached patch is needed to suppress the error message if
> the header does not exist.  (Regenerated configure file not shown in the
> patch.)
>

LGTM.

Thanks.
H.J. Lu Sept. 7, 2017, 5:26 p.m. UTC | #2
On Tue, Jun 13, 2017 at 1:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jun 13, 2017 at 1:13 PM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 06/13/2017 01:54 PM, H.J. Lu wrote:
>>> -    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
>>> +    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
>>>    }
>>>    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
>>> +  # Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
>>> +  # including /usr/include/stdlib.h.
>>> +  CXX_CSTDLIB_HEADER="$CXX_CSTDLIB_HEADER $(find_cxx_header bits/std_abs.h)"
>>
>> I think the attached patch is needed to suppress the error message if
>> the header does not exist.  (Regenerated configure file not shown in the
>> patch.)
>>
>
> LGTM.
>

Here is a patch to backport these 2 patches to 2.25 branch.   Any
comments?
H.J. Lu Sept. 11, 2017, 3:53 p.m. UTC | #3
On Thu, Sep 7, 2017 at 10:26 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jun 13, 2017 at 1:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Tue, Jun 13, 2017 at 1:13 PM, Florian Weimer <fweimer@redhat.com> wrote:
>>> On 06/13/2017 01:54 PM, H.J. Lu wrote:
>>>> -    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
>>>> +    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
>>>>    }
>>>>    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
>>>> +  # Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
>>>> +  # including /usr/include/stdlib.h.
>>>> +  CXX_CSTDLIB_HEADER="$CXX_CSTDLIB_HEADER $(find_cxx_header bits/std_abs.h)"
>>>
>>> I think the attached patch is needed to suppress the error message if
>>> the header does not exist.  (Regenerated configure file not shown in the
>>> patch.)
>>>
>>
>> LGTM.
>>
>
> Here is a patch to backport these 2 patches to 2.25 branch.   Any
> comments?
>

I am checking it into 2.25 branch.
diff mbox

Patch

configure: Suppress expected compiler error message

2017-06-13  Florian Weimer  <fweimer@redhat.com>

	* configure.ac (find_cxx_header): Suppress compiler error message.

diff --git a/configure.ac b/configure.ac
index d74bd44..3f486d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1187,7 +1187,8 @@  AC_SUBST(CXX_SYSINCLUDES)
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
+	 | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"