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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 57A713857027 for ; Tue, 7 Nov 2023 10:18:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57A713857027 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 57A713857027 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699352339; cv=none; b=UHd+CckArlfHYlCkkPEINib7Q6oljDjXCsAH9I2ebhvvWp3FRzKvVF3J27i8ycNWOiSZsIxIokVEfwZEFNUsq2Zt1hSV7DjLOaGgKq7aJnJlMwhBVWOZ6AYuUzIsreZo3EmQO0/9DIC1dlJs1VnX+X+XQ3VxtODU5nHeqUEHyBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699352339; c=relaxed/simple; bh=Lfglitf2ebveHe/UpmhylbJ/EKNqONEQBqEN5PnM0p0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Yw4cnm4cf9AF/m19Q6TVVf2EoyUAfqvbhvUEPYgauTfqogoLFPIPQtc/8NoWlkZZkwafWKC9dl0QEUgAKbzSY0t26sUMuEtv5es1e8ThflTFnd44hs5rxEBfFb0Q4u94lBm4AJSDWS0i9dKEAoEGzGmVLgT+tXbE2e7onM4iZIM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699352337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9mo1mN5Lou1UWKNKwP45o2R07lBPsfYjWaz9s/g3nqk=; b=SJSwhLdwNyWUYv+d0rki/xSdA1T7Uu3pi0dl4gY6Hl5f3MXaNJHWotxvdTWDmVqdSJLV10 mnF9moIvBXOdWIWyR+HUCNiQHLV4g9CDOFB9tTlP9BCvtofzAAA8gJZiVm1KzH6fZ7d+g7 DAQSp6/AEJsEC5S2FITUS7zFaKkpwkY= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-mAfUqsp-Nti067-4LAtlAw-1; Tue, 07 Nov 2023 05:18:56 -0500 X-MC-Unique: mAfUqsp-Nti067-4LAtlAw-1 Received: by mail-yb1-f200.google.com with SMTP id 3f1490d57ef6-da39d244087so6962705276.3 for ; Tue, 07 Nov 2023 02:18:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699352336; x=1699957136; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9mo1mN5Lou1UWKNKwP45o2R07lBPsfYjWaz9s/g3nqk=; b=ai7uKw7SKLcIYnCYLPQxWwUhBkKUbwKGweMZ+ySHVbJaRq+ljkyZ50E2Nx2t5x4+U3 Nzlh7m7U+RZMLT+yISnjfg+XbpcIAITiGGY6ZbcQV2GWuwsG1XLlvm6hD1KiB4aoTKfU pDS6Sk6cM6wJO+ok0eAPOoaFt/ImiLU9kvN7AeWld5Za9flQAKlwMRQE6GntXwBEFlEy WiWe99F6nZnLiaTozTYA8uOtuoKeJ4qVSORrO8UyBqBVmRYvQsHO7n1sCyLz55Wv55yh pExR7ZQ0cOy3BkSCI6hFSPrhFYBV0EDPMGIzPnd6YxtGkjZWEwQ90qip6CdePab0Z6BI Oebg== X-Gm-Message-State: AOJu0YwYIbxZ6CFl18raZEbUezI/tth7UQwx76gDXkqmVFqSvf1SuywL CVfmfNKi4GTnaCtm3bl6BjeQ1DfnapbrqIfsfat/UhI7K65TIeH8Qn5tzNIYvQtP1EZzK3PDJ2X YKo9cqDQFV5i9XZF+9H8s/URyyUNJW6o= X-Received: by 2002:a25:ac07:0:b0:d9a:fd15:82a3 with SMTP id w7-20020a25ac07000000b00d9afd1582a3mr31785314ybi.24.1699352336112; Tue, 07 Nov 2023 02:18:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHakbb2VtzzTgKvtTJCfH+ONBZLaURHys2F4GTRwYFzKuaM4hULmS+c1mygHkjdb80YNKnlH9Lhay6pIFkguNQ= X-Received: by 2002:a25:ac07:0:b0:d9a:fd15:82a3 with SMTP id w7-20020a25ac07000000b00d9afd1582a3mr31785304ybi.24.1699352335863; Tue, 07 Nov 2023 02:18:55 -0800 (PST) MIME-Version: 1.0 References: <600FDF8F-67C5-408F-BD24-9A3964A8BFA1@comcast.net> In-Reply-To: From: Jonathan Wakely Date: Tue, 7 Nov 2023 10:18:44 +0000 Message-ID: Subject: Re: testsuite: introduce hostedlib effective target To: Alexandre Oliva Cc: Mike Stump , gcc-patches@gcc.gnu.org, Rainer Orth , libstdc++@gcc.gnu.org, =?UTF-8?Q?Arsen_Arsenovi=C4=87?= X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.2 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 7 Nov 2023 at 10:04, Alexandre Oliva wrote: > > [adding libstdc++@] > > On Nov 5, 2023, Mike Stump wrote: > > > Ick. > > Indeed ;-) > > > I wish there were fewer changed lines and not 1 per test > > case. It feels like we've painted ourselves into a corner. > > The libstdc++ testsuite took a different approach, detecting missing > headers (and libraries?) at error pruning time, and xfailing the tests, > which seems to be more in line with what you are looking for. > > That approach, though more expedient, seems more fragile to me, in that > an actual bug that caused headers to go missing would cause tests to be > silently skipped rather than fail. I don't think we XFAIL based on missing headers. We XFAIL based on a specific #error message in certain headers. If a header goes missing, we'll still XFAIL. > > I expect the set of headers, and thus of affected tests, won't by very > dynamic, so it's kind of a one-shot change. > > Of course new tests might be added that rely on such headers, and would > likely go unnoticed until someone tries them on a non-hosted libstdc++. Since GCC 13 you don't need to build a non-hosted libstdc++ to test it, you can just add -ffreestanding to the runtestflags. > We could alleviate this if libstdc++ headers that are not installed on > hosted systems issued a warning (conditional on some macro defined by > the testsuite, say -D_GLIBCXX_WARN_HOSTED_ONLY). That's exactly what happens (except #error not #warning) when you compile with -ffreestanding. > For tests aimed > exclusively at hosted libstdc++, we'd then use a dg directive that both > implied this requirement, and changed the macro definition to suppress > the warning. Then anyone who added a testcase that included hosted > headers without indicating its hostedlib requirement would get a fail > even when testing with a hosted libstdc++. I don't think we need to add checks for a new macro and then use that when testing, you can just test with -ffreestanding instead. This already works today.