From owner-freebsd-toolchain@freebsd.org Fri Jan 5 05:52:15 2018 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E27BBEB49D8 for ; Fri, 5 Jan 2018 05:52:15 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D293C775F8 for ; Fri, 5 Jan 2018 05:52:15 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id D1E3DEB49D7; Fri, 5 Jan 2018 05:52:15 +0000 (UTC) Delivered-To: toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D183FEB49D6 for ; Fri, 5 Jan 2018 05:52:15 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B41FB775F7; Fri, 5 Jan 2018 05:52:15 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 05A9FE244; Fri, 5 Jan 2018 05:52:15 +0000 (UTC) From: Jan Beich To: toolchain@freebsd.org Cc: linimon@freebsd.org Subject: Is -march/-mtune=native actually supported on FreeBSD arm* or aarch64? Date: Fri, 05 Jan 2018 06:52:08 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2018 05:52:16 -0000 Some ports pass -march=native and/or -mtune=native. Both are extensively documented by GCC for x86. For other architectures some excerpts say "native" is only supported on Linux (via /proc/cpuinfo). For example, $ uname -p armv6 $ echo 'int main() {}' >a.c $ clang -march=native a.c clang: error: the clang compiler does not support '-march=native' $ clang -mtune=native a.c $ pkg install -qy gcc7 $ gcc7 -march=native a.c $ gcc7 -mtune=native a.c $ uname -p aarch64 $ echo 'int main() {}' >a.c $ clang -march=native a.c clang: error: the clang compiler does not support '-march=native' $ clang -mtune=native a.c clang: error: the clang compiler does not support '-mtune=native' $ pkg install -qy gcc7 $ gcc7 -march=native a.c $ gcc7 -mtune=native a.c What's the rationale for Clang vs. GCC difference? Is it safe to run FreeBSD arm* -mtune=native binaries on CPUs older than build machine?