Subject: port-amd64/26499: mozilla 1.7 doesn't work
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <toshii@netbsd.org>
List: netbsd-bugs
Date: 08/01/2004 09:20:28
>Number:         26499
>Category:       port-amd64
>Synopsis:       mozilla 1.7 doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 01 00:40:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 2.0_BETA
>Organization:
	
>Environment:
System: NetBSD primula.my.domain 2.0_BETA NetBSD 2.0_BETA (PRIMULA) #5: Sat Jul 31 11:20:30 JST 2004 toshii@primula.my.domain:/usr/src/netbsd2-0/src/sys/arch/amd64/compile/PRIMULA amd64
Architecture: x86_64
Machine: amd64
>Description:
	mozilla 1.7 from pkgsrc doesn't work on amd64.
	It seems to be due to a -fPIC related gcc bug.
	See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16092 for details.

>How-To-Repeat:
	cd /usr/pkgsrc/www/mozilla
	make install
	mozilla
>Fix:
	The following patch from the gcc bugzilla seems to work.

Index: i386.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.4
diff -u -r1.4 i386.c
--- i386.c	10 Feb 2004 12:56:21 -0000	1.4
+++ i386.c	31 Jul 2004 23:54:08 -0000
@@ -14589,15 +14589,14 @@
       output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
     }
 
-  xops[0] = DECL_RTL (function);
+  xops[0] = XEXP (DECL_RTL (function), 0);
   if (TARGET_64BIT)
     {
       if (!flag_pic || (*targetm.binds_local_p) (function))
 	output_asm_insn ("jmp\t%P0", xops);
       else
 	{
-	  tmp = XEXP (xops[0], 0);
-	  tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp), UNSPEC_GOTPCREL);
+	  tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, xops[0]), UNSPEC_GOTPCREL);
 	  tmp = gen_rtx_CONST (Pmode, tmp);
 	  tmp = gen_rtx_MEM (QImode, tmp);
 	  xops[0] = tmp;
>Release-Note:
>Audit-Trail:
>Unformatted: