public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Move closing brace outside #endif [PR104866]
@ 2022-03-10 21:11 Jonathan Wakely
  2022-03-11 14:27 ` Detlef Vollmann
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2022-03-10 21:11 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: Detlef Vollmann

From: Detlef Vollmann <dv@vollmann.ch>

Tested x86_64-linux, pushed to trunk.

-- >8--

Author: Detlef Vollmann <dv@vollmann.ch>

libstdc++-v3/ChangeLog:

	PR libstdc++/104866
	* include/bits/this_thread_sleep.h: Fix order of #endif and
	closing brace of namespace.
---
 libstdc++-v3/include/bits/this_thread_sleep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/this_thread_sleep.h b/libstdc++-v3/include/bits/this_thread_sleep.h
index 86bc6ffd632..712de5a6ff9 100644
--- a/libstdc++-v3/include/bits/this_thread_sleep.h
+++ b/libstdc++-v3/include/bits/this_thread_sleep.h
@@ -105,8 +105,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	    __now = _Clock::now();
 	  }
       }
-  } // namespace this_thread
 #endif // ! NO_SLEEP
+  } // namespace this_thread
 
   /// @}
 
-- 
2.34.1


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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-10 21:11 [committed] libstdc++: Move closing brace outside #endif [PR104866] Jonathan Wakely
@ 2022-03-11 14:27 ` Detlef Vollmann
  2022-03-11 15:12   ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Detlef Vollmann @ 2022-03-11 14:27 UTC (permalink / raw)
  To: Jonathan Wakely, libstdc++, gcc-patches

Hi Jonathan,

On 3/10/22 22:11, Jonathan Wakely wrote:

> Tested x86_64-linux, pushed to trunk.

Thanks.
With this and the other fix I was able to build the complete
libstdc++ for AVR based on AVR Libc 2.0 (plus some ad hoc
AVR header fixes) from git master 5e28be89.

And a small example with pmr::string and pmr::vector worked :-)

Thanks again,
   Detlef

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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-11 14:27 ` Detlef Vollmann
@ 2022-03-11 15:12   ` Jonathan Wakely
  2022-03-11 15:21     ` Jonathan Wakely
  2022-03-11 15:35     ` Detlef Vollmann
  0 siblings, 2 replies; 8+ messages in thread
From: Jonathan Wakely @ 2022-03-11 15:12 UTC (permalink / raw)
  To: Detlef Vollmann; +Cc: libstdc++, gcc Patches

On Fri, 11 Mar 2022 at 14:28, Detlef Vollmann wrote:
>
> Hi Jonathan,
>
> On 3/10/22 22:11, Jonathan Wakely wrote:
>
> > Tested x86_64-linux, pushed to trunk.
>
> Thanks.
> With this and the other fix I was able to build the complete
> libstdc++ for AVR based on AVR Libc 2.0 (plus some ad hoc
> AVR header fixes) from git master 5e28be89.

Nice. I finally figure out that I need to use --enable-libstdcxx *not*
--enable-libstdc++-v3 to build for AVR, and now I get errors due to
EOVERFLOW being undefined. Is that what you fixed?

We should make that work. Arguably, all values of std::errc should
exist, even if the OS <errno.h> doesn't provide a constant. We could
define the missing ones ourselves, choosing numbers > 1000 (and hope
the OS uses small numbers for its own errno values).

>
> And a small example with pmr::string and pmr::vector worked :-)

Great!


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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-11 15:12   ` Jonathan Wakely
@ 2022-03-11 15:21     ` Jonathan Wakely
  2022-03-11 15:35     ` Detlef Vollmann
  1 sibling, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2022-03-11 15:21 UTC (permalink / raw)
  To: Detlef Vollmann; +Cc: libstdc++, gcc Patches

On Fri, 11 Mar 2022 at 15:12, Jonathan Wakely wrote:
>
> On Fri, 11 Mar 2022 at 14:28, Detlef Vollmann wrote:
> >
> > Hi Jonathan,
> >
> > On 3/10/22 22:11, Jonathan Wakely wrote:
> >
> > > Tested x86_64-linux, pushed to trunk.
> >
> > Thanks.
> > With this and the other fix I was able to build the complete
> > libstdc++ for AVR based on AVR Libc 2.0 (plus some ad hoc
> > AVR header fixes) from git master 5e28be89.
>
> Nice. I finally figure out that I need to use --enable-libstdcxx *not*
> --enable-libstdc++-v3 to build for AVR, and now I get errors due to
> EOVERFLOW being undefined. Is that what you fixed?
>
> We should make that work. Arguably, all values of std::errc should
> exist, even if the OS <errno.h> doesn't provide a constant. We could
> define the missing ones ourselves, choosing numbers > 1000 (and hope
> the OS uses small numbers for its own errno values).

I opened https://gcc.gnu.org/PR104883 for this.


>
> >
> > And a small example with pmr::string and pmr::vector worked :-)
>
> Great!


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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-11 15:12   ` Jonathan Wakely
  2022-03-11 15:21     ` Jonathan Wakely
@ 2022-03-11 15:35     ` Detlef Vollmann
  2022-03-11 17:59       ` Jonathan Wakely
  1 sibling, 1 reply; 8+ messages in thread
From: Detlef Vollmann @ 2022-03-11 15:35 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc Patches

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

On 3/11/22 16:12, Jonathan Wakely wrote:
> On Fri, 11 Mar 2022 at 14:28, Detlef Vollmann wrote:
>> With this and the other fix I was able to build the complete
>> libstdc++ for AVR based on AVR Libc 2.0 (plus some ad hoc
>> AVR header fixes) from git master 5e28be89.
> 
> Nice. I finally figure out that I need to use --enable-libstdcxx *not*
> --enable-libstdc++-v3 to build for AVR,
Yes, I had the same problem.
A comment in the 'configure' script still says libstdc++-v3
and in the configure docs at
<https://gcc.gnu.org/install/configure.html>
or
<https://gcc.gnu.org/onlinedocs/libstdc++/manual/configure.html>
there's neither :-(

> and now I get errors due to
> EOVERFLOW being undefined. Is that what you fixed?
One of them.

> We should make that work. Arguably, all values of std::errc should
> exist, even if the OS <errno.h> doesn't provide a constant. We could
> define the missing ones ourselves, choosing numbers > 1000 (and hope
> the OS uses small numbers for its own errno values).
I simply defined all that were required.

I've attached a tarball with all my header fixes.
To get them picked up while compiling libstdc++ I had to
put them into ${prefix}/avr/lib/include.

But these are really ad hoc, some of the problems I think should
be fixed in the libstdc++ sources.
E.g. I think it's wrong to expect that specific functions are
available if a respective header is available (e.g. close()
in unistd.h).

   Detlef

[-- Attachment #2: avr-fixups.tar.bz2 --]
[-- Type: application/octet-stream, Size: 1321 bytes --]

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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-11 15:35     ` Detlef Vollmann
@ 2022-03-11 17:59       ` Jonathan Wakely
  2022-03-11 19:24         ` Detlef Vollmann
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2022-03-11 17:59 UTC (permalink / raw)
  To: Detlef Vollmann; +Cc: libstdc++, gcc Patches

On Fri, 11 Mar 2022 at 15:35, Detlef Vollmann wrote:
>
> On 3/11/22 16:12, Jonathan Wakely wrote:
> > On Fri, 11 Mar 2022 at 14:28, Detlef Vollmann wrote:
> >> With this and the other fix I was able to build the complete
> >> libstdc++ for AVR based on AVR Libc 2.0 (plus some ad hoc
> >> AVR header fixes) from git master 5e28be89.
> >
> > Nice. I finally figure out that I need to use --enable-libstdcxx *not*
> > --enable-libstdc++-v3 to build for AVR,
> Yes, I had the same problem.
> A comment in the 'configure' script still says libstdc++-v3

Yes, I have a patch to fix that.


> and in the configure docs at
> <https://gcc.gnu.org/install/configure.html>
> or
> <https://gcc.gnu.org/onlinedocs/libstdc++/manual/configure.html>
> there's neither :-(
>
> > and now I get errors due to
> > EOVERFLOW being undefined. Is that what you fixed?
> One of them.
>
> > We should make that work. Arguably, all values of std::errc should
> > exist, even if the OS <errno.h> doesn't provide a constant. We could
> > define the missing ones ourselves, choosing numbers > 1000 (and hope
> > the OS uses small numbers for its own errno values).
> I simply defined all that were required.
>
> I've attached a tarball with all my header fixes.

Thanks. Now I'm getting a build failure because libtol wasn't created
in the avr/libstdc++-v3 directory of the build tree, but I'll have to
look into that next week.

/bin/sh: ../libtool: No such file or directory



> To get them picked up while compiling libstdc++ I had to
> put them into ${prefix}/avr/lib/include.
>
> But these are really ad hoc, some of the problems I think should
> be fixed in the libstdc++ sources.
> E.g. I think it's wrong to expect that specific functions are
> available if a respective header is available (e.g. close()
> in unistd.h).

Yes, that was me being lazy.


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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-11 17:59       ` Jonathan Wakely
@ 2022-03-11 19:24         ` Detlef Vollmann
  2022-03-14  9:57           ` Detlef Vollmann
  0 siblings, 1 reply; 8+ messages in thread
From: Detlef Vollmann @ 2022-03-11 19:24 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc Patches

On 3/11/22 18:59, Jonathan Wakely wrote:

> Thanks. Now I'm getting a build failure because libtol wasn't created
> in the avr/libstdc++-v3 directory of the build tree, but I'll have to
> look into that next week.
> 
> /bin/sh: ../libtool: No such file or directory

Here's my configure call:

$REPO_DIR/configure \
     --prefix=$PREFIX \
     --target=avr \
     --enable-languages=c,c++ \
     --with-dwarf2 \
     --enable-multilib \
     --enable-libstdcxx \
     --disable-decimal-float \
     --disable-libffi \
     --disable-libgomp \
     --disable-libmudflap \
     --disable-libquadmath \
     --disable-libssp \
     --disable-libstdcxx-pch \
     --disable-nls \
     --without-included-gettext \
     --disable-libstdcxx-verbose \
     --disable-shared \
     --disable-threads \
     --disable-tls \
     --disable-plugin \
     --with-system-zlib \
     --with-native-system-header-dir=$PREFIX/port/include \
     --with-headers=yes \
     --with-gnu-as \
     --with-gnu-ld \
     --with-avrlibc \
     --with-build-time-tools=$PREFIX/lib/avr/bin

--disable-threads is probably wrong, as I definitly have threads
(any ISR counts as thread).  I added it in the (wrong) assumption
that it would build support for std::thread...

   Detlef

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

* Re: [committed] libstdc++: Move closing brace outside #endif [PR104866]
  2022-03-11 19:24         ` Detlef Vollmann
@ 2022-03-14  9:57           ` Detlef Vollmann
  0 siblings, 0 replies; 8+ messages in thread
From: Detlef Vollmann @ 2022-03-14  9:57 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc Patches

On 3/11/22 20:24, Detlef Vollmann wrote:
> On 3/11/22 18:59, Jonathan Wakely wrote:
> 
>> Thanks. Now I'm getting a build failure because libtol wasn't created
>> in the avr/libstdc++-v3 directory of the build tree, but I'll have to
>> look into that next week.
>>
>> /bin/sh: ../libtool: No such file or directory
> 
> Here's my configure call:
> 
> $REPO_DIR/configure \
>      --prefix=$PREFIX \
>      --target=avr \
>      --enable-languages=c,c++ \
>      --with-dwarf2 \
>      --enable-multilib \
>      --enable-libstdcxx \
>      --disable-decimal-float \
>      --disable-libffi \
>      --disable-libgomp \
>      --disable-libmudflap \
>      --disable-libquadmath \
>      --disable-libssp \
>      --disable-libstdcxx-pch \
>      --disable-nls \
>      --without-included-gettext \
>      --disable-libstdcxx-verbose \
>      --disable-shared \
>      --disable-threads \
>      --disable-tls \
>      --disable-plugin \
>      --with-system-zlib \
>      --with-native-system-header-dir=$PREFIX/port/include \
>      --with-headers=yes \
>      --with-gnu-as \
>      --with-gnu-ld \
>      --with-avrlibc \
>      --with-build-time-tools=$PREFIX/lib/avr/bin
> 
> --disable-threads is probably wrong, as I definitly have threads
> (any ISR counts as thread).  I added it in the (wrong) assumption
> that it would build support for std::thread...

Just for completeness: for the previous steps building the toolchain
I followed
<http://www.nongnu.org/avr-libc/user-manual/install_tools.html>.
Using binutils:	2.37 and AVR LibC 2.0.0 (from SVN).

   Detlef

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

end of thread, other threads:[~2022-03-14  9:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 21:11 [committed] libstdc++: Move closing brace outside #endif [PR104866] Jonathan Wakely
2022-03-11 14:27 ` Detlef Vollmann
2022-03-11 15:12   ` Jonathan Wakely
2022-03-11 15:21     ` Jonathan Wakely
2022-03-11 15:35     ` Detlef Vollmann
2022-03-11 17:59       ` Jonathan Wakely
2022-03-11 19:24         ` Detlef Vollmann
2022-03-14  9:57           ` Detlef Vollmann

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).