From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 22B5D3858439 for ; Mon, 25 Jul 2022 11:00:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22B5D3858439 Received: by mail-qt1-x831.google.com with SMTP id g24so7921872qtu.2 for ; Mon, 25 Jul 2022 04:00:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=VRtSJTY208x/iirREcyUlkQgXwD8wNaOK2PHtI2pRl0=; b=mMKDbEWbqfWGq0Hojjb1yNpiyCDQj6qKBHzt7JlYlQbdNlsanKt79BQ6W6/tDhehpF 46LRUmzlQxVRKSn8yM14kOfTzXqw0hFtBjC25IenHBCg2jeeBr0Nh6iCgU/R6coPSdCR O715BU7HpdTLYazyW+gK4erkH3zYI8gt3iCBbPfYZdb26TdffUK9bDgnTWQrI/7D+yp3 68nN+k3IMfLNXQrGntcUDEs//1etrufhNXsj3Bb6jhEn90eEuwB06KpSZ28UkUze5Nt/ LtUd/IRyFAOrhbtVB4VyrM2dhkb9vfrYnnhKYkVPYccMjYwY35jrcjyv9hzmYlsoZaPx PyGg== X-Gm-Message-State: AJIora+LbYFQXaULY9wF2CzJcKz27xTbM2bTvU+0m1aisO988WXWcvdh qOD+bIYSgl82K4VYhNdUK6Y2NSq6foVaFQ== X-Google-Smtp-Source: AGRyM1s3Z/eIoUn8WfJVdQ+5hEMUEm8xWWttxK2AG5G+Jp7fR/qwymUNnBOEYcG1fjqGJLvHCn05YA== X-Received: by 2002:a05:622a:109:b0:31f:3302:3367 with SMTP id u9-20020a05622a010900b0031f33023367mr6385934qtw.488.1658746806262; Mon, 25 Jul 2022 04:00:06 -0700 (PDT) Received: from localhost (cpe-142-105-146-128.nycap.res.rr.com. [142.105.146.128]) by smtp.gmail.com with ESMTPSA id r11-20020ac8520b000000b0031bf5677d96sm7117584qtn.84.2022.07.25.04.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 04:00:05 -0700 (PDT) Date: Mon, 25 Jul 2022 07:00:04 -0400 From: Ben Boeckel To: Zopolis0 Cc: gcc@gcc.gnu.org Subject: Re: Importable STL Header Units? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.6 (2022-06-05) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2022 11:00:08 -0000 On Mon, Jul 25, 2022 at 19:48:28 +1000, Zopolis0 via Gcc wrote: > Currently, when importing the standard library, one has to > separately compile each unit they want to use, which is a hindrance to the > build process and a gap in the implementation. > > Is there any particular reason why gcc doesn't provide importable header > units for the standard library? Is there a timeline for this? Given that > the standard library can already be compiled into header units, is there > any particular reason why those aren't shipped with gcc? Some questions that come to mind if GCC were to provide this: - What flags should be used for these pre-compiled units? - How do you expect build systems to be able to find them? Will there be some kind of naming convention? It'd certainly be nice if other implementations would cooperate… (FD: CMake developer working on module support myself) It is my belief that any module-supporting build system has to consider the possibility of compiling any given external module because there's no guarantee that the flag set is compatible (say, `-ffast-math` or other "fun" flags with ABI implications) and you'll need your own compilation of the module anyways. Having pre-compiled units is nice, but merely an optimization for any robust build system; you certainly can't just use any available pre-compiled module blindly (unless you're relying on the linker to detect mismatches or something). The C++ committee's SG15 (Tooling) is looking into the problem. These papers are likely of interest to you (still under discussion): https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2577r2.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2581r0.pdf More papers will certainly appear: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/ --Ben