Re: Kernel breakage in XE module

2002-06-10 Thread Bruce Evans

On Mon, 10 Jun 2002, Julian Elischer wrote:

> the HIDENAME() macro was changed to work with Gcc3.1 (the new compiler)
> but broke it for the old compiler/assembler.

Ugh.  I was surprised that this change worked for any gcc.  The change is
from:

#define HIDENAME(asmsym)__CONCAT(.,asmsym)

to:

#define HIDENAME(asmsym).asmsym

Note that the change isn't for use of CONCAT with "," and "word" lke
its commit message says.  It is for use of __CONCAT with "." and "word".
Here the quotes are to mark up identifiers -- there are no strings
involved.  The problem is that the ISO C concatenation operator "##"
is less useful than might first appear.  It is only required to work
if the result could be a preprocessing token, and the rules for when
the result could be a preprocessing token are quite complicated.  E.g.,
".foo" is not a preprocessing token but ".1" is.  The result of
concatenating "." with "foo" is undefined, and gcc now detects this
error.

Since ".foo" is lexed as separate tokens, there is no need for the
preprocessor to keep the "." and the "foo" separate.  In practice,
previous versions of the preprocessor inserted a space between the
tokens and the current version doesn't.  The current HIDENAME() macro
depends on this implementation detail in the current preprocessor and
is just broken in general.

> back out the definition in i386/include/asmacros.h to what it was before
> (it used to use the CONCAT() macro)
>
> OR
>
> bite the bullet and upgrade to a new -current and get the new compiler.

OR for a quick fix, fixing one of the following related bogons:

(1) For non-profiling kernels, HIDENAME is only used for the tmpstk
variable in locore.s, but there is no need for this variable to be
hidden.  Hiding it mainly broke examining it using ddb before ddb
was fixed to recognize symbols with a "." in their name.
(2) For non-profiling kernels, HIDENAME is only used for the tmpstk
variable in locore.s, but the old macro still works for cpp'ing
assembler sources.  This is why committing gcc-3 didn't break
building of all kernels.

Fixing the following related bogon would have no significant affect:

(3) HIDENAME still has its old definition in at least the i386
.  This is harmless at least on i386's because that
definition is not actually used.

This leaves the problem of fixing the use of HIDENAME in profiling kernels.
Unfortunately, the standard name for "mcount" requires a "." in it for
the ELF case (the ELF case is more broken than the aout case here).  This
problem is avoided for userland profiling using a magic asm in
.  The i386 prof_machdep.c uses HIDENAME to get slightly
less magic asm.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Kernel breakage in XE module

2002-06-10 Thread Dan Nelson

In the last episode (Jun 10), Troy said:
> Dan,
> 
> Thanks for your response.  I just built the gcc31 package, but it doesn't
> appear to replace the 2.95. Can you be a bit more specific on what I
> should do to upgrade the GCC in your last note.

Basically, buildworld.  If you're lucky, just building and installing
/usr/src/gnu/usr.bin/cc might work.

I guess another question would be "should you be able to build a
-current kernel with 2.95.3 anymore"?  It might make upgrades from 4.*
a bit difficult.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Kernel breakage in XE module

2002-06-10 Thread Julian Elischer

the HIDENAME() macro was changed to work with Gcc3.1 (the new compiler)
but broke it for the old compiler/assembler.

back out the definition in i386/include/asmacros.h to what it was before
(it used to use the CONCAT() macro)

OR

bite the bullet and upgrade to a new -current and get the new compiler.


On Mon, 10 Jun 2002, Troy wrote:

> Been trying to buildkernel, and as of about 2 weeks ago something
> happened to the XE module.  Anyone have some ideas?
> 
> -Troy
> 
> ===> xe
> @ -> /usr/src/sys
> machine -> /usr/src/sys/i386/include
> awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
> awk -f @/tools/makeobjops.awk @/dev/pccard/card_if.m -h
> awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
> rm -f .depend
> CC='/usr/bin/cc' mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -I- -I.
> -I@ -I@/dev -I@/../include -I/usr/obj/usr/src/i386/usr/include  /usr/src/sys/mod
> ules/xe/../../dev/xe/if_xe.c /usr/src/sys/modules/xe/../../dev/xe/if_xe_pccard.c
> 
> cd /usr/obj/usr/src/sys/SINDROME;  MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=i386
>  MACHINE=i386  OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec  GROFF_BIN_PATH=
> /usr/obj/usr/src/i386/usr/bin  
>GROFF_FONT_PATH=/usr/obj/usr/src/i386/usr/share/groff_font  
>GROFF_TMAC_PATH=/usr/obj/usr/src/i386/usr/share/tmac  DESTDIR=/usr/obj/usr/src/i386  
>INSTALL="sh /usr/src/tools/install.sh"  
>PATH=/usr/obj/usr/src/i386/usr/sbin:/usr/obj/usr/src/i386/usr/bin:/usr/obj/usr/src/i386/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
>  OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/l
> ibexec make KERNEL=kernel all
> /usr/bin/cc -c -x assembler-with-cpp -DLOCORE -O -pipe  -Wall -Wredundant-decls
> -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winl
> ine -Wcast-qual  -Wno-format -ansi  -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src
> /sys/dev -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/ipfilter -I/us
> r/src/sys/../include  -D_KERNEL -ffreestanding -include opt_global.h -fno-common
>-mpreferred-stack-boundary=2 -ffreestanding  /usr/src/sys/i386/i386/locore.s
> {standard input}: Assembler messages:
> {standard input}:1684: Warning: rest of line ignored; first ignored character is
>  `t'
> {standard input}:1686: Error: unknown pseudo-op: `.'
> {standard input}:1801: Error: missing ')'
> {standard input}:1801: Error: missing ')'
> {standard input}:1801: Error: junk `tmpstk)- 0xc000)' after expression
> *** Error code 1
> 
> Stop in /usr/obj/usr/src/sys/SINDROME.
> *** Error code 1
> 
> Stop in /usr/src.
> *** Error code 1
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-current" in the body of the message
> 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Kernel breakage in XE module

2002-06-10 Thread Dan Nelson

In the last episode (Jun 10), Troy said:
> Been trying to buildkernel, and as of about 2 weeks ago something
> happened to the XE module.  Anyone have some ideas?

Upgrade your gcc in the base system.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Kernel breakage in XE module

2002-06-10 Thread Troy

Been trying to buildkernel, and as of about 2 weeks ago something
happened to the XE module.  Anyone have some ideas?

-Troy

===> xe
@ -> /usr/src/sys
machine -> /usr/src/sys/i386/include
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pccard/card_if.m -h
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
rm -f .depend
CC='/usr/bin/cc' mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -I- -I.
-I@ -I@/dev -I@/../include -I/usr/obj/usr/src/i386/usr/include  /usr/src/sys/mod
ules/xe/../../dev/xe/if_xe.c /usr/src/sys/modules/xe/../../dev/xe/if_xe_pccard.c

cd /usr/obj/usr/src/sys/SINDROME;  MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=i386
 MACHINE=i386  OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec  GROFF_BIN_PATH=
/usr/obj/usr/src/i386/usr/bin  
GROFF_FONT_PATH=/usr/obj/usr/src/i386/usr/share/groff_font  
GROFF_TMAC_PATH=/usr/obj/usr/src/i386/usr/share/tmac  DESTDIR=/usr/obj/usr/src/i386  
INSTALL="sh /usr/src/tools/install.sh"  
PATH=/usr/obj/usr/src/i386/usr/sbin:/usr/obj/usr/src/i386/usr/bin:/usr/obj/usr/src/i386/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
  OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/l
ibexec make KERNEL=kernel all
/usr/bin/cc -c -x assembler-with-cpp -DLOCORE -O -pipe  -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winl
ine -Wcast-qual  -Wno-format -ansi  -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src
/sys/dev -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/ipfilter -I/us
r/src/sys/../include  -D_KERNEL -ffreestanding -include opt_global.h -fno-common
   -mpreferred-stack-boundary=2 -ffreestanding  /usr/src/sys/i386/i386/locore.s
{standard input}: Assembler messages:
{standard input}:1684: Warning: rest of line ignored; first ignored character is
 `t'
{standard input}:1686: Error: unknown pseudo-op: `.'
{standard input}:1801: Error: missing ')'
{standard input}:1801: Error: missing ')'
{standard input}:1801: Error: junk `tmpstk)- 0xc000)' after expression
*** Error code 1

Stop in /usr/obj/usr/src/sys/SINDROME.
*** Error code 1

Stop in /usr/src.
*** Error code 1

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message