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

Bug #1798007 reported by Po-Hsu Lin on 2018-10-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Undecided
Khaled El Mously

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

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) on 2018-11-06
Changed in ubuntu-kernel-tests:
status: New → Confirmed
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) on 2019-07-09
tags: added: ubuntu-kvm-unit-tests
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)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers