From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id D66EA382B3C8 for ; Wed, 14 Dec 2022 18:39:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D66EA382B3C8 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-oa1-x35.google.com with SMTP id 586e51a60fabf-142b72a728fso17758128fac.9 for ; Wed, 14 Dec 2022 10:39:18 -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=L64X3q6m+qwR6dmhrUK75yltybRMvAZsC390bemp4Vc=; b=TUOmzuyg7zFjQmlq3hOih/gFzGayvjEle73iP/QsqjBeRVMHzQhA1X8TxRzgtVPMFw RdeYcKMJQr6oComwSJhA4hpM202jVryljOXh3z2JFEwly2ozqj/rZz3vMsyuRu5ueQYd /zbFWECjB2qc1D73SkqV7FFjOaBjfiMMABxR46q+JBb8V/OxYWslXLVBjHk7fieYU/So 9oB2zjaUvb8vrCsChrzTsktDm4byrj9UiF2H7XC2hhd+gNaJr1ib2i7x95mT8THBBo41 Ix9UP5ZLfvQUEnAfUWZ5gIIaiocH3U+LDX+pPNLu6d/CVfo2u3mWKBvfP2JSO0CcQLqf n3rA== 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=L64X3q6m+qwR6dmhrUK75yltybRMvAZsC390bemp4Vc=; b=Lyt//mJlDX1pmAJicRrtBhyj2HwKJTxI9gh91Nap46kSmYx59FVdZPd2ze3V0OdI0t JvL4M1SLgQVH2uuNBXtC9yRsaaNeU9PX76UKoT0dkV6Mb1d9GyGHFhpf6Wyhgmz/yT4N unA52PyMXBAKAWkcWp7TLM8m+0ehyGNC9tl7LEhrk2AJ3pN4GPoQaSW9p7RBzhJ3TyP7 Fq/LiYmasDljeUM50WVfhaI4dTizzWhR1rGsiWM9OPe8RiQKdkp+C5s6VNsDMpWxrxMf k+j5gXBa+G8AE1hi2/wqkIhqLeMHW3xOYTEUvDsuF10VTCxrBUGzrLi0lCk8i61EYa3T OP/Q== X-Gm-Message-State: AFqh2kqvfJFQUl9H6zt9/SlBe4XnhsC/IUdvdoK04zhpfB6mb5cvOLxm iIXMg/PvZOnsTGIfl6ZeVfw8CIPCvXYCgEO/qfc= X-Google-Smtp-Source: AMrXdXsjwNd6rMm1/GUulk0lsZHw/RiNg7jl4uYiZqhWE/SbenifRfuJWIuFEWbjqFR8p1V5BTJExQy7Ei8A/OM6F5k= X-Received: by 2002:a05:6870:1d0f:b0:143:e3af:7b93 with SMTP id pa15-20020a0568701d0f00b00143e3af7b93mr278188oab.118.1671043157530; Wed, 14 Dec 2022 10:39:17 -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> <41caec52-1372-4441-b62d-6ce33f3534c6.yedeng.yd@linux.alibaba.com> In-Reply-To: <41caec52-1372-4441-b62d-6ce33f3534c6.yedeng.yd@linux.alibaba.com> From: David Blaikie Date: Wed, 14 Dec 2022 10:39:06 -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=2.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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: On Wed, Dec 14, 2022 at 1:56 AM chuanqi.xcq w= rote: > > Hi David, > > > I think Nathan might've been asking not only about what currently > happens, but what we think should happen? > > Yes. > > > 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) > > `-o` wouldn't emit a warning if it is not used. (with `-fsyntax-only` for= example). > Since we want to make the behavior of `-fmodule-output` to be consistent = with `-o`. > I've changed the behavior in https://reviews.llvm.org/D140001. > > > This seems surprising/possibly wrong to me - do we have precedent from > other flags to draw from? > > I feel it makes sense since `-fmodule-output=3D` will provide more inform= ation than `-fmodule-output`. > So it is naturally to me that `-fmodule-output=3D` has higher priority. > > For examples, I don't enumerate all the flags but I find the following ca= ses in minutes: > - `-fpack-struct=3D` has higher priority than `-fpack-struct`. > - `-fsave-optimization-record=3D` has higher priority than `-fsave-optim= ization-record=3D`. > - `-ftime-report=3D` has higher priority than `-ftime-report`. > - `-ftime-trace=3D` has higher priority than `-ftime-trace`. > > So I think the bahavior should be correct. Fair enough - thanks for the references! Nathan - is that consistent with your preference/understanding/experience? > > Thanks, > Chuanqi > > > ------------------------------------------------------------------ > From:David Blaikie > Send Time:2022=E5=B9=B412=E6=9C=8813=E6=97=A5(=E6=98=9F=E6=9C=9F=E4=BA=8C= ) 23:56 > To:chuanqi.xcq > Cc:Iain Sandoe ; GCC Development ; Na= than Sidwell ; Jonathan Wakely ; ben.boeckel > Subject:Re: Naming flag for specifying the output file name for Binary Mo= dule Interface files > > 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 = wrote: > > > > Hi Nathan, > > > > > 1) Are these flags silently ignored, if no module output is to be gen= erated? Or is some kind of diagnostic generated? > > > > Currently, clang will generate the unused-command-line-argument warning= for this case: > > > > ``` > > argument unused during compilation: '-fmodule-output' [-Wunused-command= -line-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 diag= nostic, 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 th= e 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 w= ill be selected. > > > > > 3) What is the behaviour if compilation fails? Does nothing happen t= o the file > > indicated (potentially leaving an older version there), or does the equ= ivalent > > 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 = Module Interface files > > > > On 12/9/22 12:33, Iain Sandoe wrote: > > > Hello all. > > > > > >> On 9 Dec 2022, at 01:58, chuanqi.xcq w= rote: > > >> > > >> 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= the following in clang: > > > > > > -fmodule-output > > > > > > - this causes the BMI to be saved in the CWG with the basename of = the 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 gener= ated? Or > > is some kind of diagnostic generated? > > > > 2) what happens if you specify both -- do you get two outputs, a diagno= stic, or > > is one silently 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 equ= ivalent > > of 'rm -f $MODULE.pcm' happen? > > > > nathan > > > > -- > > Nathan Sidwell > > > > > >