Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread David O'Brien

On Thu, Feb 21, 2002 at 12:05:31AM +0100, Stijn Hoop wrote:
 I ventured into this brave new world a few days ago and ran into
 this very problem. Alexander's patch (along with a make install in
 /usr/src/gnu/usr.bin/binutils) fixed it, as advertised.
 
 Maybe this can now be committed?

NOT until I have sufficient feedback from the FSF Binutils developers.

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread Michael D. Harnois

On Thu, 2002-02-21 at 04:03, David O'Brien wrote:

 On Thu, Feb 21, 2002 at 12:05:31AM +0100, Stijn Hoop wrote:
  
  Maybe this can now be committed?
 
 NOT until I have sufficient feedback from the FSF Binutils developers.

OK, I'm confused. binutils has been broken for three weeks. We have a
patch that we know fixes, at the very least, one of the known problems.
However, it can't be committed without feedback from the developers.

So having binutils broken indefinitely is better than applying a patch
that *might* have to be backed out or altered later?
 
-- 
Michael D. Harnois   bilocational bivocational
Pastor, Redeemer Lutheran ChurchWashburn, Iowa
1L, UST School of Law   Minneapolis, Minnesota
 Creative thought means that you forgot where you read it.
  --Stanley Hauerwas


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread Peter Schultz

Michael D. Harnois wrote:
  On Thu, 2002-02-21 at 04:03, David O'Brien wrote:
 
 
 On Thu, Feb 21, 2002 at 12:05:31AM +0100, Stijn Hoop wrote:
 
 Maybe this can now be committed?
 
 NOT until I have sufficient feedback from the FSF Binutils developers.
 
 
  OK, I'm confused. binutils has been broken for three weeks. We have a
  patch that we know fixes, at the very least, one of the known roblems.
  However, it can't be committed without feedback from the developers.
 
  So having binutils broken indefinitely is better than applying a patch
  that *might* have to be backed out or altered later?
 
I would like to wait and see what David comes up with.  I've applied the 
patch and things work for the most part, but there are some problems I'm 
having with the vim, open-motif-devel and AbiWord ports that I did not 
see until this patch.  So I guess the lesson is that if you want to run 
-CURRENT you just have to roll with the punches.

Pete...


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread Terry Lambert

Michael D. Harnois wrote:
 On Thu, 2002-02-21 at 04:03, David O'Brien wrote:
  On Thu, Feb 21, 2002 at 12:05:31AM +0100, Stijn Hoop wrote:
  
   Maybe this can now be committed?
 
  NOT until I have sufficient feedback from the FSF Binutils developers.
 
 OK, I'm confused. binutils has been broken for three weeks. We have a
 patch that we know fixes, at the very least, one of the known problems.
 However, it can't be committed without feedback from the developers.
 
 So having binutils broken indefinitely is better than applying a patch
 that *might* have to be backed out or altered later?

I believe the intent is to ensure that the patches make it
back into the FSF distributed code, so that in the future,
there is less maintenance required for FreeBSD platforms.

This offloading of maintenance is a good idea, considering
the stated positions of those with the currently thankless
job of beating FSF code into submission to make it run on
FreeBSD platforms.

Actually, there was a discussion at BSDCon as to whether or
not to drop the a.out support in order to decrease the patch
size necessary to make the FSF distributed code do what FreeBSD
needed it to do (personally, I would prefer that the a.out
code generation be integrated back into the FSF code base but
this is unlikely for FSF political reasons with regard to the
intent to get rid of the a.out standard entirely).

Such changes to the FreeBSD toolchain are necessary, unless
there is sufficient support for what the FSF views as being
gratuitous differences (e.g. not replacing BSD make with GNU
make like FreeBSD is supposed to do, etc.).

While I would incredibly dislike losing a.out, since most of
the promised advantages of ELF have not materialized (some,
such as linking a library against a library have... but only
for shared libraries), I have to side with David O'Brien,
since he is at least actively involved in maintaining the
code in question.

-- Terry

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread Michael D. Harnois

On Thu, 2002-02-21 at 13:29, Terry Lambert wrote:
 Michael D. Harnois wrote:
  On Thu, 2002-02-21 at 04:03, David O'Brien wrote:
   On Thu, Feb 21, 2002 at 12:05:31AM +0100, Stijn Hoop wrote:
   
Maybe this can now be committed?
  
   NOT until I have sufficient feedback from the FSF Binutils developers.
  
  OK, I'm confused. binutils has been broken for three weeks. We have a
  patch that we know fixes, at the very least, one of the known problems.
  However, it can't be committed without feedback from the developers.
  
  So having binutils broken indefinitely is better than applying a patch
  that *might* have to be backed out or altered later?
 
 I believe the intent is to ensure that the patches make it
 back into the FSF distributed code, so that in the future,
 there is less maintenance required for FreeBSD platforms.

This is all wonderful.

But then it seems to me that the entire new binutils should have been
backed out until it worked. Just like XFree-4.2.0 was backed out.
 
-- 
Michael D. Harnois   bilocational bivocational
Pastor, Redeemer Lutheran ChurchWashburn, Iowa
1L, UST School of Law   Minneapolis, Minnesota
 EDUCATION, n. That which discloses to the wise and disguises from 
 the foolish their lack of understanding. -- Ambrose Bierce


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread David O'Brien

On Thu, Feb 21, 2002 at 03:39:08PM -0600, Michael D. Harnois wrote:
 On Thu, 2002-02-21 at 13:29, Terry Lambert wrote:
  Michael D. Harnois wrote:
   On Thu, 2002-02-21 at 04:03, David O'Brien wrote:
On Thu, Feb 21, 2002 at 12:05:31AM +0100, Stijn Hoop wrote:

 Maybe this can now be committed?
   
NOT until I have sufficient feedback from the FSF Binutils developers.
   
   OK, I'm confused. binutils has been broken for three weeks. We have a
   patch that we know fixes, at the very least, one of the known problems.
   However, it can't be committed without feedback from the developers.
   
   So having binutils broken indefinitely is better than applying a patch
   that *might* have to be backed out or altered later?
  
  I believe the intent is to ensure that the patches make it
  back into the FSF distributed code, so that in the future,
  there is less maintenance required for FreeBSD platforms.
 
 This is all wonderful.
 
 But then it seems to me that the entire new binutils should have been
 backed out until it worked. Just like XFree-4.2.0 was backed out.

It works in general for 'make world' and is suffient for FreeBSD
developent -- the purpose of 5-CURRENT.  It is also allowing us to find
bugs that would otherwise go unfixed in Binutils 2.12.0 release.  Or
would you perfer we stick to 2.11.x forever -- BTW that would not give us
support for IA-64 or x86-64.

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread Terry Lambert

Michael D. Harnois wrote:
  I believe the intent is to ensure that the patches make it
  back into the FSF distributed code, so that in the future,
  there is less maintenance required for FreeBSD platforms.
 
 This is all wonderful.
 
 But then it seems to me that the entire new binutils should have been
 backed out until it worked. Just like XFree-4.2.0 was backed out.

Feel free to tilt at your windmills, all you want; I'm
personally busy with other windmills; I was just pointing
out what I thought was the rationale.

FWIW: it *does* work on Intel, it's just Alpha that's in
the dumps.  The currently accepted fix is to use the older
code until all the problems are out of there.

-- Tery

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread David O'Brien

On Thu, Feb 21, 2002 at 11:29:46AM -0800, Terry Lambert wrote:
 Actually, there was a discussion at BSDCon as to whether or
 not to drop the a.out support in order to decrease the patch
 size necessary to make the FSF distributed code do what FreeBSD

That is true for GCC.  For contrib/binutils, the code only supports
FreeBSD/ELF.  The old a.out as  ld are elsewhere in the tree -- and have
not been updated for years.

 needed it to do (personally, I would prefer that the a.out
 code generation be integrated back into the FSF code base but
 this is unlikely for FSF political reasons with regard to the

I have tried many times...

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-21 Thread Terry Lambert

David O'Brien wrote:
 It works in general for 'make world' and is suffient for FreeBSD
 developent -- the purpose of 5-CURRENT.  It is also allowing us to find
 bugs that would otherwise go unfixed in Binutils 2.12.0 release.  Or
 would you perfer we stick to 2.11.x forever -- BTW that would not give us
 support for IA-64 or x86-64.

Surprisingly, this did not occur to me until the Developer's
Summit report on other architectures, so it's probably not
obvious to most people.

For the record, then: binutils 2.12.0 is *required* by IA64,
and so it's required going forward.

Personally, I've been quiet since my initial Alpha breakage
complaints, except to try to help track things down once
in a while, since I had since realized this was an issue.

-- Terry

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-20 Thread Stijn Hoop

Hi -current,

I ventured into this brave new world a few days ago and ran into
this very problem. Alexander's patch (along with a make install in
/usr/src/gnu/usr.bin/binutils) fixed it, as advertised.

Maybe this can now be committed?

--Stijn

-- 
Help Wanted: Telepath. You know where to apply.



msg34978/pgp0.pgp
Description: PGP signature


Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-16 Thread Peter Schultz

Alexander N. Kabaev wrote:
 Interesting. Is the DF_TEXTREL flag set in DT_FLAGS instead? Is the
 library linked w/ -enable-new-dtags? Are the new dtags enabled by
 default in the new binutils? Someting in elf32.em?
 
 No. DT_FLAGS entry is not created regardless of whether the 
 --enable-new-dtags parameter has been passed to the linker. Ld simply
 ignores dynamic relocation entries for local symbols while checking
 whether either DT_FLAGS or DT_TEXTREL should be created. Attached patch  
 appears to fix the problem for me and has not caused any problems on my 
 test box so far but I am not making any claims about its correctness. 
 Use on your own risk.
 
It's got to be at least partially correct because this patch does indeed 
  work.  I've been punishing my machine and it's doing great!

Thank you, Alexander, and all.

Pete...

 Are the new dtags enabled by default in the new binutils?
 
 No, it seems like the new dtags are disabled by default.
 


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-15 Thread Alexander N. Kabaev

 Interesting. Is the DF_TEXTREL flag set in DT_FLAGS instead? Is the
 library linked w/ -enable-new-dtags? Are the new dtags enabled by
 default in the new binutils? Someting in elf32.em?
No. DT_FLAGS entry is not created regardless of whether the 
--enable-new-dtags parameter has been passed to the linker. Ld simply
ignores dynamic relocation entries for local symbols while checking
whether either DT_FLAGS or DT_TEXTREL should be created. Attached 
patch  appears to fix the problem for me and has not caused any 
problems on my test box so far but I am not making any claims about 
its correctness. Use on your own risk.

 Are the new dtags enabled by default in the new binutils?
No, it seems like the new dtags are disabled by default. 




Index: bfd/elf32-i386.c
===
RCS file: /usr/ncvs/src/contrib/binutils/bfd/elf32-i386.c,v
retrieving revision 1.11
diff -u -r1.11 elf32-i386.c
--- bfd/elf32-i386.c27 Jan 2002 12:07:38 -  1.11
+++ bfd/elf32-i386.c15 Feb 2002 17:21:54 -
@@ -1506,6 +1506,10 @@
}
  else
{
+ asection *s = p-sec-output_section;
+ if (s != NULL  (s-flags  SEC_READONLY) != 0)
+   info-flags |= DF_TEXTREL;
+
  srel = elf_section_data (p-sec)-sreloc;
  srel-_raw_size += p-count * sizeof (Elf32_External_Rel);
}



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-14 Thread Alexander N. Kabaev

 This suggests a problem with the runtime-linker (rtld), not binutils.
Actually, the bug is somewhere in the new binutils code, and I am very
close to finding where it is exactly. The new liker fails to set 
DT_TEXTREL property in the shared library header even though its relocation
table contains several entries which refer to the code segment. As a result,
ld-elf.so.1 fails to enable writes on the text segment when relocating the
binary and crashes with SIGBUS while processing the very first relocation
record.
I still need some time in debugger to find a proper way to fix this.


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-14 Thread Terry Lambert

Alexander N. Kabaev wrote:
  This suggests a problem with the runtime-linker (rtld), not binutils.
 Actually, the bug is somewhere in the new binutils code, and I am very
 close to finding where it is exactly. The new liker fails to set
 DT_TEXTREL property in the shared library header even though its relocation
 table contains several entries which refer to the code segment. As a result,
 ld-elf.so.1 fails to enable writes on the text segment when relocating the
 binary and crashes with SIGBUS while processing the very first relocation
 record.

Woohoo!  He shoots, he scores!

 I still need some time in debugger to find a proper way to fix this.

My binutils-foo is rusty.  Personally, I just reverted to
the old binutils and called it a day.  8-).

-- Terry

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-14 Thread Bjoern Fischer

On Thu, Feb 14, 2002 at 07:22:59PM -0500, Alexander N. Kabaev wrote:
  This suggests a problem with the runtime-linker (rtld), not binutils.
 Actually, the bug is somewhere in the new binutils code, and I am very
 close to finding where it is exactly. The new liker fails to set 
 DT_TEXTREL property in the shared library header even though its relocation
 table contains several entries which refer to the code segment. As a result,
 ld-elf.so.1 fails to enable writes on the text segment when relocating the
 binary and crashes with SIGBUS while processing the very first relocation
 record.
 I still need some time in debugger to find a proper way to fix this.

Interesting. Is the DF_TEXTREL flag set in DT_FLAGS instead? Is the
library linked w/ -enable-new-dtags? Are the new dtags enabled by
default in the new binutils? Someting in elf32.em?

Currently I'm experimenting with some code that enhances the FreeBSD
runtime linker to handle some newer ELF features, such as DT_RUNPATH,
DT_FLAGS and ${ORIGIN} substitution sequences

-Björn


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-13 Thread

On Wed, Feb 13, 2002 at 17:35:27 +0300, Vladimir B.Grebenschikov wrote:
 
 Programm linked against libpng.so on -CURRNET causes SIGBUS on startup
 
 How-To-Repeat:
 
 % cat  trypng.c
 #include stdio.h
 
 main(int ac, char ** av)
 {
   printf(Hello World\n);
 }
 ^D
 % gcc -o trypng trypng.c -L/usr/local/lib -lpng
 % ./trypng
 Bus error (core dumped)

It looks like problem with new GNU binutils (I suspect ASM code). Try to
contact David [EMAIL PROTECTED] on this subj.

-- 
Andrey A. Chernov
http://ache.pp.ru/

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-13 Thread David O'Brien

On Wed, Feb 13, 2002 at 05:59:02PM +0300, Andrej Cernov wrote:
 On Wed, Feb 13, 2002 at 17:35:27 +0300, Vladimir B.Grebenschikov wrote:
  
  Programm linked against libpng.so on -CURRNET causes SIGBUS on startup
  
  How-To-Repeat:
  
  % cat  trypng.c
  #include stdio.h
  
  main(int ac, char ** av)
  {
printf(Hello World\n);
  }
  ^D
  % gcc -o trypng trypng.c -L/usr/local/lib -lpng
  % ./trypng
  Bus error (core dumped)
 
 It looks like problem with new GNU binutils (I suspect ASM code). Try to
 contact David [EMAIL PROTECTED] on this subj.

This is not much of a bug report.  Was libpng compiled with new binuils
or old?  Someone that is having problems (which I am not), needs to
compile things with -g, not strip them, use gdb and provide a REAL bug
report.

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-13 Thread

On Wed, Feb 13, 2002 at 07:02:51 -0800, David O'Brien wrote:
 
 This is not much of a bug report.  Was libpng compiled with new binuils
 or old?  Someone that is having problems (which I am not), needs to
 compile things with -g, not strip them, use gdb and provide a REAL bug
 report.

I just compile it with old binutils on -current and it works. I don't 
upgrade my system to new binutils yet.

-- 
Andrey A. Chernov
http://ache.pp.ru/

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-13 Thread David O'Brien

On Wed, Feb 13, 2002 at 06:14:42PM +0300, Vladimir B.  Grebenschikov wrote:
 It was in chroot created today as:
 
# cd /usr/src
# cvs -d :pserver:[EMAIL PROTECTED]:/home/ncvs upd -dP
# make buildworld
# make installworld DESTDIR=/X/chroot
# cd /usr/src/etc  make destribution DESTDIR=/X/chroot
# chroot /X/chroot /bin/tcsh
 
 building programm with -g gives no more information at all, I have tried
 Linking aginst static library - works.

This suggests a problem with the runtime-linker (rtld), not binutils.

 
 May be I need to try build libpng with -g ?

Yes, the ENTIRE code should be compiled with -g.  Then the core dump
inspected with GDB.

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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-13 Thread Peter Schultz

David O'Brien wrote:
 This is not much of a bug report.  Was libpng compiled with new binuils
 or old?  Someone that is having problems (which I am not), needs to
 compile things with -g, not strip them, use gdb and provide a REAL bug
 report.
 
In /etc/make.conf I have:
CFLAGS= -O0 -g -pipe
COPTFLAGS= -O0 -g -pipe

Now how can I prevent all stripping and what commands should I use with 
gdb to get you the info you need?

Pete...


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



Re: ports/34908: libpng port makes bad dynamic library on -CURRENT

2002-02-13 Thread Terry Lambert

David O'Brien wrote:
 On Wed, Feb 13, 2002 at 06:14:42PM +0300, Vladimir B.  Grebenschikov wrote:
  building programm with -g gives no more information at all, I have tried
  Linking aginst static library - works.
 
 This suggests a problem with the runtime-linker (rtld), not binutils.

Works with the old binutils on 4.5, though... that suggests
that it's *not* a problem with the rtld, rather a problem
with what has changed.

There was a problem on the Alpha based on an assumption about
where one section started and another ended that was not true
with the new binutils, but was true with the old ones.  Perhaps
x86 has this same problem (i.e. assumption that's true with the
old binutils, but not the new, about section ordering), only it
is not as pronounced because of the alignment insensitivity of
the x86 relative to the alpha.

This implies that certain sections would be mapped twice, and
work on the x86, unless they got large enough to spill over
to a second page (the way ELF works).  I'd look there, first.

What would be useful, then, is an objdump on both programs and
both shared libraries to see the section layouts relative to
what ld.so is expecting.

-- Terry

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