From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id BD6ED3847725 for ; Wed, 3 Apr 2024 10:20:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD6ED3847725 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD6ED3847725 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712139637; cv=none; b=hwNerBSAiHEgRGKNHndlv50Xl85wDp/PY7MrimM7JEFW14bzgTsOYGg4kUoeUmyGDzFsDxJsIc3nA9ZbE8Aw/WDyU8s9abPW2UE6nlXa3P14+omX0+7cDQ7mYeY4/0RohS3oxllDiryI/sIs/ihtLDPqy47nkwwZFcQgjVte5JY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712139637; c=relaxed/simple; bh=7FYXR0sL/oQETo47cTh01Oub4WCT2FYhb1bqmR6bXlU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=xQipGd3j7TtRkz0+TqSi6L9cwLmlvHXL4V5Eo8pamibyPCWg9E4T+j01IzZzb4XXO0uTpIyVcTbBUoQTClzKp32hTlYerh1nApVppGsLV7aFZ/7DUWIbe9dmqdOv0RZmxAHAmGEs4+lcBzfL30H/mAiXfUTBIy0ow61AkISblO8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41624fe40b2so1898005e9.1 for ; Wed, 03 Apr 2024 03:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1712139632; x=1712744432; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=j3vQ97eoCL/hdXJNbWWPGq5v3/mvcX46yDDe8LF6UFI=; b=ABIOxAE0gRCVJv9zVoUFOg4LkVCf/7C2tsurPbLaKLFBAZVOPenzsJKcd6sXH5Z8Kz H2pTrrAR5K8Hby5D85f3fWkn0X8u4Yalkan2r6FSWdDhufW0eqTXLBfrRZEuYakuJr/y qB/WufuNW3n0l2E1RP9+hyZAhGYo4CkbzWtlO1/OX7UUVlGXWqeFK93C4hoSenyqvhOS 1+xxfQgkUzOZ78YYAYDYSBW3UhTK4fU/aTCSxvK5PMxGUoYHfhX537GdJnkhdGPVtMWx u7HxppDtciZDUZW5/yfwwVfXTRNhfpru3NOHQIJJZXQPPajetZzT3iksO49igeuvXCEP rl6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712139632; x=1712744432; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j3vQ97eoCL/hdXJNbWWPGq5v3/mvcX46yDDe8LF6UFI=; b=QHgwLo84MOb9+xeBZFW0jejqHGI4B0CWF4zh0JIidDsD5NNO5T6bgzCpzIkXlb0o3G RN8P6tIiWCGqL2upN/TaXUegG1FKUPlfVJILgKdLyFsW1hlpjlJKwQNeqB/wS8kW10B7 J3reEFvbaGimSnxkSZgGyuc96ROTns6sWSbHPyU3LW4pMcDVe123IsgVTj8cyl/U/mZ0 g5MydTyhbKlI53ailrR+M8z4PsDOPxivtQZURFAdSoV/ewf6LQmDxOebEwnA5tp+H7Tq pf1aj/LIF7mpiOXasWqHidY0ajADG9p+PM3tzLVP+TTb1WyQNOFHEk36xOVocdrWghIh xh2g== X-Forwarded-Encrypted: i=1; AJvYcCX/M0sOYb1P8rkmlpvPS/l7dGByGJ44htAw/1dvvjt3X3llXHpA+hBtyQVI1ZHuOgE/sRfiFQkzpWFXyC6jcj0ffKn24x5wxQ== X-Gm-Message-State: AOJu0YznMecf6f1OXK5wM/8QwHpyR6fK/oiPRMSu9NIHgC7oraSiPkbH Ekvme7orwWeCUpx6dBj4RVPeRC+AN8k91efukpigrxG2oOr1YmLtyPZ+OIekTy2aPXccCVV8bvh 5/RE= X-Google-Smtp-Source: AGHT+IFcol2wpZakWfvr3go9MuKBzEWOQSc99GLCv79ZMRU4yIGYMQBPjXkGHO7eb39SpnPm21OHVQ== X-Received: by 2002:a05:600c:575a:b0:415:6860:eafb with SMTP id jw26-20020a05600c575a00b004156860eafbmr3949412wmb.15.1712139632358; Wed, 03 Apr 2024 03:20:32 -0700 (PDT) Received: from [192.168.0.118] (hawk-18-b2-v4wan-167765-cust1304.vm26.cable.virginm.net. [82.41.69.25]) by smtp.gmail.com with ESMTPSA id fc9-20020a05600c524900b004154399fbd9sm21257487wmb.45.2024.04.03.03.20.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Apr 2024 03:20:31 -0700 (PDT) Message-ID: <8cb063a8-30f9-43db-83e8-be7379a8e03a@baylibre.com> Date: Wed, 3 Apr 2024 11:20:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Patch] GCN: Fix --with-arch= handling in mkoffload [PR111966] To: Tobias Burnus , gcc-patches References: <5b635551-a171-4cc2-bf5e-a71070740b14@baylibre.com> Content-Language: en-GB From: Andrew Stubbs In-Reply-To: <5b635551-a171-4cc2-bf5e-a71070740b14@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 03/04/2024 10:05, Tobias Burnus wrote: > This patch handles --with-arch= in GCN's mkoffload.cc > > While mkoffload mostly does not know this and passes it through to the > GCN lto1 compiler, > it writes an .o file with debug information - and here the -march= in > the ELF flags must > agree with the one in the other files. Hence, it uses now the > --with-arch= config argument. > > Doing so, there is now a diagnostic if the -march= or --with-arch= is > unknown. While the > latter should be rejected at GCC compile time, the latter was not > diagnosed in mkoffload > but only later in GCN's compiler. > > But as there is now a fatal_error in mkoffload, which comes before the > GCN-compiler call, > the 'note:' which devices are available were lost. This has been > reinstated by using > the multilib settings. (That's not identical to the compiler supported > flags the output > is reasonable, arguable better or worse than lto1.) > > Advantage: The output is less cluttered than a later fail. > > To make mkoffload errors - and especially this one - more useful, it now > also initializes > the colorization / bold. > > OK for mainline? OK. Thanks for fixing this. Andrew > > * * * > > Example error: > > gcn mkoffload: error: unrecognized argument in option '-march=gfx1111' > gcn mkoffload: note: valid arguments to '-march=' are: gfx906, gfx908, > gfx90a, gfx1030, gfx1036, gfx1100, gfx1103 > > where on my TERM=xterm-256color,  'gcn mkoffload:' and the quoted texts > are in bold, > 'error:' is red and 'note:' is cyan. > > Compared to cc1, the 'note:' lacks 'fiji', the list is separated by ', ' > instead of ' ', and cc1 has a "; did you mean 'gfx1100'?". > And the program name is 'gcn mkoffload' instead of 'cc1'. > > Tobias > > PS: The generated multilib list could be later changed to be based on > the gcn-.def file; > or we just keep the multiconfig variant of this patch. I think a .def file would be more future-proof if we ever have multilibs for options other than -march, but this works for now. Andrew