From tbourke@triptrop.cse.unsw.edu.au  Tue Mar 13 04:41:54 2007
Return-Path: <tbourke@triptrop.cse.unsw.edu.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0AC7216A402
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Mar 2007 04:41:54 +0000 (UTC)
	(envelope-from tbourke@triptrop.cse.unsw.edu.au)
Received: from tone.orchestra.cse.unsw.EDU.AU (tone.orchestra.cse.unsw.EDU.AU [129.94.242.59])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E11C13C46E
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Mar 2007 04:41:52 +0000 (UTC)
	(envelope-from tbourke@triptrop.cse.unsw.edu.au)
Received: From triptrop.cse.unsw.edu.au ([129.94.175.153]) By tone With Smtp ;
	Tue, 13 Mar 2007 15:41:51 +1100 
Received: from triptrop.cse.unsw.edu.au (localhost [127.0.0.1])
	by triptrop.cse.unsw.edu.au (8.13.8/8.13.6) with ESMTP id l2D4eKYa016995;
	Tue, 13 Mar 2007 15:40:20 +1100 (EST)
	(envelope-from tbourke@triptrop.cse.unsw.edu.au)
Received: (from tbourke@localhost)
	by triptrop.cse.unsw.edu.au (8.13.8/8.13.6/Submit) id l2D4eKNc016994;
	Tue, 13 Mar 2007 15:40:20 +1100 (EST)
	(envelope-from tbourke)
Message-Id: <200703130440.l2D4eKNc016994@triptrop.cse.unsw.edu.au>
Date: Tue, 13 Mar 2007 15:40:20 +1100 (EST)
From: Timothy Bourke <timbob@bigpond.com>
Reply-To: Timothy Bourke <timbob@bigpond.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Martin Wilke <miwi@freebsd.org>
Subject: Update port: lang/polyml (patch for amd64 build)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         110248
>Category:       ports
>Synopsis:       Update port: lang/polyml (patch for amd64 build)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 13 04:50:04 GMT 2007
>Closed-Date:    Tue Mar 20 16:19:11 GMT 2007
>Last-Modified:  Tue Mar 20 16:19:11 GMT 2007
>Originator:     Timothy Bourke
>Release:        FreeBSD 6.1-RELEASE-p6 i386 (uname -s -r -m)
>Organization:
n/a
>Environment:
>Description:
Build failure on pointyhat:
  http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/e.7.2007031118/polyml-5.0.log

configure: error: Poly/ML is not supported for this architecture

configure expects `x86_64' whereas FreeBSD gives `amd64'. I don't have any
64-bit hardware so I cannot easily test the patch. If it works I will pass
the details upstream to the developers.

>How-To-Repeat:
>Fix:

--- polyml.diff begins here ---
Index: files/patch-configure
===================================================================
RCS file: files/patch-configure
diff -N files/patch-configure
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-configure	13 Mar 2007 04:35:01 -0000
@@ -0,0 +1,47 @@
+--- configure.orig	Tue Mar 13 15:28:01 2007
++++ configure	Tue Mar 13 15:29:29 2007
+@@ -8219,7 +8219,7 @@
+   # find out which ABI we are using
+   libsuff=
+   case "$host_cpu" in
+-  x86_64*|s390x*|powerpc64*)
++  x86_64*|amd64*|s390x*|powerpc64*)
+     echo '#line 8223 "configure"' > conftest.$ac_ext
+     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+@@ -12196,7 +12196,7 @@
+   # find out which ABI we are using
+   libsuff=
+   case "$host_cpu" in
+-  x86_64*|s390x*|powerpc64*)
++  x86_64*|amd64*|s390x*|powerpc64*)
+     echo '#line 12200 "configure"' > conftest.$ac_ext
+     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+@@ -14804,7 +14804,7 @@
+   # find out which ABI we are using
+   libsuff=
+   case "$host_cpu" in
+-  x86_64*|s390x*|powerpc64*)
++  x86_64*|amd64*|s390x*|powerpc64*)
+     echo '#line 14808 "configure"' > conftest.$ac_ext
+     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+@@ -17420,7 +17420,7 @@
+   # find out which ABI we are using
+   libsuff=
+   case "$host_cpu" in
+-  x86_64*|s390x*|powerpc64*)
++  x86_64*|amd64*|s390x*|powerpc64*)
+     echo '#line 17424 "configure"' > conftest.$ac_ext
+     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+@@ -30451,7 +30451,7 @@
+ 
+                 polyarch=ppc
+                 ;;
+-          x86_64)
++          x86_64 | amd64)
+                 ARCHFLAG=-DX86_64
+ 
+                 polyarch=x86_64
--- polyml.diff ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Tue Mar 13 07:20:49 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110248 
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Tue Mar 13 09:37:42 UTC 2007 
State-Changed-Why:  
Ask for maintainer fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110248 

From: Timothy Bourke <timbob@bigpond.com>
To: bug-followup@FreeBSD.org
Cc: Martin Wilke <miwi@FreeBSD.org>
Subject: Re: ports/110248: Update port: lang/polyml (patch for amd64 build)
Date: Tue, 13 Mar 2007 21:39:06 +1100

 --/e2eDi0V/xtL+Mc8
 Content-Type: multipart/mixed; boundary="neYutvxvOLaeuPCA"
 Content-Disposition: inline
 
 
 --neYutvxvOLaeuPCA
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 The symbol names differ between i386 and amd64
 (compare sys/amd64/include/elf.h with sys/i386/include/elf.h). The
 attached patches (untested) should fix the errors:
 
 elfexport.cpp:219: error: `R_386_PC32' was not declared in this scope
 elfexport.cpp:349: error: `R_386_32' was not declared in this scope
 
 The other errors:
 elfexport.cpp:160: warning: left shift count >= width of type
 
 The ELF64_R_INFO macro:
 #define ELF64_R_INFO(sym, type)	(((sym) << 32) + ((type) & 0xffffffffL))
 
 Does shift its argument (unsigned) 32 places left. Further investigation
 will be undertaken.
 
 
 --neYutvxvOLaeuPCA
 Content-Type: text/x-c++src; charset=us-ascii
 Content-Disposition: attachment; filename="patch-libpolyml-elfexport.cpp"
 
 --- libpolyml/elfexport.cpp.orig	Tue Mar 13 21:18:13 2007
 +++ libpolyml/elfexport.cpp	Tue Mar 13 21:23:29 2007
 @@ -216,7 +216,7 @@
              setRelocationAddress(addr, &reloc.r_offset);
               // We seem to need to subtract 4 bytes to get the correct offset in ELF
              offset -= 4;
 -            reloc.r_info = ELFXX_R_INFO(AreaToSym(aArea), R_386_PC32);
 +            reloc.r_info = ELFXX_R_INFO(AreaToSym(aArea), R_XXX_PC32);
              for (unsigned i = 0; i < sizeof(PolyWord); i++)
              {
                  addr[i] = (byte)(offset & 0xff);
 @@ -346,10 +346,10 @@
  // also have a code-generator.
  static struct { const char *name; unsigned procType, relocation; bool useRela; } archTable[] =
  {
 -    { "i386",   EM_386,     R_386_32,       false },
 -    { "i486",   EM_386,     R_386_32,       false },
 -    { "i586",   EM_386,     R_386_32,       false },
 -    { "i686",   EM_386,     R_386_32,       false },
 +    { "i386",   EM_386,     R_XXX_XX,       false },
 +    { "i486",   EM_386,     R_XXX_XX,       false },
 +    { "i586",   EM_386,     R_XXX_XX,       false },
 +    { "i686",   EM_386,     R_XXX_XX,       false },
      { "sparc",  EM_SPARC,   R_SPARC_32,     true },
      { "Power",  EM_PPC,     R_PPC_ADDR32,   true },
      { "ppc",    EM_PPC,     R_PPC_ADDR32,   true },
 @@ -416,7 +416,7 @@
          }
      case MA_I386:
          fhdr.e_machine = EM_386;
 -        directReloc = R_386_32;
 +        directReloc = R_XXX_XX;
          useRela = false;
          break;
      case MA_PPC:
 
 --neYutvxvOLaeuPCA
 Content-Type: text/x-chdr; charset=us-ascii
 Content-Disposition: attachment; filename="patch-libpolyml-elfexport.h"
 Content-Transfer-Encoding: quoted-printable
 
 --- libpolyml/elfexport.h.orig	Tue Mar 13 21:19:52 2007
 +++ libpolyml/elfexport.h	Tue Mar 13 21:24:22 2007
 @@ -40,6 +40,8 @@
  #define ELFXX_R_INFO(_y, _z)    ELF64_R_INFO(_y, _z)
  #define ELFXX_ST_INFO(_y, _z)   ELF64_ST_INFO(_y, _z)
  #define ELFCLASSXX      ELFCLASS64
 +#define R_XXX_XX    R_X86_64_64
 +#define R_XXX_PC32  R_X86_64_PC32
  #else
  #define ElfXX_Addr  Elf32_Addr
  #define ElfXX_Rel   Elf32_Rel
 @@ -50,6 +52,8 @@
  #define ELFXX_R_INFO(_y, _z)    ELF32_R_INFO(_y, _z)
  #define ELFXX_ST_INFO(_y, _z)   ELF32_ST_INFO(_y, _z)
  #define ELFCLASSXX              ELFCLASS32
 +#define R_XXX_XX    R_386_32
 +#define R_XXX_PC32  R_386_PC32
  #endif
 =20
  class ELFExport: public Exporter, public ScanAddress
 
 --neYutvxvOLaeuPCA--
 
 --/e2eDi0V/xtL+Mc8
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.4 (FreeBSD)
 
 iD8DBQFF9n9KtKVK1sFb0ecRAns9AJ9p6GUm8O4fLKlqDEmds++DkT8mzQCfco4p
 alCPHJRtGxYTFegHpd/wYyE=
 =Kzx/
 -----END PGP SIGNATURE-----
 
 --/e2eDi0V/xtL+Mc8--
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Tue Mar 20 16:19:09 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110248 
>Unformatted:
