NetBSD Problem Report #47541

From o.vd.linden@quicknet.nl  Thu Feb  7 21:43:53 2013
Return-Path: <o.vd.linden@quicknet.nl>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 87BD563EE15
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  7 Feb 2013 21:43:53 +0000 (UTC)
Message-Id: <20130207214345.GA28014@sheep>
Date: Thu, 7 Feb 2013 22:43:45 +0100
From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@NetBSD.org
Subject: devel/libFoundation fails to build on x86 and doesn't need devel/gnustep-objc-lf2

>Number:         47541
>Category:       pkg
>Synopsis:       devel/libFoundation fails to build on x86 and doesn't need gnustep-objc-lf2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 07 21:45:00 +0000 2013
>Originator:     Onno van der Linden
>Release:        NetBSD 6.99.16
>Organization:
>Environment:
System: NetBSD sheep 6.99.16 NetBSD 6.99.16 (SHEEP) #41: Tue Jan 1 14:08:03 MET 2013 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386
Architecture: i386
Machine: i386
>Description:
devel/libFoudation currently does not build on x86. It's caused by
1) gnustep-make/gnustep.mk setting GNU_STEP_HOST to a wrong value if
   MACHINE_GNU_ARCH equals i[456]86
2) gnustep-make/Makefile setting GNUSTEP_ARCH to wrong value if
   MACHINE_ARCH equals i[456]86
3) libFoundation/common.mk not using the already existing config/i386
   directory for the already mentioned i[456]86 case.
Additionally 
1) libFoundation's Changelog says that devel/gnustep-objc-lf2
   is no longer needed to compile the library:
   "Foundation/NSConcreteString.m: activated NSConstantString, deactivated
   NXConstantString, this requires GCC 3 plus a matching runtime (libobjc.1),
   it obsoletes the lF specific libobjc.lf". This is for 1.1.0
   and we're on 1.1.7 and do have gcc 3. If needed the fix in the
   diff for this can be changed to something that depends on a
   compiler (version). Or we can throw that library away altogether.
2) gnustep-make/gnustep.mk's PKGSRC_COMPILER += line seems to
   unconditionally add -Qunused-arguments which is nice for clang
   but gcc doesn't like it. In the diff I threw that line out.
   Not sure if it's completely right though.
3) after the patches are applied gcc compiles fine, however clang will
   not compile libFoundation with PKG_OPTIONS.gnustep=fragile in
   /etc/mk.conf on my x86 machine, complaining about several illegal
   (syntax) constructions.
>How-To-Repeat:
On a x86 machine with PKG_OPTIONS.gnu=fragile in /etc/mk.conf
(non-fragile is 64-bit only afaict):
cd /usr/pkgsrc/devel/libFoundation
make
>Fix:
--- /usr/pkgsrc/devel/gnustep-make/Makefile.orig	2013-01-30 17:44:57
+++ /usr/pkgsrc/devel/gnustep-make/Makefile	2013-02-07 17:09:15
@@ -37,7 +37,7 @@
 CONFIGURE_ARGS+=	--enable-objc-nonfragile-abi
 .endif

-.if ${MACHINE_ARCH} == "i386"
+.if ${GNUSTEP_HOST_CPU} == "ix86"
 GNUSTEP_ARCH=	ix86
 .else
 GNUSTEP_ARCH=	${MACHINE_ARCH}
--- /usr/pkgsrc/devel/gnustep-make/gnustep.mk.orig	2013-02-01 17:41:13
+++ /usr/pkgsrc/devel/gnustep-make/gnustep.mk	2013-02-07 20:51:38
@@ -6,7 +6,6 @@
 .ifndef GNUSTEP_SKIP_DEFAULT_OPTIONS
 PKG_OPTIONS_VAR?=	PKG_OPTIONS.gnustep
 PKG_SUPPORTED_OPTIONS+=	fragile
-PKGSRC_COMPILER+=	clang

 .include "../../mk/bsd.options.mk"

@@ -25,7 +24,7 @@
 GNUSTEP_NETWORK_ROOT=	${GNUSTEP_ROOT}/Network
 GNUSTEP_MAKEFILES=	${GNUSTEP_ROOT}/${GNUSTEP_SUBDIR}/Makefiles
 GNUSTEP_HOST=		${MACHINE_GNU_PLATFORM}
-GNUSTEP_HOST_CPU=	${MACHINE_GNU_ARCH:S/i386/ix86/}
+GNUSTEP_HOST_CPU=	${MACHINE_GNU_ARCH:C/i[3-6]86/ix86/}
 GNUSTEP_HOST_VENDOR=	${LOWER_VENDOR}
 GNUSTEP_HOST_OS=	${LOWER_OPSYS}
 GNUSTEP_CONFIG_FILE=	${PKG_SYSCONFDIR}/GNUstep.conf
--- /usr/pkgsrc/devel/libFoundation/Makefile.orig	2013-01-31 23:04:53
+++ /usr/pkgsrc/devel/libFoundation/Makefile	2013-02-07 17:14:55
@@ -25,7 +25,6 @@
 PLIST_SUBST+=	LIBF_HOST_OS=${LIBF_HOST_OS}

 .include "../../devel/gnustep-make/buildlink3.mk"
-.include "../../devel/gnustep-objc-lf2/buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"

 post-configure:
--- /usr/pkgsrc/devel/libFoundation/buildlink3.mk.orig	2013-02-01 00:09:07
+++ /usr/pkgsrc/devel/libFoundation/buildlink3.mk	2013-02-01 00:09:27
@@ -18,7 +18,6 @@
 .endif

 .include "../../devel/gnustep-make/buildlink3.mk"
-.include "../../devel/gnustep-objc-lf2/buildlink3.mk"
 .endif	# LIBFOUNDATION_BUILDLINK3_MK

 BUILDLINK_TREE+=	-libFoundation
--- /usr/pkgsrc/devel/libFoundation/common.mk.orig	2013-01-30 21:38:35
+++ /usr/pkgsrc/devel/libFoundation/common.mk	2013-02-07 21:43:41
@@ -21,7 +21,11 @@
 PLIST_SUBST+=	LIBF_HOST_OS=${LIBF_HOST_OS}

 pre-configure:
+.if ${GNUSTEP_HOST_CPU} == "ix86"
+	${LN} -s i386 ${WRKSRC}/config/${MACHINE_GNU_ARCH}
+.else
 	${MKDIR} ${WRKSRC}/config/${MACHINE_GNU_ARCH}
+.endif
 	[ -e ${WRKSRC}/config/${MACHINE_GNU_ARCH}/${GNUSTEP_HOST_OS}.h ] || \
 	${LN} -s linux.h ${WRKSRC}/config/${MACHINE_GNU_ARCH}/${GNUSTEP_HOST_OS}.h
 .if ${GNUSTEP_HOST_OS} != ${LIBF_HOST_OS}

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.