Bug 89486 - firefox and thunderbird is broken on sparc64
Summary: firefox and thunderbird is broken on sparc64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: sparc64 (show other bugs)
Version: 6.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: David E. O'Brien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-24 09:00 UTC by bel
Modified: 2006-06-18 15:51 UTC (History)
1 user (show)

See Also:


Attachments
elf64-sparc.c.patch (760 bytes, patch)
2006-01-13 07:45 UTC, bel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bel 2005-11-24 09:00:08 UTC
	The firefox is broken a long time.

	See also my old message from sparc64 mail list.
http://lists.freebsd.org/mailman/htdig/freebsd-sparc64/2004-October/002262.html

Fix: 

Unknown. The firefox cannot be compiled as static.
How-To-Repeat: 	Run firefox.

$ firefox
Segmentation fault (core dumped)

$ gdb /usr/X11R6/lib/firefox/firefox-bin firefox-bin.core 
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc64-marcel-freebsd"...
Core was generated by `firefox-bin'.
Program terminated with signal 11, Segmentation fault.
[...]
#0  0x0000000040244450 in reloc_jmpslot (wherep=0x0, target=0, obj=0x4026e000, 
    refobj=0x4026e000, rel=0x113780)
    at /usr/src/libexec/rtld-elf/sparc64/reloc.c:535
535                             where[2] = JMP   | LOVAL(target);
(gdb) bt full
#0  0x0000000040244450 in reloc_jmpslot (wherep=0x0, target=0, obj=0x4026e000, 
    refobj=0x4026e000, rel=0x113780)
    at /usr/src/libexec/rtld-elf/sparc64/reloc.c:535
        rela = (const Elf_Rela *) 0x113780
        offset = 0
        where = (Elf_Half *) 0x0
#1  0x00000000402455e4 in _rtld_bind (obj=0x4026e000, reloff=12768)
    at /usr/src/libexec/rtld-elf/rtld.c:485
        rel = (const Elf_Rel *) 0x113780
        def = (const Elf_Sym *) 0x101770
        defobj = (const Obj_Entry *) 0x4026e000
        where = (Elf_Addr *) 0x0
        target = 0
        lockstate = 1
#2  0x0000000040243a20 in _rtld_bind_start_1 ()
    at /usr/src/libexec/rtld-elf/sparc64/rtld_start.S:166
No locals.
#3  0x0000000040243a20 in _rtld_bind_start_1 ()
    at /usr/src/libexec/rtld-elf/sparc64/rtld_start.S:166
No locals.
Previous frame identical to this frame (corrupt stack?)
(gdb) p where
$1 = (Elf_Half *) 0x0
(gdb) up
#1  0x00000000402455e4 in _rtld_bind (obj=0x4026e000, reloff=12768)
    at /usr/src/libexec/rtld-elf/rtld.c:485
485         target = reloc_jmpslot(where, target, defobj, obj, rel);
Current language:  auto; currently c
(gdb) p rel[0]
$2 = {r_offset = 0, r_info = 0}
(gdb) quit

$ objdump -R /usr/X11R6/lib/firefox/firefox-bin | grep R_SPARC_NONE
0000000000000000 R_SPARC_NONE      *ABS*
0000000000000000 R_SPARC_NONE      *ABS*
Comment 1 bel 2005-12-30 14:29:25 UTC
I have received the message, that in NetBSD same problem is solved.

http://sourceware.org/ml/binutils/2005-12/msg00278.html
Comment 2 bel 2006-01-13 07:45:59 UTC
I have fully working firefox, built from ports.

How-To-Fix:

Save attached patch or get it from NetBSD:
http://cvsweb.netbsd.org/bsdweb.cgi/src/gnu/dist/binutils/bfd/elf64-sparc.c.diff?r1=1.3&r2=1.4&f=h&f=u

Apply the patch.

# cd /usr/src
# patch -p0 < /path/to/patch

Recompile your binutils.

# cd /usr/src/gnu/usr.bin/binutils
# make obj && make depend && make && make install

Now we have fixed ld(1).

Recompile firefox from ports.

# cd /usr/ports/www/firefox
# make clean
# make
# make deinstall
# make install
# make package

I have tested firefox and gnome2 on FreeBSD-6.0-RELEASE/sparc64/SMP with
libthr. No problems found. For switching to libthr, add following
lines to /etc/libmap.conf:

libc_r.so.6             libthr.so.2
libc_r.so               libthr.so
Comment 3 marius 2006-02-09 17:42:51 UTC
On Fri, Jan 13, 2006 at 07:50:06AM +0000, Andrew Belashov wrote:
>  
>  I have fully working firefox, built from ports.
>  
>  How-To-Fix:
>  
>  Save attached patch or get it from NetBSD:
>  http://cvsweb.netbsd.org/bsdweb.cgi/src/gnu/dist/binutils/bfd/elf64-sparc.c.diff?r1=1.3&r2=1.4&f=h&f=u
>  
>  --- contrib/binutils/bfd/elf64-sparc.c.orig	Thu Aug  5 08:31:26 2004
>  +++ contrib/binutils/bfd/elf64-sparc.c	Sun Jan  1 19:00:33 2006
>  @@ -1638,7 +1638,11 @@ sparc64_elf_adjust_dynamic_symbol (info,
>   	      || h->root.type == bfd_link_hash_defweak)
>   	  && (h->root.u.def.section->flags & SEC_CODE) != 0))
>       {
>  -      if (! elf_hash_table (info)->dynamic_sections_created)
>  +      if (! info->shared
>  +	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
>  +	  && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
>  +	  && h->root.type != bfd_link_hash_undefweak
>  +	  && h->root.type != bfd_link_hash_undefined)
>   	{
>   	  /* This case can occur if we saw a WPLT30 reloc in an input
>                file, but none of the input files were dynamic objects.
>  

David,

could you please import the above fix into FreeBSD in order to get
Firefox and Thunderbird working? It's a backport of elf64-sparc.c
rev. 1.101 (sourceware.org repository) to Binutils 2.15.

Marius

-- 
This mail was scanned by AntiVir Milter.
This product is licensed for non-commercial use.
See www.antivir.de for details.
Comment 4 Marius Strobl freebsd_committer freebsd_triage 2006-04-25 21:14:44 UTC
Responsible Changed
From-To: freebsd-sparc64->obrien


Assign to obrien@ in order to start a 1 month maintainer timeout countdown.
Comment 5 Marius Strobl freebsd_committer freebsd_triage 2006-06-18 15:49:48 UTC
State Changed
From-To: open->closed


Close; fix was imported as src/contrib/binutils/bfd/elf64-sparc.c rev. 
1.1.1.13 and MFC'ed to RELENG_6 in rev. 1.1.1.12.8.1. 
Thanks for the report!