public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Vladimir V <vv.os.swe@gmail.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: Problem building libstdc++ for the avr target
Date: Tue, 15 Dec 2020 11:48:30 +0000	[thread overview]
Message-ID: <20201215114830.GJ2309743@redhat.com> (raw)
In-Reply-To: <CA+=iAiqk3Sj4JU-2ZPSuoFZ0EBFkBm8Fa_NyBCxMxvrnGzOd7A@mail.gmail.com>

On 10/12/20 18:39 +0100, Vladimir V via Libstdc++ wrote:
>Hello.
>
>Could you please have a look at my trivial patch.
>It works as intended with avr-libc and doesn't seem to introduce
>regressions for x86_64 hosts.

I've pushed this to master now, thanks for the patch.

>What would be your suggestions for testing?
>
>Thank you
>Vladimir
>
>чт, 10 дек. 2020 г. в 00:00, Vladimir V <vv.os.swe@gmail.com>:
>
>> Thank you for the quick response.
>> The patch solves the problem.
>>
>> ср, 9 дек. 2020 г. в 18:01, Jonathan Wakely <jwakely@redhat.com>:
>>
>>> On 09/12/20 12:49 +0000, Jonathan Wakely wrote:
>>> >On 09/12/20 13:32 +0100, Vladimir V wrote:
>>> >>Hello.
>>> >>
>>> >>While testing with the current upstream I encountered a compilation
>>> issue.
>>> >>Although I build with "--disable-threads" flag the following error
>>> occurs:
>>> >>
>>> >>../../../../../libstdc++-v3/src/c++11/thread.cc:39:4: error: #error "No
>>> >>sleep function known for this target"
>>> >>
>>> >>Previously the check was inside the  #ifdef _GLIBCXX_HAS_GTHREADS that
>>> >>prevented the error from happening (in my case with gcc v10.1),
>>> >>So I would like to ask if the thread.cc should be involved in the build
>>> if
>>> >>the threads support is configured to be disabled?
>>> >
>>> >Yes, the file is always built, but which definitions it contains
>>> >depends on what is configured for the target.
>>> >
>>> >The std::this_thread::sleep_for and std::this_thread::sleep_until
>>> >functions don't actually depend on threads at all. They just sleep.
>>> >
>>> >But that still requires target support, just different support from
>>> >threads.
>>> >
>>> >>And if it should, then can the condition be reworked to cover the
>>> described
>>> >>case?
>>> >
>>> >Yes, I'll do that. Thanks for bringing it to my attention.
>>> >
>>> >I assume we can't use avr-libc's delay functions, because they depend
>>> >on the CPU clock frequency, which isn't known when we compile
>>> >libstdc++. So I'll just suppress the declarations of those functions
>>> >and remove the #error.
>>>
>>> The attached patch adds a new _GLIBCXX_NO_SLEEP configure macro which
>>> should get defined for your hosted AVR build. That should mean that
>>> std::this_thread::sleep_for is not defined, and src/c++11/thread.cc
>>> will no longer insist on some way to sleep being supported.
>>>
>>> I've only tested this on powerpc64le-linux, so please let me know if
>>> it works for you.
>>>
>>> Pushed to master.
>>>
>>>
>>>

From fbb2144b56625adf594f8812189b983fa66c910a Mon Sep 17 00:00:00 2001
>From: Vladimir Vishnevsky <vv.os.swe@gmail.com>
>Date: Tue, 8 Dec 2020 21:45:26 +0100
>Subject: [PATCH] Disabling AC_LIBTOOL_DLOPEN check if building with avr-libc
>
>The AC_LIBTOOL_DLOPEN checks were previously disabled for newlib targets.
>The patch applies similar logic to avr-libc based builds.
>
>2020-12-08 Vladimir Vishnevsky <vv.os.swe@gmail.com>
>
>libstdc++-v3/ChangeLog:
>        Disabling AC_LIBTOOL_DLOPEN check if building with avr-libc.
>        * configure.ac: Skip AC_LIBTOOL_DLOPEN check if avr-libc is used.
>        * configure: Regenerate.
>---
> libstdc++-v3/configure.ac | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
>index cbfdf4c6bad..771814110a1 100644
>--- a/libstdc++-v3/configure.ac
>+++ b/libstdc++-v3/configure.ac
>@@ -90,7 +90,7 @@ AC_SYS_LARGEFILE
> GLIBCXX_CONFIGURE
>
> # Libtool setup.
>-if test "x${with_newlib}" != "xyes"; then
>+if test "x${with_newlib}" != "xyes" && test "x${with_avrlibc}" != "xyes"; then
>   AC_LIBTOOL_DLOPEN
> fi
> AM_PROG_LIBTOOL
>-- 
>2.17.1
>


  parent reply	other threads:[~2020-12-15 11:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 17:32 Vladimir V
2020-12-07 20:30 ` Jonathan Wakely
2020-12-07 20:32   ` Jonathan Wakely
2020-12-09  0:28     ` Vladimir V
2020-12-09 12:32       ` Vladimir V
2020-12-09 12:49         ` Jonathan Wakely
2020-12-09 17:01           ` Jonathan Wakely
2020-12-09 23:00             ` Vladimir V
2020-12-10 17:39               ` Vladimir V
2020-12-10 20:15                 ` Jonathan Wakely
2020-12-10 20:31                   ` Vladimir V
2020-12-15 11:48                 ` Jonathan Wakely [this message]
2020-12-16  7:33                   ` Vladimir V
2020-12-07 20:41   ` Keith Packard
2020-12-07 21:06     ` Jonathan Wakely
2021-01-04 11:28       ` Vladimir V
2021-01-08 18:21         ` Jonathan Wakely
2021-01-22 14:46           ` Vladimir V
2021-02-07 13:55             ` Vladimir V
2021-02-07 18:22               ` Vladimir V
2021-02-07 18:23               ` Keith Packard
2021-02-07 22:33                 ` Vladimir V
2021-02-07 23:06                   ` Keith Packard
2021-02-08 12:58                     ` Vladimir V
2021-02-08 17:38                 ` Jonathan Wakely
2021-02-08 17:45               ` Jonathan Wakely
2021-02-08 17:47                 ` Jonathan Wakely
2021-02-08 22:25                   ` Vladimir V
2021-02-09 10:47                     ` Jonathan Wakely
2021-02-09 10:54                       ` Vladimir V
2021-03-25  9:27                         ` Vladimir V
2021-03-25 12:36                           ` Jonathan Wakely
2021-03-25 18:27                             ` Jonathan Wakely
2021-03-25 21:37                               ` Vladimir V
2021-03-25 23:02                                 ` Jonathan Wakely
2021-03-26  8:25                                   ` Vladimir V
2020-12-07 21:51     ` Vladimir V
2020-12-07 23:00       ` Keith Packard
2020-12-08  8:12         ` Vladimir V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201215114830.GJ2309743@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=vv.os.swe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).