public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, libstdc++] Add missing free-standing headers to install rule
@ 2016-03-09  3:34 Bernd Edlinger
  2016-03-16  8:32 ` [PING] " Bernd Edlinger
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Edlinger @ 2016-03-09  3:34 UTC (permalink / raw)
  To: gcc-patches, libstdc++; +Cc: Jonathan Wakely

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

Hi,

when the free-standing libstdc++-headers are installed, the C++ header
file <new> does not always compile, because it includes <exception> and this
includes under certain conditions (__cplusplus >= 201103L &&
ATOMIC_INT_LOCK_FREE > 1) the header file <bits/nested_exception.h>
but that fails to compile because it needs <bits/move.h> which is not installed.
This condition depends on the target, and for instance an arm-eabi
eCos compiler fails to compile <new> with -mcpu=cortex-a9 and the
default C++ standard option, while it is OK with ARMv4 CPUs.

Therefore this patch adds move.h and concept_check.h to the installed headers,
unconditionally.

I've verified that the <new> header compiles on an eCos cross compiler.

Boot-strapped and regression-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?


Thanks
Bernd.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-freestanding-headers.diff --]
[-- Type: text/x-patch; name="patch-freestanding-headers.diff", Size: 1680 bytes --]

2016-03-08  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* include/Makefile.am (install-freestanding-headers): Add
	concept_check.h and move.h to the installed headers.
	* include/Makefile.in: Regenerated.

Index: libstdc++-v3/include/Makefile.am
===================================================================
--- libstdc++-v3/include/Makefile.am	(revision 234060)
+++ libstdc++-v3/include/Makefile.am	(working copy)
@@ -1331,7 +1331,7 @@
 # libsupc++, so only the others and the sub-includes are copied here.
 install-freestanding-headers:
 	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/bits
-	for file in c++0x_warning.h atomic_base.h; do \
+	for file in c++0x_warning.h atomic_base.h concept_check.h move.h; do \
 	  $(INSTALL_DATA) ${glibcxx_srcdir}/include/bits/$${file} $(DESTDIR)${gxx_include_dir}/bits; done
 	$(mkinstalldirs) $(DESTDIR)${host_installdir}
 	for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h \
Index: libstdc++-v3/include/Makefile.in
===================================================================
--- libstdc++-v3/include/Makefile.in	(revision 234060)
+++ libstdc++-v3/include/Makefile.in	(working copy)
@@ -1753,7 +1753,7 @@
 # libsupc++, so only the others and the sub-includes are copied here.
 install-freestanding-headers:
 	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/bits
-	for file in c++0x_warning.h atomic_base.h; do \
+	for file in c++0x_warning.h atomic_base.h concept_check.h move.h; do \
 	  $(INSTALL_DATA) ${glibcxx_srcdir}/include/bits/$${file} $(DESTDIR)${gxx_include_dir}/bits; done
 	$(mkinstalldirs) $(DESTDIR)${host_installdir}
 	for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h \

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PING] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-09  3:34 [PATCH, libstdc++] Add missing free-standing headers to install rule Bernd Edlinger
@ 2016-03-16  8:32 ` Bernd Edlinger
  2016-03-22  7:30   ` [PING**2] " Bernd Edlinger
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Edlinger @ 2016-03-16  8:32 UTC (permalink / raw)
  To: gcc-patches, libstdc++; +Cc: Jonathan Wakely

Ping...

Hi,

when the free-standing libstdc++-headers are installed, the C++ header
file <new> does not always compile, because it includes <exception> and this
includes under certain conditions (__cplusplus >= 201103L &&
ATOMIC_INT_LOCK_FREE > 1) the header file <bits/nested_exception.h>
but that fails to compile because it needs <bits/move.h> which is not installed.
This condition depends on the target, and for instance an arm-eabi
eCos compiler fails to compile <new> with -mcpu=cortex-a9 and the
default C++ standard option, while it is OK with ARMv4 CPUs.

Therefore this patch adds move.h and concept_check.h to the installed headers,
unconditionally.

I've verified that the <new> header compiles on an eCos cross compiler.

Boot-strapped and regression-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?


Thanks
Bernd.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PING**2] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-16  8:32 ` [PING] " Bernd Edlinger
@ 2016-03-22  7:30   ` Bernd Edlinger
  2016-03-22 15:55     ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Edlinger @ 2016-03-22  7:30 UTC (permalink / raw)
  To: gcc-patches, libstdc++; +Cc: Jonathan Wakely

Hi,

I am pinging for this patch, which addresses an admittedly minor regression
for free-standing libstdc++ due to changed c++11 default settings.  The proposed
patch does only change the free-standing install rule, and has therefore no impact
on other configurations. 

https://gcc.gnu.org/ml/libstdc++/2016-03/msg00004.html


Thanks
Bernd.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING**2] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-22  7:30   ` [PING**2] " Bernd Edlinger
@ 2016-03-22 15:55     ` Jonathan Wakely
  2016-03-22 19:00       ` Bernd Edlinger
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2016-03-22 15:55 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: gcc-patches, libstdc++

On 22/03/16 07:10 +0000, Bernd Edlinger wrote:
>Hi,
>
>I am pinging for this patch, which addresses an admittedly minor regression
>for free-standing libstdc++ due to changed c++11 default settings.  The proposed
>patch does only change the free-standing install rule, and has therefore no impact
>on other configurations.
>
>https://gcc.gnu.org/ml/libstdc++/2016-03/msg00004.html

Sorry for the delay, I'm testing the patch today.

Looks like the patch doesn't add <bits/boost_concept_check.h> to the freestanding
headers, which means using -D_GLIBCXX_CONCEPT_CHECKS will give a fatal
error.

It also means --disable-libstdccxx-hosted --enable-concept-checks
creates an unusable configuration (although it's possible that
--enable-concept-checks is already broken due to the -std=gnu++14
default).

I think it's fine for the concept checking to be unsupported for
freestanding installations, but we should degrade gracefully, via
something like:

--- a/libstdc++-v3/include/bits/concept_check.h
+++ b/libstdc++-v3/include/bits/concept_check.h
@@ -42,7 +42,7 @@
 // Concept-checking code is off by default unless users turn it on via
 // configure options or editing c++config.h.
 
-#ifndef _GLIBCXX_CONCEPT_CHECKS
+#if !defined(_GLIBCXX_CONCEPT_CHECKS) || !defined(_GLIBCXX_HOSTED)
 
 #define __glibcxx_function_requires(...)
 #define __glibcxx_class_requires(_a,_b)


Or in c++config.h doing:

#ifndef _GLIBCXX_HOSTED
# undef _GLIBCXX_CONCEPT_CHECKS
#endif

That seems better than just giving an error.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING**2] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-22 15:55     ` Jonathan Wakely
@ 2016-03-22 19:00       ` Bernd Edlinger
  2016-03-22 20:34         ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Edlinger @ 2016-03-22 19:00 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, libstdc++

On 22.03.2016 15:36, Jonathan Wakely wrote:
> On 22/03/16 07:10 +0000, Bernd Edlinger wrote:
>> Hi,
>>
>> I am pinging for this patch, which addresses an admittedly minor
>> regression
>> for free-standing libstdc++ due to changed c++11 default settings.
>> The proposed
>> patch does only change the free-standing install rule, and has
>> therefore no impact
>> on other configurations.
>>
>> https://gcc.gnu.org/ml/libstdc++/2016-03/msg00004.html
>
> Sorry for the delay, I'm testing the patch today.
>
> Looks like the patch doesn't add <bits/boost_concept_check.h> to the
> freestanding
> headers, which means using -D_GLIBCXX_CONCEPT_CHECKS will give a fatal
> error.
>
> It also means --disable-libstdccxx-hosted --enable-concept-checks
> creates an unusable configuration (although it's possible that
> --enable-concept-checks is already broken due to the -std=gnu++14
> default).
>
> I think it's fine for the concept checking to be unsupported for
> freestanding installations, but we should degrade gracefully, via
> something like:
>
> --- a/libstdc++-v3/include/bits/concept_check.h
> +++ b/libstdc++-v3/include/bits/concept_check.h
> @@ -42,7 +42,7 @@
> // Concept-checking code is off by default unless users turn it on via
> // configure options or editing c++config.h.
>
> -#ifndef _GLIBCXX_CONCEPT_CHECKS
> +#if !defined(_GLIBCXX_CONCEPT_CHECKS) || !defined(_GLIBCXX_HOSTED)
>
> #define __glibcxx_function_requires(...)
> #define __glibcxx_class_requires(_a,_b)
>
>
> Or in c++config.h doing:
>
> #ifndef _GLIBCXX_HOSTED
> # undef _GLIBCXX_CONCEPT_CHECKS
> #endif
>
> That seems better than just giving an error.

Yes. Maybe changing concept_check.h would be better, because
I see 3 different instances of bits/c++config.h:

$prefix/arm-eabi/include/c++/6.0.0/arm-eabi/fpu/bits/c++config.h
$prefix/arm-eabi/include/c++/6.0.0/arm-eabi/bits/c++config.h
$prefix/arm-eabi/include/c++/6.0.0/arm-eabi/thumb/bits/c++config.h

while I only see one use of _GLIBCXX_CONCEPT_CHECKS:
$prefix/arm-eabi/include/c++/6.0.0/bits/concept_check.h


Thanks
Bernd.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING**2] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-22 19:00       ` Bernd Edlinger
@ 2016-03-22 20:34         ` Jonathan Wakely
  2016-03-22 21:28           ` Bernd Edlinger
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2016-03-22 20:34 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: gcc-patches, libstdc++

On 22/03/16 18:29 +0000, Bernd Edlinger wrote:
>Yes. Maybe changing concept_check.h would be better, because
>I see 3 different instances of bits/c++config.h:
>
>$prefix/arm-eabi/include/c++/6.0.0/arm-eabi/fpu/bits/c++config.h
>$prefix/arm-eabi/include/c++/6.0.0/arm-eabi/bits/c++config.h
>$prefix/arm-eabi/include/c++/6.0.0/arm-eabi/thumb/bits/c++config.h

But they're all generated from the same include/bits/c++config in the
source tree, so that shouldn't matter.

>while I only see one use of _GLIBCXX_CONCEPT_CHECKS:
>$prefix/arm-eabi/include/c++/6.0.0/bits/concept_check.h

I'm fine with changing it there. We should also document that the
macro doesn't do anything for freestanding implementations.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING**2] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-22 20:34         ` Jonathan Wakely
@ 2016-03-22 21:28           ` Bernd Edlinger
  2016-03-22 23:12             ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Edlinger @ 2016-03-22 21:28 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

On 22.03.2016 20:10, Jonathan Wakely wrote:
> On 22/03/16 18:29 +0000, Bernd Edlinger wrote:
>> Yes. Maybe changing concept_check.h would be better, because
>> I see 3 different instances of bits/c++config.h:
>>
>> $prefix/arm-eabi/include/c++/6.0.0/arm-eabi/fpu/bits/c++config.h
>> $prefix/arm-eabi/include/c++/6.0.0/arm-eabi/bits/c++config.h
>> $prefix/arm-eabi/include/c++/6.0.0/arm-eabi/thumb/bits/c++config.h
>
> But they're all generated from the same include/bits/c++config in the
> source tree, so that shouldn't matter.
>
>> while I only see one use of _GLIBCXX_CONCEPT_CHECKS:
>> $prefix/arm-eabi/include/c++/6.0.0/bits/concept_check.h
>
> I'm fine with changing it there. We should also document that the
> macro doesn't do anything for freestanding implementations.
>

Done.  Attached is a new version of my patch with a small
documentation update.  I just used your wording if you don't mind.

Is it Ok for trunk when boot-strap and regression-testing completed?


Thanks
Bernd.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-freestanding-headers.diff --]
[-- Type: text/x-patch; name="patch-freestanding-headers.diff", Size: 5869 bytes --]

2016-03-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* include/Makefile.am (install-freestanding-headers): Add
	concept_check.h and move.h to the installed headers.
	* include/Makefile.in: Regenerated.
	* include/bits/concept_check.h: Ignore _GLIBCXX_CONCEPT_CHECKS for
	freestanding implementations.
	* doc/html/manual/using_macros.html (_GLIBCXX_CONCEPT_CHECKS): Mention
	that this macro doesn't do anything for freestanding implementaions.
	* doc/xml/manual/using.xml (_GLIBCXX_CONCEPT_CHECKS): Mention
	that this macro doesn't do anything for freestanding implementaions.

Index: libstdc++-v3/doc/html/manual/using_macros.html
===================================================================
--- libstdc++-v3/doc/html/manual/using_macros.html	(revision 234407)
+++ libstdc++-v3/doc/html/manual/using_macros.html	(working copy)
@@ -66,7 +66,8 @@
 	<code class="code">--enable-concept-checks</code>.  When defined, performs
 	compile-time checking on certain template instantiations to
 	detect violations of the requirements of the standard.  This
-	is described in more detail in
+	macro doesn't do anything for freestanding implementaions.
+	This is described in more detail in
 	<a class="link" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks">Compile Time Checks</a>.
       </p></dd><dt><span class="term"><code class="code">_GLIBCXX_ASSERTIONS</code></span></dt><dd><p>
 	Undefined by default. When defined, enables extra error checking in
@@ -91,4 +92,4 @@
 	mode</a>.
       </p></dd><dt><span class="term"><code class="code">__STDCPP_WANT_MATH_SPEC_FUNCS__</code></span></dt><dd><p>Undefined by default. When defined to a non-zero integer constant,
 	enables support for ISO/IEC 29124 Special Math Functions.
-      </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_dual_abi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Headers </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Dual ABI</td></tr></table></div></body></html>
\ No newline at end of file
+      </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_dual_abi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Headers </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Dual ABI</td></tr></table></div></body></html>
Index: libstdc++-v3/doc/xml/manual/using.xml
===================================================================
--- libstdc++-v3/doc/xml/manual/using.xml	(revision 234407)
+++ libstdc++-v3/doc/xml/manual/using.xml	(working copy)
@@ -908,7 +908,8 @@
 	<code>--enable-concept-checks</code>.  When defined, performs
 	compile-time checking on certain template instantiations to
 	detect violations of the requirements of the standard.  This
-	is described in more detail in
+	macro doesn't do anything for freestanding implementaions.
+	This is described in more detail in
 	<link linkend="manual.ext.compile_checks">Compile Time Checks</link>.
       </para>
     </listitem></varlistentry>
Index: libstdc++-v3/include/Makefile.am
===================================================================
--- libstdc++-v3/include/Makefile.am	(revision 234407)
+++ libstdc++-v3/include/Makefile.am	(working copy)
@@ -1331,7 +1331,7 @@
 # libsupc++, so only the others and the sub-includes are copied here.
 install-freestanding-headers:
 	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/bits
-	for file in c++0x_warning.h atomic_base.h; do \
+	for file in c++0x_warning.h atomic_base.h concept_check.h move.h; do \
 	  $(INSTALL_DATA) ${glibcxx_srcdir}/include/bits/$${file} $(DESTDIR)${gxx_include_dir}/bits; done
 	$(mkinstalldirs) $(DESTDIR)${host_installdir}
 	for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h \
Index: libstdc++-v3/include/Makefile.in
===================================================================
--- libstdc++-v3/include/Makefile.in	(revision 234407)
+++ libstdc++-v3/include/Makefile.in	(working copy)
@@ -1753,7 +1753,7 @@
 # libsupc++, so only the others and the sub-includes are copied here.
 install-freestanding-headers:
 	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/bits
-	for file in c++0x_warning.h atomic_base.h; do \
+	for file in c++0x_warning.h atomic_base.h concept_check.h move.h; do \
 	  $(INSTALL_DATA) ${glibcxx_srcdir}/include/bits/$${file} $(DESTDIR)${gxx_include_dir}/bits; done
 	$(mkinstalldirs) $(DESTDIR)${host_installdir}
 	for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h \
Index: libstdc++-v3/include/bits/concept_check.h
===================================================================
--- libstdc++-v3/include/bits/concept_check.h	(revision 234407)
+++ libstdc++-v3/include/bits/concept_check.h	(working copy)
@@ -41,8 +41,9 @@
 
 // Concept-checking code is off by default unless users turn it on via
 // configure options or editing c++config.h.
+// It is not supported for freestanding implementations.
 
-#ifndef _GLIBCXX_CONCEPT_CHECKS
+#if !defined(_GLIBCXX_CONCEPT_CHECKS) || !defined(_GLIBCXX_HOSTED)
 
 #define __glibcxx_function_requires(...)
 #define __glibcxx_class_requires(_a,_b)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING**2] [PATCH, libstdc++] Add missing free-standing headers to install rule
  2016-03-22 21:28           ` Bernd Edlinger
@ 2016-03-22 23:12             ` Jonathan Wakely
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2016-03-22 23:12 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: gcc-patches, libstdc++

On 22/03/16 20:38 +0000, Bernd Edlinger wrote:
>On 22.03.2016 20:10, Jonathan Wakely wrote:
>> On 22/03/16 18:29 +0000, Bernd Edlinger wrote:
>>> Yes. Maybe changing concept_check.h would be better, because
>>> I see 3 different instances of bits/c++config.h:
>>>
>>> $prefix/arm-eabi/include/c++/6.0.0/arm-eabi/fpu/bits/c++config.h
>>> $prefix/arm-eabi/include/c++/6.0.0/arm-eabi/bits/c++config.h
>>> $prefix/arm-eabi/include/c++/6.0.0/arm-eabi/thumb/bits/c++config.h
>>
>> But they're all generated from the same include/bits/c++config in the
>> source tree, so that shouldn't matter.
>>
>>> while I only see one use of _GLIBCXX_CONCEPT_CHECKS:
>>> $prefix/arm-eabi/include/c++/6.0.0/bits/concept_check.h
>>
>> I'm fine with changing it there. We should also document that the
>> macro doesn't do anything for freestanding implementations.
>>
>
>Done.  Attached is a new version of my patch with a small
>documentation update.  I just used your wording if you don't mind.

Please say "has no effect" rather than "doesn't do anything".

>Is it Ok for trunk when boot-strap and regression-testing completed?

OK, thanks.

>
>
>Thanks
>Bernd.

>2016-03-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>
>	* include/Makefile.am (install-freestanding-headers): Add
>	concept_check.h and move.h to the installed headers.
>	* include/Makefile.in: Regenerated.
>	* include/bits/concept_check.h: Ignore _GLIBCXX_CONCEPT_CHECKS for
>	freestanding implementations.
>	* doc/html/manual/using_macros.html (_GLIBCXX_CONCEPT_CHECKS): Mention
>	that this macro doesn't do anything for freestanding implementaions.

The HTML files are generated, so typically the changelog would say
it's regenerated. I assume you edited by hand, but it's still not
necessary to repeat the same thing for both the xml original and
generated html, one of them should be "Likewise".

>	* doc/xml/manual/using.xml (_GLIBCXX_CONCEPT_CHECKS): Mention
>	that this macro doesn't do anything for freestanding implementaions.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-22 22:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09  3:34 [PATCH, libstdc++] Add missing free-standing headers to install rule Bernd Edlinger
2016-03-16  8:32 ` [PING] " Bernd Edlinger
2016-03-22  7:30   ` [PING**2] " Bernd Edlinger
2016-03-22 15:55     ` Jonathan Wakely
2016-03-22 19:00       ` Bernd Edlinger
2016-03-22 20:34         ` Jonathan Wakely
2016-03-22 21:28           ` Bernd Edlinger
2016-03-22 23:12             ` Jonathan Wakely

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 read-only IMAP folder(s) and NNTP newsgroup(s).