[Gmp-commit] /var/hg/gmp: Handle OpenBSD like Darwin for fat x86-64 builds.

mercurial at gmplib.org mercurial at gmplib.org
Mon Nov 4 17:46:31 CET 2013


details:   /var/hg/gmp/rev/43961d4410bb
changeset: 16084:43961d4410bb
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Nov 04 17:46:29 2013 +0100
description:
Handle OpenBSD like Darwin for fat x86-64 builds.

diffstat:

 ChangeLog                    |   7 +++++++
 configure.ac                 |   2 ++
 mpn/x86_64/fat/fat_entry.asm |  19 ++++++++++---------
 3 files changed, 19 insertions(+), 9 deletions(-)

diffs (79 lines):

diff -r 68ca07e37764 -r 43961d4410bb ChangeLog
--- a/ChangeLog	Wed Oct 30 20:52:42 2013 +0100
+++ b/ChangeLog	Mon Nov 04 17:46:29 2013 +0100
@@ -1,3 +1,10 @@
+2013-11-04  Torbjorn Granlund  <tege at gmplib.org>
+
+	* configure.ac: Set symbol OPENBSD for x86-openbsd hosts.
+	* mpn/x86_64/fat/fat_entry.asm (PRETEND_PIC): New name for
+	PIC_OR_DARWIN.
+	(PRETEND_PIC): Set also for OPENBSD.
+
 2013-10-29  Torbjorn Granlund  <tege at gmplib.org>
 
 	* printf/doprnt.c (__gmp_doprnt): Use memcpy instead of strcpy.
diff -r 68ca07e37764 -r 43961d4410bb configure.ac
--- a/configure.ac	Wed Oct 30 20:52:42 2013 +0100
+++ b/configure.ac	Mon Nov 04 17:46:29 2013 +0100
@@ -3567,6 +3567,8 @@
 	      GMP_INCLUDE_MPN(x86_64/darwin.m4) ;;
 	    *-*-mingw* | *-*-cygwin)
 	      GMP_INCLUDE_MPN(x86_64/dos64.m4) ;;
+	    *-openbsd*)
+	      GMP_DEFINE_RAW(["define(<OPENBSD>,1)"]) ;;
 	  esac
           ;;
       esac
diff -r 68ca07e37764 -r 43961d4410bb mpn/x86_64/fat/fat_entry.asm
--- a/mpn/x86_64/fat/fat_entry.asm	Wed Oct 30 20:52:42 2013 +0100
+++ b/mpn/x86_64/fat/fat_entry.asm	Mon Nov 04 17:46:29 2013 +0100
@@ -3,7 +3,7 @@
 dnl  Contributed to the GNU project by Kevin Ryde (original x86_32 code) and
 dnl  Torbjorn Granlund (port to x86_64)
 
-dnl  Copyright 2003, 2009, 2011, 2012 Free Software Foundation, Inc.
+dnl  Copyright 2003, 2009, 2011, 2012, 2013 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -33,15 +33,16 @@
 define(`WANT_PROFILING',no)
 
 
-dnl  We define PIC_OR_DARWIN as a helper symbol, the use it for suppressing
-dnl  normal, fast call code, since that triggers problems on darwin.
-dnl
-dnl  FIXME: There might be a more elegant solution, adding less overhead.
+dnl  We define PRETEND_PIC as a helper symbol, the use it for suppressing
+dnl  normal, fast call code, since that triggers problems on Darwin and
+dnl  OpenBSD.
 
 ifdef(`DARWIN',
-`define(`PIC_OR_DARWIN')')
+`define(`PRETEND_PIC')')
+ifdef(`OPENBSD',
+`define(`PRETEND_PIC')')
 ifdef(`PIC',
-`define(`PIC_OR_DARWIN')')
+`define(`PRETEND_PIC')')
 
 ABI_SUPPORT(DOS64)
 ABI_SUPPORT(STD64)
@@ -81,7 +82,7 @@
 ',
 `	ALIGN(ifdef(`PIC',16,8))
 `'PROLOGUE($1)
-ifdef(`PIC_OR_DARWIN',
+ifdef(`PRETEND_PIC',
 `	LEA(	GSYM_PREFIX`'__gmpn_cpuvec, %rax)
 	jmp	*$2(%rax)
 ',`dnl non-PIC
@@ -160,7 +161,7 @@
 	pop	%rdx
 IFSTD(`	pop	%rsi	')
 IFSTD(`	pop	%rdi	')
-ifdef(`PIC_OR_DARWIN',`
+ifdef(`PRETEND_PIC',`
 	LEA(	GSYM_PREFIX`'__gmpn_cpuvec, %r10)
 	jmp	*(%r10,%rax,8)
 ',`dnl non-PIC


More information about the gmp-commit mailing list