PARI/GP Bug report logs - #1022
FreeBSD/amd64 not detected correctly

Package: pari; Maintainer for pari is Aurel Page <aurel.page@normalesup.org>; Source for pari is src:pari.

Reported by: Peter Jeremy <peterjeremy@acm.org>

Date: Sun, 3 Jan 2010 03:03:03 UTC

Severity: normal

Tags: patch

Done: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>

Bug is archived. No further changes may be made.

Full log


🔗 View this message in rfc822 format

X-Loop: allomber@math.u-bordeaux.fr
Subject: Bug#1022: FreeBSD/amd64 not detected correctly
Reply-To: Peter Jeremy <peterjeremy@acm.org>, 1022@pari.math.u-bordeaux.fr
Resent-From: Peter Jeremy <peterjeremy@acm.org>
Resent-To: bug-submit-list@pari.math.u-bordeaux.fr
Resent-CC: Karim.Belabas@math.u-bordeaux.fr
Resent-Date: Sun, 03 Jan 2010 03:03:03 UTC
Resent-Message-ID: <handler.1022.B.126248715027341@pari.math.u-bordeaux.fr>
Resent-Sender: allomber@math.u-bordeaux.fr
X-PARI/GP-PR-Message: report 1022
X-PARI/GP-PR-Package: pari
X-PARI/GP-PR-Keywords: patch
Received: via spool by submit@pari.math.u-bordeaux.fr id=B.126248715027341
          (code B ref -1); Sun, 03 Jan 2010 03:03:03 UTC
Received: (at submit) by pari.math.u-bordeaux.fr; 3 Jan 2010 02:52:30 +0000
Received: from mail36.syd.optusnet.com.au ([211.29.133.76])
	by pari with esmtp (Exim 4.63)
	(envelope-from <peterjeremy@acm.org>)
	id 1NRGZx-00076w-MV
	for submit@pari.math.u-bordeaux.fr; Sun, 03 Jan 2010 03:52:30 +0100
Received: from server.vk2pj.dyndns.org (c122-106-232-83.belrs3.nsw.optusnet.com.au [122.106.232.83])
	by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o032qNqX022864
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <submit@pari.math.u-bordeaux.fr>; Sun, 3 Jan 2010 13:52:26 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id o032qIgo004638
	for <submit@pari.math.u-bordeaux.fr>; Sun, 3 Jan 2010 13:52:18 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id o032qI7M004637
	for submit@pari.math.u-bordeaux.fr; Sun, 3 Jan 2010 13:52:18 +1100 (EST)
	(envelope-from peter)
Date: Sun, 3 Jan 2010 13:52:18 +1100
From: Peter Jeremy <peterjeremy@acm.org>
To: submit@pari.math.u-bordeaux.fr
Message-ID: <20100103025217.GE32012@server.vk2pj.dyndns.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="AjmyJqqohANyBN/e"
Content-Disposition: inline
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.20 (2009-06-14)
[Message part 1 (text/plain, inline)]
Package: pari
Version: 2.3.4
Tags: patch

FreeBSD refers to the x86_64 architecture under its original name of
'amd64'.  Since pari is only looking for x86_64, it fails to correctly
recognize that it needs to add '-fPIC' to the shared library compilation.

This is reported during ./Configure:
        Warning ! architecture amd64 not tested

When (eg) "make bench" is then attempted, it fails with:

/usr/bin/gcc  -o libpari.so.2.3.4 -shared  -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer  -Wl,-shared,-soname=libpari.so.2 mp.o mpinl.o Flx.o Qfb.o RgX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o base3.o base4.o base5.o bibli1.o bibli2.o buch1.o buch2.o buch3.o buch4.o galconj.o gen1.o gen2.o gen3.o ifactor1.o perm.o polarit1.o polarit2.o polarit3.o rootpol.o subcyclo.o subgroup.o trans1.o trans2.o trans3.o anal.o compat.o default.o errmsg.o es.o init.o intnum.o members.o sumiter.o aprcl.o elldata.o elliptic.o galois.o groupid.o kummer.o mpqs.o nffactor.o part.o stark.o subfield.o thue.o -lc -lm 
/usr/bin/ld: mp.o: relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
mp.o: could not read symbols: Bad value
*** Error code 1

Stop in /home/peter/pari-2.3.4/Ofreebsd-amd64.

A suitable patch
--- config/get_kernel.orig	2008-01-17 02:56:55.000000000 +1100
+++ config/get_kernel	2010-01-03 13:47:23.793813344 +1100
@@ -12,7 +12,7 @@
            4) asmarch=ix86;;
            8) asmarch=x86_64;;
            esac;                        pretty=$arch ;;
-  x86_64)  case "$sizeof_long" in   
+  x86_64|amd64)  case "$sizeof_long" in   
            4) asmarch=ix86;;
            8) asmarch=x86_64;;
            esac;                        pretty='amd64';;
--- config/get_dlcflags.orig	2008-01-17 02:57:08.000000000 +1100
+++ config/get_dlcflags	2010-01-03 13:48:42.292305797 +1100
@@ -4,7 +4,7 @@
   # *-i?86|*-sparc*|*-powerpc|*-s390|*-mips) DLCFLAGS=
   case "$osname-$arch" in
     *-hppa|*-ia64|*-alpha|*-arm|*-m68k) DLCFLAGS=-fPIC ;;
-    *-x86_64|*-sparc*) case "$sizeof_long" in 
+    *-x86_64|*-sparc*|*-amd64) case "$sizeof_long" in 
               8) DLCFLAGS=-fPIC;;
               esac;;
     darwin-*) DLCFLAGS=-fno-common;;


-- 
Peter Jeremy
[Message part 2 (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Bill Allombert <allomber@math.u-bordeaux.fr>. Last modified: Sat Aug 26 17:13:30 2023; Machine Name: pari

PARI/GP Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.