From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by sourceware.org (Postfix) with ESMTPS id DA4E0385E445 for ; Thu, 10 Dec 2020 17:39:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DA4E0385E445 Received: by mail-ed1-x543.google.com with SMTP id v22so6408669edt.9 for ; Thu, 10 Dec 2020 09:39:27 -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=nzCM5Fw78w9p/n9MYymaYm44Z5FVfoaCKSvi1nkNdms=; b=TrNPZQqoH6qztINGZmvRkSt1gNqyNQ/yXRorGGjyfTz5cTHt8RynxMzMKJFmqRe4Wp WOT5UTmJj69j2ZSXmDIYjrZV8R+9PYm5zBriFsq7sgt5V1j7esxNjOedB/HCYNCtHpP8 Ev2HcVVmlTWDU7r8pA89yXSZ1MhJakCuRaeIJ0IsvPlvPnFBBpyubojcpNEKmCTiU9dV YYlvpOsxiZSCpPISnLj7LCQagtB1xHNVXIEdjhSZ2JgvVPaCwwG3QQiUKiYVv+iyDLfO pAEqXTcLRxTe4ekZTIicyzrZASIzIJE80vO7xGn7LySACmlZEYZ/5/NzllltRjM7NsvB 9sYQ== X-Gm-Message-State: AOAM533uvAy6eOfLyv7NdQJNJk9hA9t89Jv0ZAmZf7pzuBllsoKK5oRY 4Vkdtl2Y87lHpdMNx37SEihyV3anTS2ZHnerND0= X-Google-Smtp-Source: ABdhPJwdxpE7zwqk4nIpE0R1EUg6ckqIfHf8Rd2NWXbZZQDz/3nRNIXwgVoAa1R945v0zrczl+CmVsSl0ZOPEIYxc/Y= X-Received: by 2002:a05:6402:19b0:: with SMTP id o16mr7933432edz.270.1607621967019; Thu, 10 Dec 2020 09:39:27 -0800 (PST) MIME-Version: 1.0 References: <20201207203033.GI2309743@redhat.com> <20201207203201.GJ2309743@redhat.com> <20201209124933.GU2309743@redhat.com> <20201209170125.GW2309743@redhat.com> In-Reply-To: From: Vladimir V Date: Thu, 10 Dec 2020 18:39:15 +0100 Message-ID: Subject: Re: Problem building libstdc++ for the avr target To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org Content-Type: multipart/mixed; boundary="0000000000004762a205b61fa8ba" X-Spam-Status: No, score=-7.3 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 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: Thu, 10 Dec 2020 17:39:31 -0000 --0000000000004762a205b61fa8ba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. 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, Jonathan W= akely : > >> 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 "N= o >> >>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 buil= d >> 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. >> >> >> --0000000000004762a205b61fa8ba Content-Type: text/plain; charset="US-ASCII"; name="Disabling-AC_LIBTOOL_DLOPEN-check-for-avr.txt" Content-Disposition: attachment; filename="Disabling-AC_LIBTOOL_DLOPEN-check-for-avr.txt" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kij4iu5r0 RnJvbSBmYmIyMTQ0YjU2NjI1YWRmNTk0Zjg4MTIxODliOTgzZmE2NmM5MTBhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBWbGFkaW1pciBWaXNobmV2c2t5IDx2di5vcy5zd2VAZ21haWwu Y29tPgpEYXRlOiBUdWUsIDggRGVjIDIwMjAgMjE6NDU6MjYgKzAxMDAKU3ViamVjdDogW1BBVENI XSBEaXNhYmxpbmcgQUNfTElCVE9PTF9ETE9QRU4gY2hlY2sgaWYgYnVpbGRpbmcgd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