From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by sourceware.org (Postfix) with ESMTPS id E76EF3858D1E for ; Mon, 3 Oct 2022 18:58:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E76EF3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=martin.st Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=martin.st Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 293IwKX2022524-293IwKX3022524; Mon, 3 Oct 2022 21:58:20 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 8235EA1437; Mon, 3 Oct 2022 21:58:20 +0300 (EEST) Date: Mon, 3 Oct 2022 21:58:19 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: Mark Harmstone cc: binutils@sourceware.org Subject: Re: [PATCH 1/2] ld: Add --pdb option In-Reply-To: Message-ID: <7e5d88ff-9aa9-dbfd-aa80-1793c2c48fde@martin.st> References: <20221003014313.28766-1-mark@harmstone.com> <26dfc8b7-e89d-9212-da69-b05044d2d8a9@martin.st> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-FE-Policy-ID: 3:14:2:SYSTEM X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,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 List-Id: On Mon, 3 Oct 2022, Mark Harmstone wrote: > Hi Martin, > >> As I assume you're aware, lld's mingw port also supports PDB generation - >> and the description of this option also sounds like it's chosen to match >> lld's option for outputting PDB files - that's good! > > Yes, that's right. One notable difference is that the parameter here is > optional, unlike with lld, making it a lot easier to fit this into e.g. CMake > toolchain files or LDFLAGS. LLD also has got that behaviour, since https://github.com/llvm/llvm-project/commit/2c52ddf31f5421c5373923535b958b84c79772e3 in 2019. That's in particular why I wanted to make sure that this case works the same in binutils too. > It looks like the equals sign is mandatory when providing optional > parameters, otherwise it interprets the filename as another parameter. Yep, that's the case in LLD too. Unfortunately I didn't think of this behaviour initially when I first added this option - otherwise we could have had e.g. --pdb as a boolean option to just output to the default name, and e.g. --output-pdb= if you wanted to specify the name. But oh well, "-pdb=" works, and I guess it isn't the worst thing in the world. > But it does mean that the form "-pdb=out.pdb" will work on both ld and > lld, which I think is the most important thing. TBH, I consider the "-pdb=" case equally important too - that's what most people would use in the end. // Martin