From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from einhorn-mail-out.in-berlin.de (einhorn-mail-out.in-berlin.de [217.197.80.21]) by sourceware.org (Postfix) with ESMTPS id 36E5D385DC14 for ; Fri, 11 Dec 2020 10:25:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 36E5D385DC14 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=doko@ubuntu.com X-Envelope-From: doko@ubuntu.com Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTPSA id 0BBAPSgu009724 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 11 Dec 2020 11:25:28 +0100 Subject: Re: Linker diagnostics for the incorrect options . To: Nick Clifton , Fangrui Song Cc: Binutils References: From: Matthias Klose Message-ID: <43b3a4c2-af74-c177-fc9a-d198fd82a6e8@ubuntu.com> Date: Fri, 11 Dec 2020 11:25:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 10:25:36 -0000 On 9/23/20 11:31 AM, Nick Clifton via Binutils wrote: > Hi Fangrui, > >> This is a conflict between the grouped short options syntax and single >> dash prefixed long options. >> >> % touch an ommand ':)' >> % ld.bfd -you -can -ofcourse -use -this -Long -command -Line ':)' >> :) > > he! > >> For newer long options, we should encourage EXACTLY_TWO_DASHES > > Definitely. > >> (ld/lexsup.c). I have not seen grouped short options in a very large >> code base and FreeBSD. >> Maybe we can deprecate grouped short options syntax for ld. > > I like this idea. How about the attached patch ? With it applied I > get output like this: > > % ld -vn -non-static -e 0 -v -e2 hello.o > GNU ld (GNU Binutils) 2.35.50.20200923 > ld: Warning: grouped short command line options are deprecated: -vn > ld: Error: unable to disambiguate: -non-static (did you mean --non-static ?) > > % echo $? > 1 this causes PR ld/27050: $ ld.bfd -no-pie ld.bfd: Error: unable to disambiguate: -no-pie (did you mean --no-pie ?)