Unable to build kvm-unit-test for X/T i386

Bug #1798007 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Fix Released
Undecided
Po-Hsu Lin

Bug Description

When compiling from the upstream source code, it will fail with: unrecognized command line option "-Wno-frame-address" [-Werror]

x86/cmpxchg8b.o x86/cstart.o lib/libcflat.a /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a
objcopy -O elf32-i386 x86/cmpxchg8b.elf x86/cmpxchg8b.flat
g++ -m32 -O1 -g -MMD -MF api/.api-sample.d -Wall -Wwrite-strings -Wclobbered -Wempty-body -Wuninitialized -Wignored-qualifiers -Wunused-but-set-parameter -Wmissing-prototypes -Wstrict-prototypes -Werror -fno-omit-frame-pointer -Wno-frame-address -fno-pic -m32 -std=gnu++11 -c -o api/api-sample.o api/api-sample.cc
stderr:
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: error: unrecognized command line option "-Wno-frame-address" [-Werror]
cc1plus: all warnings being treated as errors
make: *** [api/api-sample.o] Error 1

Complete error log here: http://10.246.72.4/test-results/3.13.0-161.211-generic/pepe__3.13.0-161.211__2018-10-04_18-03-00/ubuntu_kvm_unit_tests/results/ubuntu_kvm_unit_tests.setup/debug/ubuntu_kvm_unit_tests.setup.DEBUG.html

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Can't build this test on Xenial i386 as well.

summary: - Unable to build kvm-unit-test for Trusty i386
+ Unable to build kvm-unit-test for X/T i386
tags: added: i386 trusty xenial
Po-Hsu Lin (cypressyew)
Changed in ubuntu-kernel-tests:
status: New → Confirmed
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Solution is here:
commit 29ff4881e498192118065dbc722e7302df740f6d
Author: Paolo Bonzini <email address hidden>
Date: Tue Oct 25 15:26:43 2016 +0200

    autodetect -Wno-frame-address

    Not all targets have -Wframe-address, and those that don't will
    report an error if -Wno-frame-address is passed (because of -Werror).
    So autodetect it.

diff --git a/Makefile b/Makefile
index 0ffe234..5201472 100644
--- a/Makefile
+++ b/Makefile
@@ -45,14 +45,16 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)

 CFLAGS += -g
-CFLAGS += $(autodepend-flags) -Wall -Werror -Wno-frame-address
+CFLAGS += $(autodepend-flags) -Wall -Werror
 frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer
 fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
 fnostack_protector := $(call cc-option, -fno-stack-protector, "")
 fnostack_protector_all := $(call cc-option, -fno-stack-protector-all, "")
+wno_frame_address := $(call cc-option, -Wno-frame-address, "")
 CFLAGS += $(fomit_frame_pointer)
 CFLAGS += $(fno_stack_protector)
 CFLAGS += $(fno_stack_protector_all)
+CFLAGS += $(wno_frame_address)

 CXXFLAGS += $(CFLAGS)

Po-Hsu Lin (cypressyew)
tags: added: ubuntu-kvm-unit-tests
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hmm, the commit above is quite old and we already have it.

It must be something else.

Changed in ubuntu-kernel-tests:
assignee: nobody → Khaled El Mously (kmously)
Revision history for this message
Kelsey Steele (kelsey-steele) wrote :

Still seeing on Xenial lowlatency i386 4.4.0-204.236

tags: added: 4.4 sru-20210222
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Testing with the Hirsute branch and it's still failing.

https://kernel.ubuntu.com/git/ubuntu/kvm-unit-tests/log/?h=hirsute

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Error log on Xenial 4.4 i386

$ sudo make
gcc -mno-sse -mno-sse2 -m32 -O1 -g -MMD -MF lib/.argv.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Werror -fno-omit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -ffreestanding -I /home/ubuntu/autotest/client/tmp/ubuntu_kvm_unit_tests/src/kvm-unit-tests/lib -I lib -c -o lib/argv.o lib/argv.c
gcc -mno-sse -mno-sse2 -m32 -O1 -g -MMD -MF lib/.printf.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Werror -fno-omit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -ffreestanding -I /home/ubuntu/autotest/client/tmp/ubuntu_kvm_unit_tests/src/kvm-unit-tests/lib -I lib -c -o lib/printf.o lib/printf.c
gcc -mno-sse -mno-sse2 -m32 -O1 -g -MMD -MF lib/.string.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Werror -fno-omit-frame-pointer -fno-stack-protector -Wno-frame-address -fno-pic -no-pie -Wclobbered -Wunused-but-set-parameter -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -ffreestanding -I /home/ubuntu/autotest/client/tmp/ubuntu_kvm_unit_tests/src/kvm-unit-tests/lib -I lib -c -o lib/string.o lib/string.c
In file included from lib/string.c:8:0:
lib/string.c: In function ‘__strtol’:
lib/linux/compiler.h:37:34: error: implicit declaration of function ‘__builtin_add_overflow_p’ [-Werror=implicit-function-declaration]
 #define check_mul_overflow(a, b) __builtin_add_overflow_p(a, b, (typeof((a) * (b)))0)
                                  ^
lib/libcflat.h:126:8: note: in definition of macro ‘assert’
  if (!(cond)) { \
        ^
lib/string.c:215:21: note: in expansion of macro ‘check_mul_overflow’
             assert(!check_mul_overflow(sacc, base));
                     ^
lib/string.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-frame-address’ [-Werror]
cc1: all warnings being treated as errors
<builtin>: recipe for target 'lib/string.o' failed
make: *** [lib/string.o] Error 1

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Changed in ubuntu-kernel-tests:
status: Confirmed → In Progress
assignee: Khaled El Mously (kmously) → Po-Hsu Lin (cypressyew)
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

The test can be executed after kvm-unit-test repo update.

Changed in ubuntu-kernel-tests:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.