Skip to contentSkip to conversation

the address of 'symbols_addresses' will always evaluate as 'true'

PATCH In review S.Çağlar Onur 2 participants 3 messages Jan 10, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 the address of 'symbols_addresses' will always evaluate as 'true'

Hi;

Attached patch adds "-Wno-always-true" CFLAGS into xen/arch/powerpc/Rules.mk and xen/arch/x86/Rules.mk, else compiling xen with latest gcc-4.2.0 snapshot fails, patch is against current xen-3.0.4-testing repo;

make[3]: Entering directory
`/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/common'
gcc -O2 -fomit-frame-pointer -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -iwithprefix
include -Werror -Wno-pointer-arith -pipe -I/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/include -I/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/include/asm-x86/mach-generic -I/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/include/asm-x86/mach-default -msoft-float -fno-stack-protector -g -D__XEN__ -c symbols.c -o symbols.o
cc1: warnings being treated as errors
symbols.c: In function 'symbols_lookup':
symbols.c:97: warning: the address of 'symbols_addresses' will always evaluate
as 'true'
make[3]: *** [symbols.o] Error 1
make[3]: Leaving directory
`/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/common'
make[2]: ***
[/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/common/built_in.o]
Error 2
make[2]: Leaving directory
`/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/arch/x86'
make[1]: *** [/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen/xen] Error
2
make[1]: Leaving directory
`/var/pisi/xen-3.0.4.1-3/work/xen-3.0.4-testing.hg/xen'
make: *** [build] Error 2

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
xen/arch/powerpc/Rules.mk +1 -1
diff -r c32abbaccdac xen/arch/powerpc/Rules.mk
@@ -12,7 +12,7 @@ C_WARNINGS :=
 # C_WARNINGS += -Wpacked
 
 CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common -fno-strict-aliasing
-CFLAGS += -iwithprefix include -Wall -Werror -pipe
+CFLAGS += -iwithprefix include -Wall -Wno-always-true -Werror -pipe
 CFLAGS += -I$(BASEDIR)/include
 CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-generic
 CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-default
xen/arch/x86/Rules.mk +1 -1
diff -r c32abbaccdac xen/arch/x86/Rules.mk
@@ -18,7 +18,7 @@ endif
 endif
 
 CFLAGS += -fno-builtin -fno-common -fno-strict-aliasing
-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
+CFLAGS += -iwithprefix include -Wno-always-true -Werror -Wno-pointer-arith -pipe
 CFLAGS += -I$(BASEDIR)/include 
 CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
 CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · S.Çağlar Onur

Attached patch adds "-Wno-always-true" CFLAGS into xen/arch/powerpc/Rules.mk and xen/arch/x86/Rules.mk, else compiling xen with latest gcc-4.2.0 snapshot fails, patch is against current xen-3.0.4-testing repo;

If that is the *only* build error, then we can just get rid of that BUG_ON(). It doesn't work any more anyway (that symbol is never zero, even during initial kernel link when no symbol info is available). BUG_ON(symbols_num_syms == 0) is probably the right replacement.

-- Keir

#2 lore raw

10 Oca 2007 Çar 12:31 tarihinde, Keir Fraser şunları yazmıştı:

Quoted 4 lines

If that is the *only* build error, then we can just get rid of that BUG_ON(). It doesn't work any more anyway (that symbol is never zero, even during initial kernel link when no symbol info is available). BUG_ON(symbols_num_syms == 0) is probably the right replacement.

Yes this is the only build error so modified patch attached, tested on x86.

Chers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
xen/common/symbols.c +1 -1
diff -r c32abbaccdac xen/common/symbols.c
@@ -94,7 +94,7 @@ const char *symbols_lookup(unsigned long
     unsigned long symbol_end = 0;
 
     /* This kernel should never had been booted. */
-    BUG_ON(!symbols_addresses);
+    BUG_ON(symbols_num_syms == 0);
 
     namebuf[KSYM_NAME_LEN] = 0;
     namebuf[0] = 0;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel