Skip to contentSkip to conversation

ltp: Remove -mfpmath=sse on x86

PATCH In review Khem Raj 3 participants 4 messages Jul 7, 2022 1 message not in the archive

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 ltp: Remove -mfpmath=sse on x86

Fixes build errors seen with clang
error: the 'sse' unit is not supported with this instruction set

---
 meta/recipes-extended/ltp/ltp_20220527.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/ltp/ltp_20220527.bb +1 -0
index b3ef8f59105..034b62b321e 100644
@@ -19,6 +19,7 @@ EXTRA_OECONF:append:libc-musl = " LIBS=-lfts "
 # is set to -O0 or frame pointers have been enabled by -fno-omit-frame-pointer
 # earlier in CFLAGS, etc.
 CFLAGS:append:x86-64 = " -fomit-frame-pointer"
+TUNE_CCARGS:remove:x86 = "-mfpmath=sse"
 
 CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__"
 CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
Signature · 1 line
2.37.0
#1 lore raw
Quoted 13 lines · Khem Raj

Fixes build errors seen with clang
error: the 'sse' unit is not supported with this instruction set

---
 meta/recipes-extended/ltp/ltp_20220527.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/ltp/ltp_20220527.bb +0 -0
index b3ef8f59105..034b62b321e 100644

meta/recipes-extended/ltp/ltp_20220527.bb EXTRA_OECONF:append:libc-musl = " LIBS=-lfts " · line 25

Quoted 7 lines
meta/recipes-extended/ltp/ltp_20220527.bb +1 -0
@@ -19,6 +19,7 @@ EXTRA_OECONF:append:libc-musl = " LIBS=-lfts "
 # is set to -O0 or frame pointers have been enabled by -fno-omit-frame-pointer
 # earlier in CFLAGS, etc.
 CFLAGS:append:x86-64 = " -fomit-frame-pointer"
+TUNE_CCARGS:remove:x86 = "-mfpmath=sse"
 
 CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__"
 CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"

I really don't like remove operations in OE-Core. If it is incompatible, why is it there in the first place? Does that need to be clang only?

Cheers,

Richard

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#3 lore raw

There are some tests in ltp where it conflicts especially for tunes used in qemux86, the test adds -mno-sse which does nullify -msse3 but does not nullify -mfpmath=sse and clang is pedantic about it whereas gcc just warns

here is ltp cmd

cd tmp/work/core2-32-yoe-linux/ltp/20220527-r0/git/testcases/kernel/kvm

% ../../../../recipe-sysroot-native/usr/bin/i686-yoe-linux/i686-yoe-linux-clang
-target i686-yoe-linux -m32 -march=core2 -mtune=core2 -msse3
-mfpmath=sse -mlittle-endian --dyld-prefix=/usr -Qunused-arguments
-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0=/usr/src/debug/ltp/20220527-r0 -fdebug-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0=/usr/src/debug/ltp/20220527-r0 -fdebug-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/recipe-sysroot= -fdebug-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/recipe-sysroot-native= -Wl,-z,relro,-z,now -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security --sysroot=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/recipe-sysroot -I/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/git/testcases/kernel/kvm/include -DCOMPILE_PAYLOAD -ffreestanding -O2 -Wall
-fno-asynchronous-unwind-tables -mno-mmx -mno-sse -fno-pie -c -o
lib_guest.o lib_guest.c

here is a reduced case

% gcc -m32 -msse3 -mfpmath=sse -xc /dev/null -c -mno-sse
cc1: warning: SSE instruction set disabled, using 387 arithmetics [kraj@apollo /tmp]
% clang -m32 -msse3 -mfpmath=sse -xc /dev/null -c -mno-sse
error: the 'sse' unit is not supported with this instruction set

Quoted 62 lines · Khem Raj
Quoted 19 lines · Richard Purdie
Quoted 18 lines · Khem Raj

Fixes build errors seen with clang
error: the 'sse' unit is not supported with this instruction set

---
  meta/recipes-extended/ltp/ltp_20220527.bb | 1 +
  1 file changed, 1 insertion(+)
meta/recipes-extended/ltp/ltp_20220527.bb +1 -0
index b3ef8f59105..034b62b321e 100644
@@ -19,6 +19,7 @@ EXTRA_OECONF:append:libc-musl = " LIBS=-lfts "
  # is set to -O0 or frame pointers have been enabled by -fno-omit-frame-pointer
  # earlier in CFLAGS, etc.
  CFLAGS:append:x86-64 = " -fomit-frame-pointer"
+TUNE_CCARGS:remove:x86 = "-mfpmath=sse"
 
Quoted 6 lines

meta/recipes-extended/ltp/ltp_20220527.bb EXTRA_OECONF:append:libc-musl = " LIBS=-lfts " · line 25

Quoted 2 lines
meta/recipes-extended/ltp/ltp_20220527.bb +0 -0
  CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__"
  CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"

I really don't like remove operations in OE-Core. If it is incompatible, why is it there in the first place? Does that need to be clang only?

There are some tests in ltp where it conflicts especially for tunes used in qemux86, the test adds -mno-sse which does nullify -msse3 not nullify -mfpmath=sse

cd tmp/work/core2-32-yoe-linux/ltp/20220527-r0/git/testcases/kernel/kvm

% ../../../../recipe-sysroot-native/usr/bin/i686-yoe-linux/i686-yoe-linux-clang

(quoted diff) +0 -12
-target i686-yoe-linux  -m32 -march=core2 -mtune=core2 -msse3
-mfpmath=sse -mlittle-endian --dyld-prefix=/usr -Qunused-arguments
-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
-fmacro-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0=/usr/src/debug/ltp/20220527-r0
 
-fdebug-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0=/usr/src/debug/ltp/20220527-r0
 
-fdebug-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/recipe-sysroot=
 
-fdebug-prefix-map=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/recipe-sysroot-native=
  -Wl,-z,relro,-z,now     -O2 -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
--sysroot=/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/recipe-sysroot
-I/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/ltp/20220527-r0/git/testcases/kernel/kvm/include
-DCOMPILE_PAYLOAD -ffreestanding -O2 -Wall
-fno-asynchronous-unwind-tables -mno-mmx -mno-sse -fno-pie -c -o

lib_guest.o lib_guest.c

Quoted 5 lines

Cheers,

Richard

#4 lore raw
Quoted 5 lines · Khem Raj via lists.openembedded.org

% gcc -m32 -msse3 -mfpmath=sse -xc /dev/null -c -mno-sse
cc1: warning: SSE instruction set disabled, using 387 arithmetics [kraj@apollo /tmp]
% clang -m32 -msse3 -mfpmath=sse -xc /dev/null -c -mno-sse
error: the 'sse' unit is not supported with this instruction set

So I just built ltp for qemux86-64 on my aarch64 host:

| cc1: warning: SSE instruction set disabled, using 387 arithmetics
| cc1: warning: SSE instruction set disabled, using 387 arithmetics
| AS testcases/kernel/kvm/bootstrap_x86_64.o
| make[5]: Nothing to be done for 'all'.
| make[5]: Nothing to be done for 'all'.
| CC testcases/kernel/kvm/lib_x86.o
| CC testcases/kernel/kvm/lib_guest.o
| cc1: warning: SSE instruction set disabled, using 387 arithmetics
| ld: target elf64-x86-64 not found

Looks like it’s also trying to use the host ld?

Ross
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.