From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 7F3EF385840C for ; Mon, 27 Sep 2021 18:26:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F3EF385840C Received: by mail-wr1-x432.google.com with SMTP id i23so53610145wrb.2 for ; Mon, 27 Sep 2021 11:26:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nOAyq689ewbG+ojpQd8FjU6HHVW32dNr20SxRnkRaB0=; b=UJhM6b95J0yW0Phpz3IeHgbRgiXg9ewMJ4mikNn90zawog6OdWXl348ZMSh3OcOnm6 lOuO0vgZDY2EpNgc1z5Zl4w9tvEx4//oObIHB4UgiM9azD/TdYRt/xBScQ5UAzI76XNs W40+yGPWCeOGWI7oT7GChIMgNTQiZnkYeW0StlGNGAADGn5t9iReFMmj/39XwdVvd7hg oAp1dNmBX81WVa+K0QdOeG7SX5UwcHiaiXmJlgn0li3H5Xq7kEiw9xhGiMmf61bBdpAK gqHKJ88NRVOndhcfOhtxno1OHX8BpX4OUeIf0flQz689wmhEoN/NCQkBTcJwWuDlmt5D QfFA== X-Gm-Message-State: AOAM530TBe1fwUUSEqOBzL5PQn+NAY7aS0J8hm6vnrUfGJNrhJTB46jy cgJmkYWAfGva66tvzmFU0ws/A4S4ZCu9woGzodU= X-Google-Smtp-Source: ABdhPJxM2PAsjQnUJYUl8tQ0VRoYi1CkuTrmLdAuW78Lwpi/scjGvg8tnkLLvFmS3gU5TvL18+WQltfs5Z33dwLkSwc= X-Received: by 2002:a05:6000:11c6:: with SMTP id i6mr1505077wrx.177.1632767169558; Mon, 27 Sep 2021 11:26:09 -0700 (PDT) MIME-Version: 1.0 References: <5b4a11b1a9a3945256d298cd355991dcffa1d806.camel@mengyan1223.wang> <20210917175325.GS1583@gate.crashing.org> <20210927125528.GA3789484@cventin.lip.ens-lyon.fr> <20210927171344.GA8185@gate.crashing.org> <61520A1E.9050900@tlinx.org> In-Reply-To: <61520A1E.9050900@tlinx.org> From: Jonathan Wakely Date: Mon, 27 Sep 2021 19:25:58 +0100 Message-ID: Subject: Re: how to get -march=native's value? To: L A Walsh Cc: Segher Boessenkool , gcc-help , unlvsur unlvsur Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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:26:12 -0000 On Mon, 27 Sept 2021 at 19:16, L A Walsh wrote: > > 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? Only what you tell it. > 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 (?). Yes, -march=native is for native compilation, not cross compilation. The clue is in the name :-)