Re: option DEBUG in sparc64 kernel

2015-11-26 Thread Stuart Henderson
On 2015-11-24, Fred  wrote:
> Hi Misc@
>
> I'm trying to build a debug kernel for sparc64 but keep getting the 
> following errors in iommu.c:

You wouldn't normally define DEBUG for everything, just for the
particular files/areas you're interested in (and in many cases they're
called "_DEBUG" rather than just "DEBUG").

Are you just after a kernel with debug symbols? If so, that's done with
makeoptions DEBUG="-g" in kernel config. Otherwise target the particular
area, it's usually simplest to edit the relevant source files.

If you are actually wanting to debug iommu, the DPRINTF format strings
will need fixing up, I expect they haven't been built this way since at
least the time_t/off_t changes.

> ../../../../arch/sparc64/dev/iommu.c:569: warning: format '%lx' expects 
> type 'long unsigned int', but argument 4 has type 'time_t'
> ../../../../arch/sparc64/dev/iommu.c:569: warning: format '%lx' expects 
> type 'long unsigned int', but argument 6 has type 'time_t'

%llx

> ../../../../arch/sparc64/dev/iommu.c: In function 'iommu_dvmamap_load_raw':
> ../../../../arch/sparc64/dev/iommu.c:1020: warning: format '%ld' expects 
> type 'long int', but argument 5 has type 'int'

%d

> ../../../../arch/sparc64/dev/iommu.c:1020: warning: format '%lx' expects 
> type 'long unsigned int', but argument 6 has type 'int'

%x

> expects type 'long long unsigned int', but argument 2 has type 'bus_addr_t'
> ../../../../arch/sparc64/dev/iommu.c:1352: warning: format '%llx' 

%lx

> expects type 'long long unsigned int', but argument 2 has type 'bus_size_t'
> ../../../../arch/sparc64/dev/iommu.c:1360: warning: format '%llx' 

%lx

etc.



option DEBUG in sparc64 kernel

2015-11-24 Thread Fred

Hi Misc@

I'm trying to build a debug kernel for sparc64 but keep getting the 
following errors in iommu.c:


cc  -Werror -Wall -Wimplicit-function-declaration  -Wno-main 
-Wno-uninitialized  -Wframe-larger-than=2047 -Wa,-Av9b, -mno-fpu 
-fno-builtin-printf -fno-builtin-snprintf  -fno-builtin-vsnprintf 
-fno-builtin-log  -fno-builtin-log2 -fno-builtin-malloc -fno-pie -O2 
-pipe -nostdinc -I../../../.. -I. -I../../../../arch -DDDB -DDIAGNOSTIC 
-DKTRACE -DACCOUNTING -DKMEMSTATS -DPTRACE -DPOOL_DEBUG -DCRYPTO 
-DSYSVMSG -DSYSVSEM -DSYSVSHM -DUVM_SWAP_ENCRYPT -DFFS -DFFS2 
-DFFS_SOFTUPDATES -DUFS_DIRHASH -DQUOTA -DEXT2FS -DMFS -DNFSCLIENT 
-DNFSSERVER -DCD9660 -DUDF -DMSDOSFS -DFIFO -DTMPFS -DFUSE 
-DSOCKET_SPLICE -DTCP_SACK -DTCP_ECN -DTCP_SIGNATURE -DINET6 -DIPSEC 
-DPPP_BSDCOMP -DPPP_DEFLATE -DPIPEX -DMROUTING -DMPLS -DBOOT_CONFIG 
-DSUN4US -DSUN4V -DPCIVERBOSE -DUSER_PCICONF -DAPERTURE -DUSBVERBOSE 
-DWSEMUL_SUN -DWSEMUL_NO_VT100 -DWSEMUL_DUMB -DWSDISPLAY_COMPAT_RAWKBD 
-DDEBUG -DONEWIREVERBOSE -DMAXUSERS=64 -D_KERNEL -MD -MP  -c 
../../../../arch/sparc64/dev/iommu.c

cc1: warnings being treated as errors
../../../../arch/sparc64/dev/iommu.c: In function 'iommu_strbuf_flush_done':
../../../../arch/sparc64/dev/iommu.c:569: warning: format '%lx' expects 
type 'long unsigned int', but argument 4 has type 'time_t'
../../../../arch/sparc64/dev/iommu.c:569: warning: format '%lx' expects 
type 'long unsigned int', but argument 6 has type 'time_t'

../../../../arch/sparc64/dev/iommu.c: In function 'iommu_dvmamap_load_raw':
../../../../arch/sparc64/dev/iommu.c:1020: warning: format '%ld' expects 
type 'long int', but argument 5 has type 'int'
../../../../arch/sparc64/dev/iommu.c:1020: warning: format '%lx' expects 
type 'long unsigned int', but argument 6 has type 'int'
../../../../arch/sparc64/dev/iommu.c:1020: warning: format '%ld' expects 
type 'long int', but argument 7 has type 'int'
../../../../arch/sparc64/dev/iommu.c: In function 
'iommu_dvmamap_validate_map':
../../../../arch/sparc64/dev/iommu.c:1347: warning: format '%llx' 
expects type 'long long unsigned int', but argument 2 has type 'bus_addr_t'
../../../../arch/sparc64/dev/iommu.c:1352: warning: format '%llx' 
expects type 'long long unsigned int', but argument 2 has type 'bus_size_t'
../../../../arch/sparc64/dev/iommu.c:1360: warning: format '%llx' 
expects type 'long long unsigned int', but argument 2 has type 'bus_addr_t'
../../../../arch/sparc64/dev/iommu.c:1360: warning: format '%llx' 
expects type 'long long unsigned int', but argument 3 has type 'bus_size_t'
../../../../arch/sparc64/dev/iommu.c:1371: warning: format '%llx' 
expects type 'long long unsigned int', but argument 3 has type 'bus_addr_t'
../../../../arch/sparc64/dev/iommu.c:1371: warning: format '%llx' 
expects type 'long long unsigned int', but argument 4 has type 'bus_size_t'
../../../../arch/sparc64/dev/iommu.c:1371: warning: format '%llx' 
expects type 'long long unsigned int', but argument 5 has type 'bus_addr_t'
../../../../arch/sparc64/dev/iommu.c:1371: warning: format '%llx' 
expects type 'long long unsigned int', but argument 6 has type 'bus_size_t'
../../../../arch/sparc64/dev/iommu.c:1382: warning: format '%llx' 
expects type 'long long unsigned int', but argument 3 has type 'bus_addr_t'
../../../../arch/sparc64/dev/iommu.c:1382: warning: format '%llx' 
expects type 'long long unsigned int', but argument 4 has type 'bus_size_t'
../../../../arch/sparc64/dev/iommu.c:1382: warning: format '%llx' 
expects type 'long long unsigned int', but argument 5 has type 'bus_addr_t'
../../../../arch/sparc64/dev/iommu.c:1382: warning: format '%llx' 
expects type 'long long unsigned int', but argument 6 has type 'bus_size_t'
*** Error 1 in /usr/src/sys/arch/sparc64/compile/psycho (Makefile:837 
'iommu.o'


What's the best approach for dealing with these warnings, in order  to 
build a debug kernel?


thanks

Fred