From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 9A7CE38475A3 for ; Tue, 13 Dec 2022 15:56:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A7CE38475A3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x229.google.com with SMTP id c129so222261oia.0 for ; Tue, 13 Dec 2022 07:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A6oSXg0yHVdlBIs9z9To7dVIjKZYbeKiB6aYVGzwDjM=; b=OgNQNaZxdkg0fK5iTKWWXInwNEMW1XNscrP+i7ItXIXYw+izmGRetc0Ce/Cpam0yia F/Ey8GqkMXBbbBx1g9VLz2AvpA8Nw3eCteaKIFUGp+gDzXXN6CECFmv1HAlxy3BmUeLj XJHWVRh/tYOYpaYXYiRlsV7jP4YhQTNd6IDVZ9f7mVrpSq9wxt0MIeWRVSJUfc1X/HbP NBoV4e70kOpCI7thgUFkrKpjVGZeim/qFVr1/gSg8PxyQi6t/Iw4MsigIzn9y1MBF9W6 B/zq0Xo7mtRL97iSqyJKr708nT0885o/1IIfUYSjTntKRYZLX8EMUl9BUqvtXeG8kdNE xgAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=A6oSXg0yHVdlBIs9z9To7dVIjKZYbeKiB6aYVGzwDjM=; b=trL/bD+7/t765O4FP5VVfwjMc58ATGIWfB9DOyH1AS6Pa34IvqHvDOlyYABZNOjBWs 6bRCUH7jNAyfomkG3I12zL7GoPuiVSJVbjg9QijeSAB6rfZbqa8zX4qHMpsJfXT/QlZC 3deC7Y1qO1HI9dM+73AREH949dLx0/uLeZEY9FCPpVm2iYkUChsHtpjWSq+PJyVYeDNr BujKicIV+B8Le6ZNeJWzakpYZvCJhYAX2vAHcEGbxQg6BVI6JCGoG/rTGhdDRkUAik5+ n1p14VmbO3scgMoOrTfb06w8e7TpFRgOFR2VysrSrEuoDTI6pBJK+U0GmcWIx82RWvI9 xk9Q== X-Gm-Message-State: ANoB5pk7JxxtXe6WNroMh+VhWuKqA+JGEzPx8MIPenu9Wp4JiMB4IcQQ it+/wg3xPPATnT3E+XVf3lFESDCg1OYNkeDpXaY= X-Google-Smtp-Source: AA0mqf5EJrLBKwqcfU0HeCunyXIyax9nZ26hGSCnb/eRNIV3/iU1SlpcP1q28HQb5TrpkHC7TQ5uV/57+v9eEBuzT3M= X-Received: by 2002:aca:912:0:b0:35a:a414:df0f with SMTP id 18-20020aca0912000000b0035aa414df0fmr173833oij.118.1670947012817; Tue, 13 Dec 2022 07:56:52 -0800 (PST) MIME-Version: 1.0 References: <96699ff0-f4d7-4276-8af7-5a4ce9735174@acm.org> <6CFAC937-F5FD-49B3-A5E3-4ED83B270DCC@sandoe.co.uk> <2f005f8a-5e96-aece-c654-ab4b090da409@acm.org> <29c9ff1a-2c88-4e02-81e0-9780020b8e77.yedeng.yd@linux.alibaba.com> <3c9bfafd-9898-ca67-b629-5a23fec58792@acm.org> In-Reply-To: From: David Blaikie Date: Tue, 13 Dec 2022 07:56:38 -0800 Message-ID: Subject: Re: Naming flag for specifying the output file name for Binary Module Interface files To: "chuanqi.xcq" Cc: Iain Sandoe , GCC Development , Nathan Sidwell , Jonathan Wakely , "ben.boeckel" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I think Nathan might've been asking not only about what currently happens, but what we think should happen? On Mon, Dec 12, 2022 at 7:11 PM chuanqi.xcq w= rote: > > Hi Nathan, > > > 1) Are these flags silently ignored, if no module output is to be gener= ated? Or is some kind of diagnostic generated? > > Currently, clang will generate the unused-command-line-argument warning f= or this case: > > ``` > argument unused during compilation: '-fmodule-output' [-Wunused-command-l= ine-argument] > ``` Is that consistent with `-o`? (I assume so, but don't know - I guess there aren't many cases where `-o` is unused (maybe `-fsyntax-only`), so that behavior might be a bit less well specified) > > 2) what happens if you specify both -- do you get two outputs, a diagno= stic, or > is one silently selected? > > If someone specify both `-fmodule-output` and `-fmodule-output=3D/path`, > the `-fmodule-output=3D/path` will be selected always no matter what the = order is. This seems surprising/possibly wrong to me - do we have precedent from other flags to draw from? > And if multiple `-fmodule-output=3D/path` are specified, the last one wil= l be selected. > > > 3) What is the behaviour if compilation fails? Does nothing happen to = the file > indicated (potentially leaving an older version there), or does the equiv= alent > of 'rm -f $MODULE.pcm' happen? > > The module file will be deleted. The behavior is the same with `-o`. > > Thanks, > Chuanqi > > > ------------------------------------------------------------------ > From:Nathan Sidwell > Send Time:2022=E5=B9=B412=E6=9C=8812=E6=97=A5(=E6=98=9F=E6=9C=9F=E4=B8=80= ) 22:30 > To:Iain Sandoe ; GCC Development > Cc:Nathan Sidwell ; Jonathan Wakely ; David Blaikie ; ben.boeckel ; chuanqi.xcq > Subject:Re: Naming flag for specifying the output file name for Binary Mo= dule Interface files > > On 12/9/22 12:33, Iain Sandoe wrote: > > Hello all. > > > >> On 9 Dec 2022, at 01:58, chuanqi.xcq wro= te: > >> > >> It looks like `-fmodule-file` is better from the discussion. So let's = take it. Thanks for everyone here > > > > So FAOD (after this discussion) Chuanqi's current patchset implements t= he following in clang: > > > > -fmodule-output > > > > - this causes the BMI to be saved in the CWG with the basename of th= e source file and a suffix of .pcm. > > > > -fmodule-output=3D > > > > - this causes the BMI to be saved at the path specified. > > > > 1) Are these flags silently ignored, if no module output is to be generat= ed? Or > is some kind of diagnostic generated? > > 2) what happens if you specify both -- do you get two outputs, a diagnost= ic, or > is one silently selected? > > 3) What is the behaviour if compilation fails? Does nothing happen to th= e file > indicated (potentially leaving an older version there), or does the equiv= alent > of 'rm -f $MODULE.pcm' happen? > > nathan > > -- > Nathan Sidwell > >