Re: Broken world in rtld-elf...

2002-06-14 Thread Bruce Evans

On Thu, 13 Jun 2002, Alex Zepeda wrote:

 On Thu, Jun 13, 2002 at 12:26:05PM +1000, Bruce Evans wrote:

  rtld still uses asms with the old, broken/fragile 0 constraint.  This
  constraint is especially broken/fragile if things are pessimized by
  compiling without optimizations.

 D'oh!

 Is there any chance of sticking a warning in the makefile if -O0 (or
 whatever else would cause it to not compile) is present?

Not really.  It is a transient bug that is almost as easy to fix as
warn about.

Bruce


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



Re: Broken world in rtld-elf...

2002-06-14 Thread Alex Zepeda

On Fri, Jun 14, 2002 at 07:09:06PM +1000, Bruce Evans wrote:

 Not really.  It is a transient bug that is almost as easy to fix as
 warn about.

So when can I expect the fix to be committed? :-D

- alex

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



Re: Broken world in rtld-elf...

2002-06-13 Thread Alex Zepeda

On Thu, Jun 13, 2002 at 12:26:05PM +1000, Bruce Evans wrote:

 rtld still uses asms with the old, broken/fragile 0 constraint.  This
 constraint is especially broken/fragile if things are pessimized by
 compiling without optimizations.

D'oh!

Is there any chance of sticking a warning in the makefile if -O0 (or
whatever else would cause it to not compile) is present?

- alex

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



Re: Broken world in rtld-elf...

2002-06-13 Thread Terry Lambert

Alex Zepeda wrote:
 On Thu, Jun 13, 2002 at 12:26:05PM +1000, Bruce Evans wrote:
  rtld still uses asms with the old, broken/fragile 0 constraint.  This
  constraint is especially broken/fragile if things are pessimized by
  compiling without optimizations.
 
 D'oh!
 
 Is there any chance of sticking a warning in the makefile if -O0 (or
 whatever else would cause it to not compile) is present?


GCCVERS=`gcc -v 21 | grep version | cut -d   -f 3`
.if ${GCCVERS} = 3.1
.BEGIN:
echo Optimization with GCC 3.1 is often broken! 2
.endif


Oh... you wanted to grep -O out of the CFLAGS and CXXFLAGS?
How to do that should be obvious from the above...

-- Terry

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



Re: Broken world in rtld-elf...

2002-06-13 Thread Juli Mallett

* Terry Lambert [EMAIL PROTECTED] escriurères
 Alex Zepeda wrote:
  On Thu, Jun 13, 2002 at 12:26:05PM +1000, Bruce Evans wrote:
   rtld still uses asms with the old, broken/fragile 0 constraint.  This
   constraint is especially broken/fragile if things are pessimized by
   compiling without optimizations.
  
  D'oh!
  
  Is there any chance of sticking a warning in the makefile if -O0 (or
  whatever else would cause it to not compile) is present?
 
 
 GCCVERS=`gcc -v 21 | grep version | cut -d   -f 3`
 .if ${GCCVERS} = 3.1
 .BEGIN:
   echo Optimization with GCC 3.1 is often broken! 2
 .endif
 
 
 Oh... you wanted to grep -O out of the CFLAGS and CXXFLAGS?
 How to do that should be obvious from the above...

Errr, it was with 0 level optimisation that is the problem, not a real
level.  Read carefully what bde said, and look at hte warnings and how
GCC deals with the code in question.

Also, your example is very wrong, read make(1)'s section on dealing with
variables.
-- 
Juli Mallett [EMAIL PROTECTED]  FreeBSD: The Power To Serve
Perception is prejudice / Don't classify me / Accept me as me / Not what you see

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



Re: Broken world in rtld-elf...

2002-06-13 Thread Terry Lambert

Juli Mallett wrote:
 Errr, it was with 0 level optimisation that is the problem, not a real
 level.  Read carefully what bde said, and look at hte warnings and how
 GCC deals with the code in question.
 
 Also, your example is very wrong, read make(1)'s section on dealing with
 variables.


I know my example is very wrong; though it could be used to grep
for optimizer flags, where it could not be used for what I jokingly
said it could be used for... I guess it was too subtle.

Question:

-O0 fails to produce good code; how do I check and warn if
-O0 is being used?

Answer:

Fix -O0, or grep its use and complain about it

Answer 2:

Make its use an argument error to the compiler, until it is
fixed

Answer 3:

Quit munging the Makefiles, when they will just need to be
unmunged later, and the problem goes away if you change
the compiler

-- Terry

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



Re: Broken world in rtld-elf...

2002-06-13 Thread Juli Mallett

* Terry Lambert [EMAIL PROTECTED] escriurères
 Juli Mallett wrote:
  Errr, it was with 0 level optimisation that is the problem, not a real
  level.  Read carefully what bde said, and look at hte warnings and how
  GCC deals with the code in question.
  
  Also, your example is very wrong, read make(1)'s section on dealing with
  variables.
 
 
 I know my example is very wrong; though it could be used to grep
 for optimizer flags, where it could not be used for what I jokingly
 said it could be used for... I guess it was too subtle.
 
 Question:
 
   -O0 fails to produce good code; how do I check and warn if
   -O0 is being used?
 
 Answer:
 
   Fix -O0, or grep its use and complain about it

.if ${MACHINE_ARCH} == i386
CFLAGS:= $(CFLAGS:N-O0)
.endif

I think.

 Answer 2:
 
   Make its use an argument error to the compiler, until it is
   fixed

-O0 isn't broken, it just doesn't handle this construct right, and the issue
is known.

 Answer 3:
 
   Quit munging the Makefiles, when they will just need to be
   unmunged later, and the problem goes away if you change
   the compiler

NetBSD and OpenBSD do this to work around crappy toolchains all the time.

Most of the time it's to *enable* -O0 though, ironically :)
-- 
Juli Mallett [EMAIL PROTECTED]  FreeBSD: The Power To Serve
Perception is prejudice / Don't classify me / Accept me as me / Not what you see

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



Re: Broken world in rtld-elf...

2002-06-12 Thread Bruce Evans

On Wed, 12 Jun 2002, Alex Zepeda wrote:

 So what's up with -current?

 I had to install gawk to get the kernel to build (and world too for that
 matter).. I haven't had the balls to put the one true awk back in place.

 But now whether in world mode or not I get:

 blarf:/usr/src/libexec/rtld-elf#make
 cc -O0 -Wall -DFREEBSD_ELF -I/usr/src/libexec/rtld-elf/i386
 ^^^
 -I/usr/src/libexec/rtld-elf -elf -fpic -DPIC   -Wformat=2
 -Wno-format-extra-args  -c /usr/src/libexec/rtld-elf/rtld.c
 /usr/src/libexec/rtld-elf/rtld.c: In function `atomic_decr_int':
 /usr/src/libexec/rtld-elf/i386/rtld_machdep.h:58: inconsistent operand
 constraints in an `asm'
 *** Error code 1

rtld still uses asms with the old, broken/fragile 0 constraint.  This
constraint is especially broken/fragile if things are pessimized by
compiling without optimizations.

Bruce


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