Subject: pkg/36872: png-1.2.19 build failure on Intel Mac OS X (gcc4 issue) --PATCHES INCLUDED
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Mark E. Perkins <perkinsm@bway.net>
List: pkgsrc-bugs
Date: 08/31/2007 09:50:01
>Number: 36872
>Category: pkg
>Synopsis: png-1.2.19 build failure on Intel Mac OS X (gcc4 issue) --PATCHES INCLUDED
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 31 09:50:00 +0000 2007
>Originator: Mark E. Perkins
>Release: Darwin 8.10.1 i386
>Organization:
>Environment:
System: Darwin owl.fringe.mep 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386
>Description:
Inline assembly code is broken with gcc4 (apparently this is GCC Bug #25221):
gcc -dynamiclib -o .libs/libpng12.0.19.0.dylib .libs/libpng12_la-png.o .libs/libpng12_la-pngset.o .libs/libpng12_la-pngget.o .libs/libpng12_la-pngrutil.o .libs/libpng12_la-pngtrans.o .libs/libpng12_la-pngwutil.o .libs/libpng12_la-pngread.o .libs/libpng12_la-pngrio.o .libs/libpng12_la-pngwio.o .libs/libpng12_la-pngwrite.o .libs/libpng12_la-pngrtran.o .libs/libpng12_la-pngwtran.o .libs/libpng12_la-pngmem.o .libs/libpng12_la-pngerror.o .libs/libpng12_la-pngpread.o .libs/libpng12_la-pnggccrd.o -L/usr/pkgsrc/graphics/png/work/.buildlink/lib -lz -install_name /usr/pkg/lib/libpng12.0.dylib -Wl,-compatibility_version -Wl,20 -Wl,-current_version -Wl,20.0
ld: Undefined symbols:
_HBClearMask
_LBCarryMask
_amask0_8_0
_amask2_3_3
_amask4_2_2
_amask5_3_0
_amask6_2_0
_mask16_0
_mask16_1
_mask24_0
_mask24_1
_mask24_2
_mask32_0
_mask32_1
_mask32_2
_mask32_3
_mask48_0
_mask48_1
_mask48_2
_mask48_3
_mask48_4
_mask48_5
_mask8_0
/usr/bin/libtool: internal link edit command failed
*** Error code 1
Stop.
bmake: stopped in /usr/pkgsrc/graphics/png/work/libpng-1.2.19
*** Error code 1
>How-To-Repeat:
cd /usr/pkgsrc/graphics/png
bmake
>Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/png/Makefile,v
retrieving revision 1.92
diff -b -u -r1.92 Makefile
--- Makefile 29 Aug 2007 20:58:26 -0000 1.92
+++ Makefile 31 Aug 2007 09:37:31 -0000
@@ -28,6 +28,15 @@
CPPFLAGS+= -DPNG_NO_ASSEMBLER_CODE
.endif
+# Disable inline assembly on i386 until GCC Bug #25221 is fixed.
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25221
+.include "../../mk/compiler.mk"
+.if !empty(CC_VERSION:Mgcc-4.*)
+CPPFLAGS+= -DPNG_NO_ASSEMBLER_CODE
+.endif
+
+# end "keep this in sync ..."
+
SUBST_CLASSES+= rpathfix
SUBST_FILES.rpathfix= scripts/libpng-config.in
SUBST_MESSAGE.rpathfix= Adding rpath to libpng-config.
Index: buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/png/buildlink3.mk,v
retrieving revision 1.20
diff -b -u -r1.20 buildlink3.mk
--- buildlink3.mk 3 Jan 2007 20:38:46 -0000 1.20
+++ buildlink3.mk 31 Aug 2007 09:37:31 -0000
@@ -26,6 +26,16 @@
. if ${MACHINE_ARCH} != "i386"
CPPFLAGS+= -DPNG_NO_ASSEMBLER_CODE
. endif
+
+# Disable inline assembly on i386 until GCC Bug #25221 is fixed.
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25221
+.include "../../mk/compiler.mk"
+. if !empty(CC_VERSION:Mgcc-4.*)
+CPPFLAGS+= -DPNG_NO_ASSEMBLER_CODE
+. endif
+
+# end "keep this in sync ..."
+
.endif # PNG_BUILDLINK3_MK
.include "../../devel/zlib/buildlink3.mk"