NetBSD Problem Report #38417

From martin@duskware.de  Sun Apr 13 11:44:13 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id DE22763B9EE
	for <gnats-bugs@gnats.netbsd.org>; Sun, 13 Apr 2008 11:44:13 +0000 (UTC)
Message-Id: <20080412145922.730AD63B8C8@narn.NetBSD.org>
Date: Sat, 12 Apr 2008 14:59:22 +0000 (UTC)
From: peter.schuller@infidyne.com
Reply-To: peter.schuller@infidyne.com
To: netbsd-bugs-owner@NetBSD.org
Subject: [patch] devel/libsigsegv does not build on freebsd/amd64
X-Send-Pr-Version: www-1.0

>Number:         38417
>Category:       pkg
>Synopsis:       [patch] devel/libsigsegv does not build on freebsd/amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 13 11:45:00 +0000 2008
>Last-Modified:  Sun Mar 27 18:40:53 +0000 2011
>Originator:     Peter Schuller
>Release:        
>Organization:
>Environment:
FreeBSD/amd64
>Description:
The configure scripts selects fault-freebsd-i386.h, which claims sc_esp is the stack pointer. sigcontext does not have an sc_esp member on amd64, resulting in a compilation error.

The FreeBSD ports version of libsigsegv ends up defaulting to fault-bsd.h, which disables the use of the stack pointer.


>How-To-Repeat:

>Fix:
This patch adds a new configuration header to define appropriate values for freebsd on x86_64, and uses that instead of defaulting to fault-bsd:

http://distfiles.scode.org/mlref/pkgsrc_devel_libsigsegv_fbsd_amd64_esp_rsp.diff

Included inline below, but whitespace may be borked:

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libsigsegv/distinfo,v
retrieving revision 1.4
diff -u -r1.4 distinfo
--- distinfo    29 Nov 2007 18:25:22 -0000      1.4
+++ distinfo    12 Apr 2008 14:56:45 -0000
@@ -3,4 +3,5 @@
 SHA1 (libsigsegv-2.5.tar.gz) = 84cf08a9aae4c4d884333421018d8127592e8c2b
 RMD160 (libsigsegv-2.5.tar.gz) = 1776563a76de4286461a779cfd2b3b47533db05e
 Size (libsigsegv-2.5.tar.gz) = 380512 bytes
-SHA1 (patch-aa) = 4786b1362d9277d4b654e8978514a7cd454eeaaa
+SHA1 (patch-aa) = 70f6d219996c7f1a80eacb8add2fc51b61042be6
+SHA1 (patch-ab) = 5501e63a94abcb2c70b747bb308ef458e9eb4f55
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libsigsegv/patches/patch-aa,v
retrieving revision 1.1
diff -u -r1.1 patch-aa
--- patches/patch-aa    24 Jul 2006 13:39:26 -0000      1.1
+++ patches/patch-aa    12 Apr 2008 14:56:45 -0000
@@ -1,31 +1,20 @@
 $NetBSD: patch-aa,v 1.1 2006/07/24 13:39:26 joerg Exp $

---- configure.orig     2006-07-24 13:19:19.000000000 +0000
+--- configure.orig     2008-04-12 16:48:26.717100600 +0200
 +++ configure
-@@ -18825,7 +18825,7 @@ done
- 
- 
- case "$host_os" in
--  sunos4* | freebsd* | openbsd* | netbsd*)
-+  sunos4* | freebsd* | openbsd* | netbsd* | dragonfly*)
-     CFG_SIGNALS=signals-bsd.h ;;
-   hpux*)
-     CFG_SIGNALS=signals-hpux.h ;;
-@@ -22583,7 +22583,7 @@ if test -z "$CFG_FAULT" && test "$sv_cv_
- fi
- if test -z "$CFG_FAULT" && test "$sv_cv_fault_bsd" = yes; then
+@@ -23353,10 +23353,14 @@ if test -z "$CFG_FAULT" && test "$sv_cv_
    case "$host_os" in
--    freebsd*)
-+    freebsd* | dragonfly*)
+     freebsd*)
        case "$host_cpu" in
-         i?86 | x86_64)
+-        i?86 | x86_64)
++        i?86)
            CFG_FAULT=fault-freebsd-i386.h
-@@ -23072,7 +23072,7 @@ if test $sv_cv_procfsvma = yes; then
- else
-   case "$host_os" in
-     linux*) CFG_STACKVMA=stackvma-linux.c ;;
--    freebsd*) CFG_STACKVMA=stackvma-freebsd.c ;;
-+    freebsd* | dragonfly*) CFG_STACKVMA=stackvma-freebsd.c ;;
-     beos*) CFG_STACKVMA=stackvma-beos.c ;;
-     macos* | darwin*) CFG_STACKVMA=stackvma-mach.c ;;
-   esac
+           FAULT_CONTEXT='struct sigcontext'
+           ;;
++        x86_64)
++          CFG_FAULT=fault-freebsd-x86_64.h
++          FAULT_CONTEXT='struct sigcontext'
++          ;;
+         *)
+           CFG_FAULT=fault-bsd.h
+           FAULT_CONTEXT='void'
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-ab    12 Apr 2008 14:56:45 -0000
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- src/fault-freebsd-x86_64.h.orig    2008-04-12 16:49:14.991057485 +0200
++++ src/fault-freebsd-x86_64.h
+@@ -0,0 +1,21 @@
++/* Fault handler information.  FreeBSD/i386 version.
++   Copyright (C) 2002  Bruno Haible <bruno@clisp.org>
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
++
++#define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, int code, struct sigcontext *scp, void *addr
++#define SIGSEGV_FAULT_ADDRESS  addr
++#define SIGSEGV_FAULT_CONTEXT  scp
++#define SIGSEGV_FAULT_STACKPOINTER  scp->sc_rsp

>Release-Note:

>Audit-Trail:
[20110327 shattered] edited Environment: field

Responsible-Changed-From-To: pkg-manager->freebsd-pkg-people
Responsible-Changed-By: snj@NetBSD.org
Responsible-Changed-When: Tue, 15 Apr 2008 00:05:09 +0000
Responsible-Changed-Why:
FreeBSD problem.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.