Bug 241079 - WITHOUT_CROSS_COMPILER buildworld broken on amd64 with non-AVX-512 CPU
Summary: WITHOUT_CROSS_COMPILER buildworld broken on amd64 with non-AVX-512 CPU
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-05 12:25 UTC by Bernard Spil
Modified: 2020-02-28 14:44 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Spil freebsd_committer freebsd_triage 2019-10-05 12:25:22 UTC
Building 12.1-BETA3 fails on my Ivy Bridge machine with `-march=native` (or -march=ivybridge)

> cc -target x86_64-unknown-freebsd12.1 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -c -x assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing -march=native -g -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD  -MF.depend.support.o -MTsupport.o -fdebug-prefixmap=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -g dwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999  -Werror /usr/src/sys/amd64/amd64/support.S
> /usr/src/sys/amd64/amd64/support.S:1821:2: error: instruction requires: AVX-512 ISA
>  vmovdqa64 %zmm0, %gs:0x340
>  ^
> /usr/src/sys/amd64/amd64/support.S:1822:2: error: instruction requires: AVX-512 ISA
>  vpxor %zmm0, %zmm0, %zmm0
>  ^
> /usr/src/sys/amd64/amd64/support.S:1825:2: error: instruction requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /usr/src/sys/amd64/amd64/support.S:1826:2: error: instruction requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /usr/src/sys/amd64/amd64/support.S:1838:2: error: instruction requires: AVX-512 ISA
>  vmovdqa64 %gs:0x340, %zmm0
>  ^
> *** [support.o] Error code 1

CPU
> $ sysctl hw.model         
> hw.model: Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz

Source tree
> $ svn info
> Path: .
> Working Copy Root Path: /usr/src
> URL: https://svn.freebsd.org/base/releng/12.1
> Relative URL: ^/releng/12.1
> Repository Root: https://svn.freebsd.org/base
> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> Revision: 353121
> Node Kind: directory
> Schedule: normal
> Last Changed Author: markj
> Last Changed Rev: 353108
> Last Changed Date: 2019-10-04 16:36:09 +0000 (Fri, 04 Oct 2019)
Comment 1 Bernard Spil freebsd_committer freebsd_triage 2019-10-05 20:33:32 UTC
If your CPU doesn't natively support AVX-512, make buildworld is broken on 12.1

After commenting the 

> #WITHOUT_CROSS_COMPILER="YES"

in /etc/src.conf I was able to compile a kernel. Now runs fine.
Comment 2 Armin Pirkovitsch freebsd_committer freebsd_triage 2020-01-12 16:34:26 UTC
Similar problem here - however changing WITHOUT_CROSS_COMPILER sadly changes nothing.
CPUs: 2x Xeon E5-2620 v4
12.0-p12 installed
stable/12 and releng/12.1 both fail to build with the same error that was posted before.

And there ist no '-march=...' argument in my case.


> cc -target x86_64-unknown-freebsd12.1 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -c -x assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing  -g -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD  -MF.depend.support.o -MTsupport.o -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999  -Werror /usr/src/sys/amd64/amd64/support.S
> /usr/src/sys/amd64/amd64/support.S:1815:2: error: instruction requires: AVX-512 ISA
>  vmovdqa64 %zmm0, %gs:0x340
>  ^
> /usr/src/sys/amd64/amd64/support.S:1816:2: error: instruction requires: AVX-512 ISA
>  vpxor %zmm0, %zmm0, %zmm0
>  ^
> /usr/src/sys/amd64/amd64/support.S:1819:2: error: instruction requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /usr/src/sys/amd64/amd64/support.S:1820:2: error: instruction requires: AVX-512 DQ ISA
>  vorpd (%rdx), %zmm0, %zmm0
>  ^
> /usr/src/sys/amd64/amd64/support.S:1832:2: error: instruction requires: AVX-512 ISA
>  vmovdqa64 %gs:0x340, %zmm0
>  ^
> *** [support.o] Error code 1
Comment 3 Sharad Ahlawat 2020-01-27 00:34:18 UTC
Compiling the 12.1 kernel with clang-6 will throw this error.

Ran into this issue myself while upgrading from 12.0 to 12.1 when trying to compile the kernel *before* running "freebsd-update install" twice.

After running "freebsd-update install" twice clang was updated to clang 8.0.1 which compiled the 12.1 kernel without any issues.
Comment 4 Bram Ton 2020-02-28 14:44:35 UTC
I ran into the same issue whilst upgrading from 12.0 to 12.1. Using the option WITHOUT_SYSTEM_COMPILER did the trick for me.