Bug#853710: xen: ftbfs with GCC-7
A message that is not in the archive (sent off-list or not yet received): [email protected]
Matthias Klose of the Debian Project reports that the Xen package in Debian stretch, which is based on a snapshot of xen.git#stable-4.8, does not build with GCC-7.
Matthias Klose writes ("Bug#853710: xen: ftbfs with GCC-7"):
Quoted 8 lines
The package fails to build in a test rebuild on at least amd64 with gcc-7/g++-7, but succeeds to build with gcc-6/g++-6. The severity of this report may be raised before the buster release. There is no need to fix this issue in time for the stretch release.
The full build log can be found at:
http://people.debian.org/~doko/logs/gcc7-20170126/xen_4.8.1~pre.2017.01.23-1_unstable_gcc7.log
The last lines of the build log are at the end of this report.
...
Quoted 8 lines
gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O2 -fomit-frame-pointer -nostdinc -fno-builtin -fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__ -include /<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/xen/config.h '-D__OBJECT_FILE__="compat.o"' -Wa,--strip-local-absolute -MMD -MF ./.compat.o.d -I/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include -I/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm-x86/mach-generic -I/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm-x86/mach-default '-D__OBJECT_LABEL__=arch$x86$efi$compat.o' -msoft-float -fno-stack-protector -fno-exceptions -Wnested-externs -DHAVE_GAS_VMX -DHAVE_GAS_SSE4_2 -DHAVE_GAS_EPT -DHAVE_GAS_FSGSBASE -U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM '-D__OBJECT_LABEL__=arch/x86/efi/compat.o' -mno-red-zone -mno-sse -fpic -fno-asynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -fshort-wchar -c
compat.c-o compat.o
In file included from /<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/uaccess.h:12:0,from /<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/guest_access.h:10, from /<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/xen/guest_access.h:10, from compat.c:1: runtime.c: In function 'efi_compat_get_info': /<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/x86_64/uaccess.h:56:37: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] compat_access_ok(addr, (count) * (size)))
I looked at the code and the macros at the root of the message are these:
#define compat_array_access_ok(addr,count,size) \
(likely((count) < (~0U / (size))) && \
compat_access_ok(addr, (count) * (size)))
#define __compat_access_ok(d, addr, size) \
__compat_addr_ok(d, (unsigned long)(addr) + ((size) ? (size) - 1 : 0))This expands to, effectively (and stripping extra parents etc.)
addr + (count*size ? count*size - 1 : 0)
GCC-7 is complaining about count*size (ie, the result of a multiplication) being used as a boolean (ie, for the ?: conditional).
I think the compiler is simply wrong to complain about this. Such idioms must be extremely common.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 64 lines
Quoted 1 line
Quoted 1 line · On 31.01.17 at 13:09, <[email protected]> wrote:
Matthias Klose of the Debian Project reports that the Xen package in Debian stretch, which is based on a snapshot of xen.git#stable-4.8, does not build with GCC-7.
Matthias Klose writes ("Bug#853710: xen: ftbfs with GCC-7"):
Quoted 7 lines
The package fails to build in a test rebuild on at least amd64 with gcc-7/g++-7, but succeeds to build with gcc-6/g++-6. The severity of this report may be raised before the buster release. There is no need to fix this issue in time for the stretch release.
The full build log can be found at:
http://people.debian.org/~doko/logs/gcc7-20170126/xen_4.8.1~pre.2017.01.23-1_
unstable_gcc7.logQuoted 1 line
The last lines of the build log are at the end of this report.
...
Quoted 1 line
gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall
(quoted diff) +0
-4-Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O2 -fomit-frame-pointer -nostdinc -fno-builtin -fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__ -include/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/xen/co
nfig.h'-D__OBJECT_FILE__="compat.o"' -Wa,--strip-local-absolute -MMD -MF ./.compat.o.d(quoted diff) +0
-2-I/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include -I/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm-x86/mach-generic -I/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm- x86/mach-default '-D__OBJECT_LABEL__=arch$x86$efi$compat.o' -msoft-float
(quoted diff) +0
-5-fno-stack-protector -fno-exceptions -Wnested-externs -DHAVE_GAS_VMX -DHAVE_GAS_SSE4_2 -DHAVE_GAS_EPT -DHAVE_GAS_FSGSBASE -U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM '-D__OBJECT_LABEL__=arch/x86/efi/compat.o' -mno-red-zone -mno-sse -fpic -fno-asynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -fshort-wchar -c compat.c -o compat.oQuoted 1 line
In file included from
/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/ua ccess.h:12:0,
Quoted 1 line
from
/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/gu est_access.h:10,
Quoted 1 line
from
/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/xen/gu est_access.h:10,
Quoted 3 lines
from compat.c:1:
runtime.c: In function 'efi_compat_get_info':/<<PKGBUILDDIR>>/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/x86_64 /uaccess.h:56:37: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
Quoted 1 line
compat_access_ok(addr, (count) * (size)))I looked at the code and the macros at the root of the message are these:
#define compat_array_access_ok(addr,count,size) \ (likely((count) < (~0U / (size))) && \ compat_access_ok(addr, (count) * (size))) #define __compat_access_ok(d, addr, size) \ __compat_addr_ok(d, (unsigned long)(addr) + ((size) ? (size) - 1 : 0))This expands to, effectively (and stripping extra parents etc.)
Quoted 7 lines
addr + (count*size ? count*size - 1 : 0)
GCC-7 is complaining about count*size (ie, the result of a multiplication) being used as a boolean (ie, for the ?: conditional).
I think the compiler is simply wrong to complain about this. Such idioms must be extremely common.
Indeed. They should report this against gcc.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel