Bug #2737
closedi386 drm_bufs.c:259:2 '%lx' offset type 'resource_size_t'
0%
Description
i386 GENERIC kernel compilation fails with
/usr/src/sys/dev/drm/drm/../drm_bufs.c: In function 'drm_addmap':
/usr/src/sys/dev/drm/drm/../drm_bufs.c:259:2: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'resource_size_t' [-Werror=format]
cc1: all warnings being treated as errors
Argument offset is type resource_size_t which appears to be vm_paddr_t and thus __unit64_t.
A patch similar to the below fixes compilation problems on i386:
diff --git a/sys/dev/drm/drm_bufs.c b/sys/dev/drm/drm_bufs.c
index 575dbcf..7c66ea8 100644
--- a/sys/dev/drm/drm_bufs.c
+++ b/sys/dev/drm/drm_bufs.c@ -256,7 +256,7
@ int drm_addmap(struct drm_device * dev, resource_size_t offset,
done:
/* Jumped to, with lock held, when a kernel map is found. */
- DRM_DEBUG("Added map %d 0x%lx/0x%lx\n", map->type, map->offset,
+ DRM_DEBUG("Added map %d 0x%lx/0x%lx\n", map->type, (unsigned long)map->offset,
map->size);
*map_ptr = map;
Updated by davshao about 10 years ago
movl PCPU,%ecx
in sys/platform/pc32/i386/support.s also gives a compilation error building kernel:
cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wold-style-definition -Wno-inline -Wno-pointer-sign -Winit-self -std=c99 -Wno-unused-but-set-variable -g -nostdinc -I. -Iinclude -I/usr/src/sys -I/usr/src/sys/../include -I/usr/obj/usr/src/sys/GENERIC -I"/usr/src/sys/dev/acpica" -I"/usr/src/sys/contrib/dev/acpica/source/include" -I/usr/src/sys/dev/netif/ath/ath_hal -I/usr/src/sys/contrib/dev/ath/ath_hal -I/usr/src/sys/dev/drm/include -D_KERNEL -include opt_global.h -Wold-style-declaration -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -ffreestanding -fno-stack-protector -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -mpreferred-stack-boundary=2 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mno-sse4 -mno-sse4a -mno-sse5 -mno-abm -mno-aes -mno-avx -mno-pclmul -mno-popcnt -mno-avx2 -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-fma -mno-fma4 -mno-bmi -mno-bmi2 -mno-xop -mno-lwp -mno-lzcnt -mno-tbm -msoft-float vers.c -Werror
linking kernel.debug
support.o: In function `wrmsr_safe':
/usr/src/sys/platform/pc32/i386/support.s:806: undefined reference to `gd_CURPCB'
- Error code 1
Updated by herrgard about 10 years ago
Are you using drm on i386 or just trying to build?
Updated by profmakx about 10 years ago
Note that as of 4.0 i386 support has been dropped and hence interest in fixes might be low.
Updated by eadler almost 7 years ago
- Status changed from New to Closed
This is limited to i386 which we no longer support. Closing.