From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 632443857022; Wed, 16 Dec 2020 07:33:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 632443857022 Received: by mail-ej1-x62b.google.com with SMTP id b9so6351549ejy.0; Tue, 15 Dec 2020 23:33:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PzMGIJYN8yLb1t4G1hcZTD0dq+gUM3aQOq/JJBSj7ak=; b=Hpc0InUp8NA0dLDUaCLF5GOC0nAMLsRbAf7ESxQJIqxI3s6n2vS8/LOm6f1fBM8DG+ R0sYEKcNejyuyyBWaciPiuEvsFfTC/oQw4xkKae4XCqJtaweDAEphJMJoJBNPRffu6Kv s7Dv4iFl/djBofaHiSMMSGpGw0Jv/iy4xg+CXdbevQ+zi2wMyjeG7J/AlWSuv1/ptysJ IpRjvf9gFWFkSR1D9MpSuW3WogqoX49t6CzN3deViqRcT3EYvYG9DeLlmYCNrGqsSKSR 9TxiuE5KIbw4vqKzE+mcPeXRZeyT9u9U6Rxo/rDPMUNPy1/pCjkhd8LPACUTkIFGaKys +2Tg== X-Gm-Message-State: AOAM532o5vaxWXxvh3gRyfQ4oxWfQVWcprd+lJ4Dqw34ctZ5Op6yCd0I KouyzJZAWyw8e1dGn+EFc9DXRIWdd+xUxj3em/E= X-Google-Smtp-Source: ABdhPJz3mrw5nQ1g1NRpRkxYP5IMPxxNUVyIZ1kPCY082YUXfzUMDsyM+taxpZlR2wSDO19eItGlheKxRingzBHJbbQ= X-Received: by 2002:a17:906:b306:: with SMTP id n6mr29054214ejz.473.1608104035859; Tue, 15 Dec 2020 23:33:55 -0800 (PST) MIME-Version: 1.0 References: <20201207203033.GI2309743@redhat.com> <20201207203201.GJ2309743@redhat.com> <20201209124933.GU2309743@redhat.com> <20201209170125.GW2309743@redhat.com> <20201215114830.GJ2309743@redhat.com> In-Reply-To: <20201215114830.GJ2309743@redhat.com> From: Vladimir V Date: Wed, 16 Dec 2020 08:33:44 +0100 Message-ID: Subject: Re: Problem building libstdc++ for the avr target To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 07:34:02 -0000 Thank you very much. =D0=B2=D1=82, 15 =D0=B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 12:48, Jonathan Wa= kely : > 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 > > > >=D1=87=D1=82, 10 =D0=B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 00:00, Vladimir= V : > > > >> Thank you for the quick response. > >> The patch solves the problem. > >> > >> =D1=81=D1=80, 9 =D0=B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 18:01, Jonatha= n Wakely : > >> > >>> 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 depen= d > >>> >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 > >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 > > > >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}" !=3D "xyes"; then > >+if test "x${with_newlib}" !=3D "xyes" && test "x${with_avrlibc}" !=3D > "xyes"; then > > AC_LIBTOOL_DLOPEN > > fi > > AM_PROG_LIBTOOL > >-- > >2.17.1 > > > >