NetBSD Problem Report #43928

From www@NetBSD.org  Wed Sep 29 15:39:03 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 4E44A63B8E6
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 29 Sep 2010 15:39:03 +0000 (UTC)
Message-Id: <20100929153903.1375A63B8DB@www.NetBSD.org>
Date: Wed, 29 Sep 2010 15:39:03 +0000 (UTC)
From: davshao@gmail.com
Reply-To: davshao@gmail.com
To: gnats-bugs@NetBSD.org
Subject: pkgsrc cairo 1.10 128-bit integer division problem with gcc 4.1 on DragonFly BSD x86_64
X-Send-Pr-Version: www-1.0

>Number:         43928
>Category:       pkg
>Synopsis:       pkgsrc cairo 1.10 128-bit integer division problem with gcc 4.1 on DragonFly BSD x86_64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dfly-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 29 15:40:00 +0000 2010
>Closed-Date:    Sun Nov 28 14:07:42 +0000 2010
>Last-Modified:  Sun Nov 28 14:10:02 +0000 2010
>Originator:     David Shao
>Release:        DragonFly BSD 2.7.3 with patches from Linux 2.6.34 drm
>Organization:
>Environment:
DragonFly  2.7-DEVELOPMENT DragonFly v2.7.3.940.g0b3b7-DEVELOPMENT #0: Sat Sep 25 00:06:50 UTC 2010     root@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
>Description:
This bug is similar to one encountered by DragonFly BSD for gstreamer in NetBSD Problem Report #43082.

128-bit integer division using gcc 4.1 on DragonFly BSD x86_64 is optimized to use internal functions that are not actually defined, causing linkage errors when trying to build say pango.


>How-To-Repeat:
pkgsrc git on DragonFly BSD latest commit

    commit c60a0b325ed2e28931e45d849c6dbb2c093fe737
    Date:   Sat Sep 25 12:29:01 2010 +0000

I have not tested on i386 DragonFly BSD; however, the similar gstreamer bug manifested itself only on x86_64.



>Fix:
The following is only a partial fix as it patches the configure script to simply not set either HAVE_UINT128_T or HAVE___UINT128_T to 1 on
DragonFly BSD.   It does not account for the difference between x86_64 and i386; nor does it account for DragonFly BSD possibly switching someday to gcc 4.4+ as the default compiler.

diff --git a/graphics/cairo/distinfo b/graphics/cairo/distinfo
index 61fd9fa..b67edea 100644
--- a/graphics/cairo/distinfo
+++ b/graphics/cairo/distinfo
@@ -4,5 +4,5 @@ SHA1 (cairo-1.10.0.tar.gz) = efe7e47408d5188690228ccadc8523652f6bf702
 RMD160 (cairo-1.10.0.tar.gz) = fa65d4f3926308857d13f3ed0c100f89f075dc01
 Size (cairo-1.10.0.tar.gz) = 24022822 bytes
 SHA1 (patch-aa) = f211b2a5fce4ff65f280f79fbb78e1a530b9b165
-SHA1 (patch-ab) = cf6031bdbda5162ac6929be5cd2b8313882c75ed
+SHA1 (patch-ab) = f0f31b10d61600d1600b2a299b97d22e2462bd7b
 SHA1 (patch-ac) = 76f29729c2b0ed3b1dc98960e1d9c9061a1b1440
diff --git a/graphics/cairo/patches/patch-ab b/graphics/cairo/patches/patch-ab
index 72d3df0..42dc6c8 100644
--- a/graphics/cairo/patches/patch-ab
+++ b/graphics/cairo/patches/patch-ab
@@ -2,9 +2,47 @@ $NetBSD$

 Fix unportable test construct.

---- configure.orig	2010-09-13 11:08:31.000000000 +0000
+--- configure.orig	2010-09-06 16:16:46 +0000
 +++ configure
-@@ -21447,7 +21447,7 @@ xlib_xcb_NONPKGCONFIG_LIBS="$ac_env_xlib
+@@ -18258,19 +18258,35 @@ fi
+ ac_fn_c_check_type "$LINENO" "uint128_t" "ac_cv_type_uint128_t" "$ac_includes_default"
+ if test "x$ac_cv_type_uint128_t" = x""yes; then :
+ 
++case $host_os in
++dragonfly*)
++cat >>confdefs.h <<_ACEOF
++#define HAVE_UINT128_T 0
++_ACEOF
++;;
++*)
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_UINT128_T 1
+ _ACEOF
+-
++;;
++esac
+ 
+ fi
+ ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default"
+ if test "x$ac_cv_type___uint128_t" = x""yes; then :
+ 
++case $host_os in
++dragonfly*)
++cat >>confdefs.h <<_ACEOF
++#define HAVE___UINT128_T 0
++_ACEOF
++;;
++*)
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE___UINT128_T 1
+ _ACEOF
+-
++;;
++esac
+ 
+ fi
+ 
+@@ -21447,7 +21463,7 @@ xlib_xcb_NONPKGCONFIG_LIBS="$ac_env_xlib
  xlib_xcb_NONPKGCONFIG_EXTRA_LIBS="$ac_env_xlib_xcb_NONPKGCONFIG_EXTRA_LIBS_value"


@@ -13,7 +51,7 @@ Fix unportable test construct.
      xlib_xcb_REQUIRES="x11-xcb"

  pkg_failed=no
-@@ -21797,7 +21797,7 @@ xcb_shm_NONPKGCONFIG_LIBS="$ac_env_xcb_s
+@@ -21797,7 +21813,7 @@ xcb_shm_NONPKGCONFIG_LIBS="$ac_env_xcb_s
  xcb_shm_NONPKGCONFIG_EXTRA_LIBS="$ac_env_xcb_shm_NONPKGCONFIG_EXTRA_LIBS_value"


@@ -22,7 +60,7 @@ Fix unportable test construct.
        xcb_shm_REQUIRES="xcb-shm"

  pkg_failed=no
-@@ -25203,7 +25203,7 @@ drm_xr_NONPKGCONFIG_LIBS="$ac_env_drm_xr
+@@ -25203,7 +25219,7 @@ drm_xr_NONPKGCONFIG_LIBS="$ac_env_drm_xr
  drm_xr_NONPKGCONFIG_EXTRA_LIBS="$ac_env_drm_xr_NONPKGCONFIG_EXTRA_LIBS_value"


@@ -31,7 +69,7 @@ Fix unportable test construct.
        drm_xr_REQUIRES="xorg-server >= 1.6 xproto xextproto >= 7.0.99.1 renderproto x11"

  pkg_failed=no
-@@ -25845,7 +25845,7 @@ xcb_drm_NONPKGCONFIG_LIBS="$ac_env_xcb_d
+@@ -25845,7 +25861,7 @@ xcb_drm_NONPKGCONFIG_LIBS="$ac_env_xcb_d
  xcb_drm_NONPKGCONFIG_EXTRA_LIBS="$ac_env_xcb_drm_NONPKGCONFIG_EXTRA_LIBS_value"


@@ -40,3 +78,14 @@ Fix unportable test construct.
        xcb_drm_REQUIRES="xcb-dri2"

  pkg_failed=no
+@@ -35496,6 +35512,10 @@ do
+   case $ac_option in
+   # Handling of the options.
+   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++	: Avoid regenerating within pkgsrc
++	exit 0
++	: Avoid regenerating within pkgsrc
++	exit 0
+     ac_cs_recheck=: ;;
+   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+     $as_echo "$ac_cs_version"; exit ;;

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->dfly-pkg-people
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Thu, 30 Sep 2010 11:27:19 +0000
Responsible-Changed-Why:
Dragonfly pkgsrc problem.


State-Changed-From-To: open->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Sun, 28 Nov 2010 14:07:42 +0000
State-Changed-Why:
Fixed by 1.10.0nb2 with different way.


From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43928 CVS commit: pkgsrc/graphics/cairo
Date: Sun, 28 Nov 2010 14:06:17 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sun Nov 28 14:06:17 UTC 2010

 Modified Files:
 	pkgsrc/graphics/cairo: Makefile

 Log Message:
 Add a workaround for 128-bit int problem with gcc 4.1 on DragonFly BSD x86_64.
 fixes PR#43928.


 To generate a diff of this commit:
 cvs rdiff -u -r1.85 -r1.86 pkgsrc/graphics/cairo/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>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.