From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from Ishtar.sc.tlinx.org (ishtar.tlinx.org [173.164.175.65]) by sourceware.org (Postfix) with ESMTPS id 71E833858400 for ; Mon, 27 Sep 2021 18:16:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71E833858400 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tlinx.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tlinx.org Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id 18RIF4mH083383; Mon, 27 Sep 2021 11:15:06 -0700 Message-ID: <61520A1E.9050900@tlinx.org> Date: Mon, 27 Sep 2021 11:14:54 -0700 From: L A Walsh User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Segher Boessenkool CC: Jonathan Wakely , gcc-help , unlvsur unlvsur Subject: Re: how to get -march=native's value? References: <5b4a11b1a9a3945256d298cd355991dcffa1d806.camel@mengyan1223.wang> <20210917175325.GS1583@gate.crashing.org> <20210927125528.GA3789484@cventin.lip.ens-lyon.fr> <20210927171344.GA8185@gate.crashing.org> In-Reply-To: <20210927171344.GA8185@gate.crashing.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 18:16:03 -0000 On 2021/09/27 10:13, Segher Boessenkool wrote: > On Mon, Sep 27, 2021 at 02:55:28PM +0200, Vincent Lefevre wrote: > >> On 2021-09-17 12:53:25 -0500, Segher Boessenkool wrote: >> >>> For x86 -march=something is the same as -march=native, _if_ the compiler >>> knows about your CPU. >>> ---- I have a question, as someone reading this conversation .... If one is using cross-compilation -- as it sounded like the original author might be doing, what could the compiler know about the target machine? Is there some sort of "profile-this-cpu-for-pertinent-options" binary or compiler-option that one should(or could) run on the target machine in order that the correct compiler switches be set? Otherwise, it would seem that -march=native would only be useful for the (probably majority of) cases where one is compiling for their own machine (?).