NetBSD Problem Report #42865
From www@NetBSD.org Mon Feb 22 16:17:23 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id D8E4D63C596
for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 Feb 2010 16:17:22 +0000 (UTC)
Message-Id: <20100222161722.A9FBA63C49F@www.NetBSD.org>
Date: Mon, 22 Feb 2010 16:17:22 +0000 (UTC)
From: joern.clausen@uni-bielefeld.de
Reply-To: joern.clausen@uni-bielefeld.de
To: gnats-bugs@NetBSD.org
Subject: devel/libffi does not compile on Solaris
X-Send-Pr-Version: www-1.0
>Number: 42865
>Category: pkg
>Synopsis: devel/libffi does not compile on Solaris 10
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: solaris-pkg-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 22 16:20:00 +0000 2010
>Closed-Date: Tue Sep 27 15:24:51 +0000 2011
>Last-Modified: Tue Sep 27 15:24:51 +0000 2011
>Originator: Jörn Clausen
>Release:
>Organization:
University of Bielefeld
>Environment:
SunOS spare4200 5.10 Generic_141445-09 i86pc i386 i86pc
>Description:
compiling devel/libffi with lang/gcc34 on Solaris 10/x86 fails with
libtool: link: gcc -shared -Wl,-z -Wl,text -Wl,-h -Wl,libffi.so.5 -o .libs/libffi.so.5.0.10 src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o -L/software/pkgsrc/source/pkgsrc/devel/libffi/work.spare4200/.buildlink/gcc34/bin/../lib/gcc/i386-pc-solaris2.10/3.4.6 -L/software/pkgsrc/source/pkgsrc/devel/libffi/work.spare4200/.buildlink/gcc34/bin/../lib -L/software/pkgsrc/source/pkgsrc/devel/libffi/work.spare4200/.buildlink/gcc34/lib -L/software/pkgsrc/source/pkgsrc/devel/libffi/work.spare4200/.buildlink/lib -lc -Wl,-R/usr/pkgsrc/20090630/gcc34/lib -Wl,-R/usr/pkgsrc/20090630/lib
Text relocation remains referenced
against symbol offset in file
ffi_closure_SYSV_inner 0xd2 src/x86/.libs/sysv.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Mon, 22 Feb 2010 19:43:47 +0000
Responsible-Changed-Why:
Solaris pkgsrc problem.
From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/42865
Date: Tue, 27 Sep 2011 17:04:08 +0200
Andreas Tobler did a thorough analysis of this problem, and he suggested
two possible fixes:
Either in devel/libffi
--- Makefile 2011/09/27 09:37:15 1.1
+++ Makefile 2011/09/27 09:44:38
@@ -42,4 +42,8 @@
LIBS+= -lm68k
.endif
+.if !empty(MACHINE_PLATFORM:MSunOS-*-i386) && !empty(CC_VERSION:Mgcc-[23]*)
+CPPFLAGS += -D__PIC__
+.endif
+
.include "../../mk/bsd.pkg.mk"
I have tested this and can confirm that libffi now compiles.
Or this patch against GCC:
--- gcc/config/sol2.h (revision 178719)
+++ gcc/config/sol2.h (working copy)
@@ -73,6 +73,11 @@
builtin_define ("_LARGEFILE64_SOURCE=1"); \
builtin_define ("__EXTENSIONS__"); \
} \
+ if (flag_pic) \
+ { \
+ builtin_define ("__PIC__"); \
+ builtin_define ("__pic__"); \
+ } \
TARGET_SUB_OS_CPP_BUILTINS(); \
} while (0)
which I haven't tested and can't comment on.
--
Jörn Clausen joern.clausen@uni-bielefeld.de
Hochschulrechenzentrum http://www.uni-bielefeld.de/hrz/
Universität Bielefeld
From: "Tim Zingelman" <tez@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/42865 CVS commit: pkgsrc/devel/libffi
Date: Tue, 27 Sep 2011 15:12:37 +0000
Module Name: pkgsrc
Committed By: tez
Date: Tue Sep 27 15:12:37 UTC 2011
Modified Files:
pkgsrc/devel/libffi: Makefile
Log Message:
Fix build for Solaris x86 with older gcc per PR#42865
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 pkgsrc/devel/libffi/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: tez@NetBSD.org
State-Changed-When: Tue, 27 Sep 2011 15:24:51 +0000
State-Changed-Why:
confirmed working patch applied. Thanks for the patch!
>Unformatted:
(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.