Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2003 03:21:13 +0000 (GMT)
From:      =?iso-8859-1?q?RMH?= <rmhlldr@yahoo.co.uk>
To:        current@freebsd.org
Subject:   buildkernel and gcc2
Message-ID:  <20030320032113.71826.qmail@web21504.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hello gentlemen,

I have to note that currently it isn't really possible to compile
-CURRENT by GCC 2.95.x in the way it has to be. Buildkernel is
broken in several places by different means, however GCC 3.2.x
passes them successfully, even with no warnings shown.

Namely, first problem is in bsd.kern.mk, because of compiler flag
-mno-align-long-strings, which is not supported by 2.95.x. Should
be autodetected.

Second problem is periods in two macros of sys/eventhandler.h,
that broke depend:

#define EVENTHANDLER_FAST_INVOKE(name, ...)
#define EVENTHANDLER_INVOKE(name, ...)

Might be fixed in the way like:

#define EVENTHANDLER_FAST_INVOKE(name)	
#define EVENTHANDLER_INVOKE(name, arg1, arg2, arg3)

This quick hack will help to pass depend, but unfortunately fail
later. Note that EVENTHANDLER_INVOKE is called with either 2 or
4 arguments from different places, so this should be taken into
account and fixed:

../../../kern/kern_shutdown.c:260: macro `EVENTHANDLER_INVOKE' used
 with only 2 args
../../../kern/kern_shutdown.c:360: macro `EVENTHANDLER_INVOKE' used
 with only 2 args
../../../kern/kern_shutdown.c:367: macro `EVENTHANDLER_INVOKE' used
 with only 2 args
../../../kern/subr_power.c:105: macro `EVENTHANDLER_INVOKE' used
 with only 2 args
../../../vm/vm_pageout.c:687: macro `EVENTHANDLER_INVOKE' used
 with only 2 args

NULL arguments may be added.

Third problem is in asm code of i386 loader:

gcc -c -x assembler-with-cpp -DLOCORE -O2 -pipe -march=pentiumpro -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Winline -Wcast-qual -fformat-extensions -ansi  -nostdinc -I- 
-I. -I../../.. -I../../../dev -I../../../contrib/dev/acpica
-I../../../contrib/ipfilter -D_KERNEL -include opt_global.h -fno-common
-mpreferred-stack-boundary=2 -ffreestanding -Werror ../../../i386/i386/locore.s
{standard input}: Assembler messages:
{standard input}:1752: Warning: rest of line ignored; first ignored character
is `t'
{standard input}:1754: Error: unknown pseudo-op: `.'
{standard input}:1877: Error: missing ')'
{standard input}:1877: Error: missing ')'
{standard input}:1877: Error: junk `tmpstk)- 0xc0000000)' after expression
*** Error code 1

Not funny.

[...]
1752: 	.globl	. tmpstk  
1753:	.space	0x2000			 
1754:. tmpstk  :
[...]
1877:	movl	$(( . tmpstk   )- 0xc0000000 ) ,%esp
[...]

Instead of:
[...]
1752: 	.globl	.tmpstk  
1753:	.space	0x2000			 
1754:.tmpstk:
[...]
1877:	movl	$(( .tmpstk   )- 0xc0000000 ) ,%esp
[...]

Fourth; isn't critical, but has to be fixed too:

../../../dev/drm/mga_dma.c: In function `mga_do_init_dma':
../../../dev/drm/mga_dma.c:522: syntax error before `)'
../../../dev/drm/mga_dma.c:532: syntax error before `)'
../../../dev/drm/mga_dma.c:540: syntax error before `)'
../../../dev/drm/mga_dma.c:548: syntax error before `)'
../../../dev/drm/mga_dma.c:556: syntax error before `)'
../../../dev/drm/mga_dma.c:564: syntax error before `)'
../../../dev/drm/mga_dma.c:572: syntax error before `)'
../../../dev/drm/mga_dma.c:590: syntax error before `)'
../../../dev/drm/mga_dma.c:599: syntax error before `)'
../../../dev/drm/mga_dma.c:608: syntax error before `)'
../../../dev/drm/mga_dma.c:656: syntax error before `)'
../../../dev/drm/drm_context.h: In function `mga_context_switch':
../../../dev/drm/drm_context.h:239: syntax error before `)'
../../../dev/drm/drm_context.h: In function `mga_context_switch_complete':
../../../dev/drm/drm_context.h:270: syntax error before `)'
../../../dev/drm/drm_drv.h: In function `mga_init':
../../../dev/drm/drm_drv.h:782: syntax error before `)'
../../../dev/drm/drm_drv.h:806: syntax error before `)'
../../../dev/drm/drm_drv.h: In function `mga_unlock':
../../../dev/drm/drm_drv.h:1407: syntax error before `)'
*** Error code 1

Broken macro DRM_ERROR. As for now, it's safe to just comment it out.

Fifth; these have probably nothing to do with a particular compiler,
just bugs.

cc1: warnings being treated as errors
../../../dev/pci/pci.c: In function `pci_delete_resource':
../../../dev/pci/pci.c:1341: warning: implicit declaration of function
`rman_get_device'
../../../dev/pci/pci.c:1341: warning: comparison between pointer and integer

--- pci.c.old   Wed Feb 19 07:47:09 2003
+++ pci.c       Tue Mar 19 18:42:41 2003
@@ -1338,7 +1338,7 @@
        rle = resource_list_find(rl, type, rid);
        if (rle) {
                if (rle->res) {
-                       if (rman_get_device(rle->res) != dev ||
+                       if (rle->res->r_dev != dev ||
                            rman_get_flags(rle->res) & RF_ACTIVE) {
                                device_printf(dev, "delete_resource: "
                                    "Resource still owned by child, oops. "

../../../dev/pci/pci_user.c:81: `MAJOR_AUTO' undeclared here (not in a
function)
../../../dev/pci/pci_user.c:81: initializer element is not constant
../../../dev/pci/pci_user.c:81: (near initialization for `pcicdev.d_maj')
../../../dev/pci/pci_user.c:82: initializer element is not constant
../../../dev/pci/pci_user.c:82: (near initialization for `pcicdev')
*** Error code 1

A quick hack, #define MAJOR_AUTO 78

cc1: warnings being treated as errors
../../../dev/sound/pcm/buffer.c: In function `sndbuf_acquire':
../../../dev/sound/pcm/buffer.c:461: warning: implicit declaration of function
`MIN'
*** Error code 1
cc1: warnings being treated as errors
../../../dev/sound/pcm/channel.c: In function `chn_dmaupdate':
../../../dev/sound/pcm/channel.c:166: warning: implicit declaration of function
`MIN'
*** Error code 1

#define MIN(x, y) (((x) < (y))? (x) : (y))

../../../fs/devfs/devfs_vnops.c: In function `devfs_lookupx':
../../../fs/devfs/devfs_vnops.c:374: `__VA_ARGS__' undeclared (first use in
this function)
../../../fs/devfs/devfs_vnops.c:374: (Each undeclared identifier is reported
only once
../../../fs/devfs/devfs_vnops.c:374: for each function it appears in.)
../../../fs/devfs/devfs_vnops.c:374: too few arguments to function
*** Error code 1

Follows problem #2: __VA_ARGS__ should be defined, NULL as a
temporary workaround, but "too few arguments" breaks it all.

cc1: warnings being treated as errors
../../../dev/syscons/syscons.c:1469: conflicting types for `sccnputc'
../../../dev/syscons/syscons.c:197: previous declaration of `sccnputc'
../../../dev/syscons/syscons.c:1511: conflicting types for `sccngetc'
../../../dev/syscons/syscons.c:195: previous declaration of `sccngetc'
../../../dev/syscons/syscons.c:1517: conflicting types for `sccncheckc'
../../../dev/syscons/syscons.c:196: previous declaration of `sccncheckc'
../../../dev/syscons/syscons.c:1523: conflicting types for `sccndbctl'
../../../dev/syscons/syscons.c:198: previous declaration of `sccndbctl'
../../../dev/syscons/syscons.c:3369: conflicting types for `scmmap'
../../../dev/syscons/syscons.c:212: previous declaration of `scmmap'
../../../dev/syscons/syscons.c: In function `scmmap':
../../../dev/syscons/syscons.c:3375: warning: passing arg 3 of pointer to
function makes integer from pointer without a cast
../../../dev/syscons/syscons.c:3375: too many arguments to function
*** Error code 1
../../../dev/sio/sio.c: In function `sioinput':
../../../dev/sio/sio.c:1591: `tk_nin' undeclared (first use in this function)
../../../dev/sio/sio.c:1591: (Each undeclared identifier is reported only once
../../../dev/sio/sio.c:1591: for each function it appears in.)
../../../dev/sio/sio.c:1592: `tk_rawcc' undeclared (first use in this function)
../../../dev/sio/sio.c: At top level:
../../../dev/sio/sio.c:3136: conflicting types for `siocncheckc'
../../../dev/sio/sio.c:2769: previous declaration of `siocncheckc'
../../../dev/sio/sio.c:3166: conflicting types for `siocngetc'
../../../dev/sio/sio.c:2770: previous declaration of `siocngetc'
../../../dev/sio/sio.c:3194: conflicting types for `siocnputc'
../../../dev/sio/sio.c:2771: previous declaration of `siocnputc'
*** Error code 1

Ugh... Seem to be just broken. Though they may be already fixed.

Sixth; 3.2.x passes this, but 2.95.x fails.

cc1: warnings being treated as errors
../../../geom/geom_bsd.c: In function `g_bsd_dumpconf':
../../../geom/geom_bsd.c:688: warning: unknown conversion type character `j' in
format
../../../geom/geom_bsd.c:690: warning: unknown conversion type character `j' in
format
../../../geom/geom_bsd.c:692: warning: unknown conversion type character `j' in
format
../../../geom/geom_dump.c: In function `g_conftxt_geom':
../../../geom/geom_dump.c:128: warning: unknown conversion type character `j'
in format
../../../geom/geom_dump.c:128: warning: unsigned int format, different type arg
(arg 6)
../../../geom/geom_dump.c: In function `g_conf_provider':
../../../geom/geom_dump.c:192: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c: In function `g_slice_dumpconf':
../../../geom/geom_slice.c:271: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:276: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:281: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:283: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:285: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:287: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c: In function `g_slice_config':
../../../geom/geom_slice.c:340: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:340: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:340: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:352: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:352: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:352: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c: In function `g_slice_conf_hot':
../../../geom/geom_slice.c:386: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:386: warning: unknown conversion type character `j'
in format
../../../geom/geom_slice.c:386: warning: unknown conversion type character `j'
in format
../../../geom/geom_subr.c: In function `g_handleattr':
../../../geom/geom_subr.c:473: warning: unknown conversion type character `j'
in format
../../../geom/geom_subr.c:473: warning: int format, different type arg (arg 2)
../../../kern/subr_disk.c: In function `disk_err':
../../../kern/subr_disk.c:469: warning: unknown conversion type character `j'
in format
../../../kern/subr_disk.c:469: warning: format argument is not a pointer (arg
2)
../../../kern/subr_disk.c:474: warning: unknown conversion type character `j'
in format
../../../kern/subr_disk.c:477: warning: unknown conversion type character `j'
in format
../../../kern/subr_disk.c:477: warning: unknown conversion type character `j'
in format
../../../kern/vfs_bio.c: In function `bufdone':
../../../kern/vfs_bio.c:3119: warning: unknown conversion type character `j' in
format
../../../kern/vfs_bio.c:3119: warning: long unsigned int format, different type
arg (arg 3)
../../../kern/vfs_bio.c:3119: warning: int format, long int arg (arg 4)
../../../kern/vfs_bio.c:3123: warning: unknown conversion type character `j' in
format
../../../kern/vfs_bio.c:3123: warning: long unsigned int format, different type
arg (arg 2)
../../../kern/vfs_bio.c:3123: warning: int format, long int arg (arg 3)
../../../kern/vfs_bio.c: In function `vm_hold_free_pages':
../../../kern/vfs_bio.c:3514: warning: unknown conversion type character `j' in
format
../../../kern/vfs_bio.c:3514: warning: unknown conversion type character `j' in
format
[...]

Please replace those j's for something more appropriate; I've
just removed them. Accompanying typedefs uintmax_t\intmax_t
were replaced with u_int\int. 

Finally, this set of hacks was linked and even booted up :)
Besides, the same kernel with the same optimisation flags but
compiled with GCC 3.2.1 takes 400K more.

Summary. Since I have no write access to CVS repository, hope
someone who has will consider things noted above and commit
changes. I shall be appreciated for some help to set
sys/eventhandler.h properly, to avoid screwing up certain things.

Thank you for reading!

---
Regards,
 Rhett


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030320032113.71826.qmail>