Re: 13.2-BETA2: xz: illegal instruction

From: Peter <pmc_at_citylink.dinoex.sub.org>
Date: Thu, 23 Feb 2023 16:05:42 UTC
On Thu, Feb 23, 2023 at 02:22:01PM +0000, Jamie Landeg-Jones wrote:
! Peter <pmc@citylink.dinoex.sub.org> wrote:
! 
! > > # ./xz < /dev/zero > /dev/null
! > > Illegal instruction (core dumped)
! >                                                                                 
! > > CPU: Intel(R) Core(TM) i3 CPU         540  @ 3.07GHz (3059.08-MHz K8-class CPU)
! > > Origin="GenuineIntel"  Id=0x20655  Family=0x6  Model=0x25  Stepping=5         
! >                                                                                 
! > > CPUTYPE?=westmere
! >
! > It's liblzma, and it doesn't want westmere, it apparently wants
! > penryn.
! 
! Doesn't "CPUTYPE?=native" do the right thing?

Good point, I should test that. (It doesn't concern me, because that
would likely get me code for the machine that is actually doing the
build, and that is not the old i3)

! You can see what features this enables/disables on your machine
! and also the determined "-target-cpu" in the following output:
! 
! /usr/bin/env -i /usr/bin/clang -v -x c -march=native -fsyntax-only -o /dev/null /dev/null 2>&1

Thanks, You're helpful! :)

 -target-cpu westmere

But when building with CPTYPE?=native, the code works!


$  /usr/bin/env -i /usr/bin/clang -v -x c -march=native -fsyntax-only -o /dev/null /dev/null 2>&1
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
Target: x86_64-unknown-freebsd13.2
Thread model: posix
InstalledDir: /usr/bin
 (in-process)
 "/usr/bin/clang" -cc1 -triple x86_64-unknown-freebsd13.2 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name null -mrelocation-model static -mframe-pointer=all -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu westmere -target-feature -avx512pf -target-feature -tsxldtrk -target-feature +cx16 -target-feature +sahf -target-feature -tbm -target-feature -avx512ifma -target-feature -sha -target-feature +crc32 -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 -uintr -target-feature -gfni -target-feature +popcnt -target-feature -widekl -target-feature -aes -target-feature -avx512bitalg -target-feature -movdiri -target-feature -xsaves -target-feature -avx512er -target-feature -avxvnni -target-feature -avx512fp16 -target-feature -avx512vnni -target-feature -amx-bf16 -target-feature -avx512vpopcntdq -target-feature -pconfig -target-feature -clwb -target-feature -avx512f -target-feature -xsavec -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 -kl -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 -hreset -target-feature -invpcid -target-feature -avx512cd -target-feature -avx -target-feature -vaes -target-feature -avx512bf16 -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 +sse2 -target-feature -adx -target-feature +sse3 -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/operator -resource-dir /usr/lib/clang/14.0.5 -fdebug-compilation-dir=/home/operator -ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c /dev/null
clang -cc1 version 14.0.5 based upon LLVM 14.0.5 default target x86_64-unknown-freebsd13.2
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/clang/14.0.5/include
 /usr/include
End of search list.

$  /usr/bin/env -i /usr/bin/clang -v -x c -march=westmere -fsyntax-only -o /dev/null /dev/null 2>&1
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
Target: x86_64-unknown-freebsd13.2
Thread model: posix
InstalledDir: /usr/bin
 (in-process)
 "/usr/bin/clang" -cc1 -triple x86_64-unknown-freebsd13.2 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name null -mrelocation-model static -mframe-pointer=all -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu westmere -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/operator -resource-dir /usr/lib/clang/14.0.5 -fdebug-compilation-dir=/home/operator -ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c /dev/null
clang -cc1 version 14.0.5 based upon LLVM 14.0.5 default target x86_64-unknown-freebsd13.2
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/clang/14.0.5/include
 /usr/include
End of search list.