From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 9110F3857C6D for ; Wed, 9 Dec 2020 12:49:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9110F3857C6D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-OV5492TgPuKzPpJKcWVApQ-1; Wed, 09 Dec 2020 07:49:43 -0500 X-MC-Unique: OV5492TgPuKzPpJKcWVApQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 008DE1005313; Wed, 9 Dec 2020 12:49:35 +0000 (UTC) Received: from localhost (unknown [10.33.36.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id A327B13470; Wed, 9 Dec 2020 12:49:34 +0000 (UTC) Date: Wed, 9 Dec 2020 12:49:33 +0000 From: Jonathan Wakely To: Vladimir V Cc: libstdc++@gcc.gnu.org Subject: Re: Problem building libstdc++ for the avr target Message-ID: <20201209124933.GU2309743@redhat.com> References: <20201207203033.GI2309743@redhat.com> <20201207203201.GJ2309743@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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-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, 09 Dec 2020 12:49:48 -0000 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.