From lichray@gmail.com  Sun May  8 10:50:43 2011
Return-Path: <lichray@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C88C106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 May 2011 10:50:43 +0000 (UTC)
	(envelope-from lichray@gmail.com)
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182])
	by mx1.freebsd.org (Postfix) with ESMTP id EB7EE8FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 May 2011 10:50:42 +0000 (UTC)
Received: by iwn33 with SMTP id 33so5190072iwn.13
        for <FreeBSD-gnats-submit@freebsd.org>; Sun, 08 May 2011 03:50:42 -0700 (PDT)
Received: by 10.42.130.130 with SMTP id v2mr5107277ics.233.1304851842224;
        Sun, 08 May 2011 03:50:42 -0700 (PDT)
Received: from compaq.yuetime (c-98-228-191-105.hsd1.il.comcast.net [98.228.191.105])
        by mx.google.com with ESMTPS id xe5sm1957739icb.10.2011.05.08.03.50.39
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 08 May 2011 03:50:41 -0700 (PDT)
Received: by compaq.yuetime (sSMTP sendmail emulation); Sun, 08 May 2011 05:50:34 -0500
Message-Id: <4dc67581.853f2b0a.6fde.7b47@mx.google.com>
Date: Sun, 08 May 2011 05:50:34 -0500
From: Zhihao Yuan <lichray@gmail.com>
Reply-To: Zhihao Yuan <lichray@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: devel/valgrind: Fix build with newer gcc
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         156881
>Category:       ports
>Synopsis:       devel/valgrind: Fix build with newer gcc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    scheidell
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 08 11:00:17 UTC 2011
>Closed-Date:    Sat Dec 03 19:27:57 UTC 2011
>Last-Modified:  Sat Dec  3 19:30:12 UTC 2011
>Originator:     Zhihao Yuan
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
Northern Illinois University
>Environment:
System: FreeBSD compaq.yuetime 8.2-STABLE FreeBSD 8.2-STABLE #0: Mon Mar 14 02:51:28 CDT 2011 root@compaq.yuetime:/usr/obj/usr/src/sys/HOUKAGO amd64


	
>Description:
	
	The bare __aligned attribute no longer exists in new gcc (like gcc46 on my system). The following patch replaces it with the standard __attribute__.
>How-To-Repeat:
	
>Fix:

	

--- patch-include_vki_vki-x86-freebsd.h begins here ---
--- include/vki/vki-x86-freebsd.h.orig	2011-04-27 02:47:18.000000000 -0500
+++ include/vki/vki-x86-freebsd.h	2011-05-08 05:39:46.293802771 -0500
@@ -145,7 +145,7 @@ struct vki_sigcontext {
 	int	fpformat;
 	int	ownedfp;
 	int	spare1[1];
-	struct _vki_fpstate fpstate __aligned(16);
+	struct _vki_fpstate fpstate __attribute__((__aligned__(16)));
 	int	fsbase;
 	int	gsbase;
 	int	spare2[6];
@@ -215,7 +215,7 @@ struct vki_mcontext {
 	int	fpformat;
 	int	ownedfp;
 	int	spare1[1];
-	struct _vki_fpstate fpstate __aligned(16);
+	struct _vki_fpstate fpstate __attribute__((__aligned__(16)));
 	int	fsbase;
 	int	gsbase;
 	int	spare2[6];
--- patch-include_vki_vki-x86-freebsd.h ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->stas 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun May 8 11:00:28 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156881 
Responsible-Changed-From-To: stas->freebsd-ports-bugs 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Sat Nov 5 04:12:41 UTC 2011 
Responsible-Changed-Why:  
- back to the heap 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156881 
Responsible-Changed-From-To: freebsd-ports-bugs->scheidell  
Responsible-Changed-By: scheidell 
Responsible-Changed-When: Fri Dec 2 22:31:40 UTC 2011 
Responsible-Changed-Why:  
ill take a look at it 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156881 
State-Changed-From-To: open->feedback  
State-Changed-By: scheidell 
State-Changed-When: Fri Dec 2 23:20:11 UTC 2011 
State-Changed-Why:  
i just tried this on valgrind 3.6.1_2,1, and FreeBSD 7.4, 8.2 and 9.0RC2 and it compiled just fine. 
(they seem to have older gcc installed by default) 
Could you clarify? 
did you install gcc46 from ports? 
could you come up with a patch/.ifdef/ test for newer version so that 
this does not interfeer with stock/standard included gcc? 
or, are you thinking that this patch will be upward compatible with older gcc? 


http://www.freebsd.org/cgi/query-pr.cgi?pr=156881 

From: Zhihao Yuan <lichray@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/156881: devel/valgrind: Fix build with newer gcc
Date: Fri, 2 Dec 2011 18:37:27 -0600

 No, it still does not build.
 
 In file included from ../include/vki/vki-freebsd.h:203:0,
                  from ../include/pub_tool_vki.h:51,
                  from mc_leakcheck.c:32:
 ../include/vki/vki-x86-freebsd.h:148:30: error: expected ':', ',',
 ';', '}' or '__attribute__' before '__aligned'
 ../include/vki/vki-x86-freebsd.h:218:30: error: expected ':', ',',
 ';', '}' or '__attribute__' before '__aligned'
 gmake[3]: *** [memcheck_x86_freebsd-mc_leakcheck.o] Error 1
 
 At least, the new attribute is supported >= gcc-4.2, which is the
 stock compiler.
 
 -- 
 Zhihao Yuan, nickname lichray
 The best way to predict the future is to invent it.
 ___________________________________________________
 4BSD -- http://4bsd.biz/
State-Changed-From-To: feedback->closed  
State-Changed-By: scheidell 
State-Changed-When: Sat Dec 3 19:27:30 UTC 2011 
State-Changed-Why:  
Committed, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156881 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/156881: commit references a PR
Date: Sat,  3 Dec 2011 19:27:30 +0000 (UTC)

 scheidell    2011-12-03 19:27:22 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/valgrind       Makefile 
   Added files:
     devel/valgrind/files patch-include_vki_vki-x86-freebsd.h 
   Log:
   -The base __aligned attribute no longer exists in gcc46+
   -patch uses __attribute__ which is upward compatible with gcc42+
   
   PR:             ports/156881
   Submitted by:   Zhihao Yuan <lichray@gmail.com>
   Approved by:    maintainer(timeout), gaboe(mentor)
   Feature safe:   yes
   
   Revision  Changes    Path
   1.52      +2 -6      ports/devel/valgrind/Makefile
   1.1       +20 -0     ports/devel/valgrind/files/patch-include_vki_vki-x86-freebsd.h (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
