Date: Mon, 14 Jun 2021 14:07:33 -0700 From: Mark Millard via freebsd-hackers <freebsd-hackers@freebsd.org> To: tech-lists <tech-lists@zyxst.net> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: the clang compiler does not support '-march=native' Message-ID: <AC1F4C66-C5A5-43DD-BFFC-9A8D12A4E22C@yahoo.com> In-Reply-To: <6E5624A0-6456-4C22-A090-6C1496257AC8@FreeBSD.org> References: <YMe3K8uDXHktRDCZ@ceres.zyxst.net> <6E5624A0-6456-4C22-A090-6C1496257AC8@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-Jun-14, at 13:18, Dimitry Andric <dim at FreeBSD.org> wrote: > On 14 Jun 2021, at 22:08, tech-lists <tech-lists@zyxst.net> wrote: >>=20 >> There's a program I'd like to compile, but I'm getting an error "the >> clang compiler does not support '-march=3Dnative'" >>=20 >> % clang --version >> FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git >> llvmorg-11.0.1-0-g43ff75f2c3fe) >> Target: aarch64-unknown-freebsd13.0 >> Thread model: posix >> InstalledDir: /usr/bin >>=20 >> Is this because I have this in /etc/src.conf: >>=20 >> WITHOUT_LLVM_TARGET_ALL=3D >> WITH_LLVM_TARGET_AARCH64=3D >> WITH_LLVM_TARGET_ARM=3D >>=20 >> (this is on a rpi4 arm64.aarch64) >=20 > No, this is because whatever you are trying to compile has apparently > hardcoded "-march=3Dnative" in its compile flags. Try removing that. = :) I'll add to that note the comparison/contrast of aarch64 vs. amd64 as a context for clang: The aarch64 context rejects the value "native": # echo | clang -E - -march=3Dnative -### FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git = llvmorg-11.0.1-0-g43ff75f2c3fe) Target: aarch64-unknown-freebsd14.0 Thread model: posix InstalledDir: /usr/bin clang: error: the clang compiler does not support '-march=3Dnative' (in-process) "/usr/bin/clang" "-cc1" "-triple" "aarch64-unknown-freebsd14.0" "-E" = "-disable-free" "-disable-llvm-verifier" "-discard-value-names" = "-main-file-name" "-" "-mrelocation-model" "static" = "-mframe-pointer=3Dnon-leaf" "-fno-rounding-math" = "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "generic" = "-target-feature" "+neon" "-target-abi" "aapcs" = "-fallow-half-arguments-and-returns" "-fno-split-dwarf-inlining" = "-debugger-tuning=3Dgdb" "-resource-dir" "/usr/lib/clang/11.0.1" = "-fdebug-compilation-dir" "/usr/home/root" "-ferror-limit" "19" = "-fno-signed-char" "-fgnuc-version=3D4.2.1" "-faddrsig" "-o" "-" "-x" = "c" "-" The amd64 context, by contrast, does not complain: # echo | clang -E - -march=3Dnative -### FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git = llvmorg-11.0.1-0-g43ff75f2c3fe) Target: x86_64-unknown-freebsd14.0 Thread model: posix InstalledDir: /usr/bin (in-process) "/usr/bin/clang" "-cc1" "-triple" "x86_64-unknown-freebsd14.0" "-E" = "-disable-free" "-disable-llvm-verifier" "-discard-value-names" = "-main-file-name" "-" "-mrelocation-model" "static" = "-mframe-pointer=3Dall" "-fno-rounding-math" "-mconstructor-aliases" = "-munwind-tables" "-target-cpu" "znver1" "-target-feature" "+sse2" = "-target-feature" "-tsxldtrk" "-target-feature" "+cx16" = "-target-feature" "+sahf" "-target-feature" "-tbm" "-target-feature" = "-avx512ifma" "-target-feature" "+sha" "-target-feature" "-gfni" = "-target-feature" "-fma4" "-target-feature" "-vpclmulqdq" = "-target-feature" "+prfchw" "-target-feature" "+bmi2" "-target-feature" = "-cldemote" "-target-feature" "+fsgsbase" "-target-feature" "-ptwrite" = "-target-feature" "-amx-tile" "-target-feature" "-avx512bf16" = "-target-feature" "+popcnt" "-target-feature" "+aes" "-target-feature" = "-avx512bitalg" "-target-feature" "-movdiri" "-target-feature" "+xsaves" = "-target-feature" "-avx512er" "-target-feature" "+xsavec" = "-target-feature" "-avx512vnni" "-target-feature" "-amx-bf16" = "-target-feature" "-avx512vpopcntdq" "-target-feature" "-pconfig" = "-target-feature" "-clwb" "-target-feature" "-avx512f" "-target-feature" = "+clzero" "-target-feature" "-pku" "-target-feature" "+mmx" = "-target-feature" "-lwp" "-target-feature" "-rdpid" "-target-feature" = "-xop" "-target-feature" "+rdseed" "-target-feature" "-waitpkg" = "-target-feature" "-movdir64b" "-target-feature" "+sse4a" = "-target-feature" "-avx512bw" "-target-feature" "+clflushopt" = "-target-feature" "+xsave" "-target-feature" "-avx512vbmi2" = "-target-feature" "+64bit" "-target-feature" "-avx512vl" = "-target-feature" "-serialize" "-target-feature" "-invpcid" = "-target-feature" "-avx512cd" "-target-feature" "+avx" "-target-feature" = "-vaes" "-target-feature" "+cx8" "-target-feature" "+fma" = "-target-feature" "-rtm" "-target-feature" "+bmi" "-target-feature" = "-enqcmd" "-target-feature" "+rdrnd" "-target-feature" "+mwaitx" = "-target-feature" "+sse4.1" "-target-feature" "+sse4.2" = "-target-feature" "+avx2" "-target-feature" "+fxsr" "-target-feature" = "-wbnoinvd" "-target-feature" "+sse" "-target-feature" "+lzcnt" = "-target-feature" "+pclmul" "-target-feature" "-prefetchwt1" = "-target-feature" "+f16c" "-target-feature" "+ssse3" "-target-feature" = "-sgx" "-target-feature" "-shstk" "-target-feature" "+cmov" = "-target-feature" "-avx512vbmi" "-target-feature" "-amx-int8" = "-target-feature" "+movbe" "-target-feature" "-avx512vp2intersect" = "-target-feature" "+xsaveopt" "-target-feature" "-avx512dq" = "-target-feature" "+adx" "-target-feature" "-avx512pf" "-target-feature" = "+sse3" "-fno-split-dwarf-inlining" "-debugger-tuning=3Dgdb" = "-resource-dir" "/usr/lib/clang/11.0.1" "-fdebug-compilation-dir" = "/usr/fbsd/main-src" "-ferror-limit" "19" "-fgnuc-version=3D4.2.1" = "-fcolor-diagnostics" "-faddrsig" "-o" "-" "-x" "c" "-" =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC1F4C66-C5A5-43DD-BFFC-9A8D12A4E22C>