From nobody@FreeBSD.org  Wed Dec 19 08:55:32 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id F257D926
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Dec 2012 08:55:31 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id D85DB8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Dec 2012 08:55:31 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qBJ8tV2P059850
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Dec 2012 08:55:31 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qBJ8tVui059849;
	Wed, 19 Dec 2012 08:55:31 GMT
	(envelope-from nobody)
Message-Id: <201212190855.qBJ8tVui059849@red.freebsd.org>
Date: Wed, 19 Dec 2012 08:55:31 GMT
From: Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [MAINTAINER] Improve build with clang
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174568
>Category:       ports
>Synopsis:       [MAINTAINER] devel/gdb: Improve build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rene
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 19 09:00:00 UTC 2012
>Closed-Date:    Mon Dec 24 22:27:22 UTC 2012
>Last-Modified:  Mon Dec 24 22:30:01 UTC 2012
>Originator:     Luca Pizzamiglio
>Release:        8-STABLE
>Organization:
>Environment:
reeBSD pizzamig.xxx 8.3-STABLE FreeBSD 8.3-STABLE #9: Thu Aug 23 16:22:24 CEST 2012     root@pizzamig.xxx:/usr/obj/usr/src/sys/PIZZAMIG  i386

>Description:
This update improve the clang support, resolving warnings (considered error with -Werror) directly in the source code.
Now, clang detection is not needed anymore
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -Nru devel/gdb.orig/files/fbsd-threads.c devel/gdb/files/fbsd-threads.c
--- devel/gdb.orig/files/fbsd-threads.c	2012-11-17 06:55:44.000000000 +0100
+++ devel/gdb/files/fbsd-threads.c	2012-12-18 18:09:14.000000000 +0100
@@ -1,4 +1,4 @@
-/* $FreeBSD: ports/devel/gdb/files/fbsd-threads.c,v 1.8 2012/11/17 05:55:44 svnexp Exp $ */
+/* $FreeBSD$ */
 /* FreeBSD libthread_db assisted debugging support.
    Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
 
diff -Nru devel/gdb.orig/files/patch-bfd-coffcode.h devel/gdb/files/patch-bfd-coffcode.h
--- devel/gdb.orig/files/patch-bfd-coffcode.h	1970-01-01 01:00:00.000000000 +0100
+++ devel/gdb/files/patch-bfd-coffcode.h	2012-12-18 18:09:13.000000000 +0100
@@ -0,0 +1,11 @@
+--- bfd/coffcode.h.orig	2012-12-18 14:22:56.000000000 +0100
++++ bfd/coffcode.h	2012-12-18 14:23:11.000000000 +0100
+@@ -3442,7 +3442,7 @@
+ 	 incremented in coff_set_section_contents.  This is right for
+ 	 SVR3.2.  */
+       if (strcmp (current->name, _LIB) == 0)
+-	bfd_set_section_vma (abfd, current, 0);
++	(void)bfd_set_section_vma (abfd, current, 0);
+ #endif
+ 
+ #ifdef ALIGN_SECTIONS_IN_FILE
diff -Nru devel/gdb.orig/files/patch-bfd-configure devel/gdb/files/patch-bfd-configure
--- devel/gdb.orig/files/patch-bfd-configure	2012-01-27 10:38:15.000000000 +0100
+++ devel/gdb/files/patch-bfd-configure	1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
---- bfd/configure.orig	2011-03-28 13:18:25.000000000 +0200
-+++ bfd/configure	2012-01-12 16:58:05.000000000 +0100
-@@ -12177,7 +12177,13 @@
- 
- # Enable -Werror by default when using gcc
- if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
--    ERROR_ON_WARNING=yes
-+    if test "${CC}" = clang ; then
-+	echo "clang compiler - disabling -Werror"
-+	ERROR_ON_WARNING=no
-+    else
-+	echo "gcc compiler - enabling -Werror"
-+	ERROR_ON_WARNING=yes
-+    fi
- fi
- 
- NO_WERROR=
diff -Nru devel/gdb.orig/files/patch-bfd-opncls.c devel/gdb/files/patch-bfd-opncls.c
--- devel/gdb.orig/files/patch-bfd-opncls.c	1970-01-01 01:00:00.000000000 +0100
+++ devel/gdb/files/patch-bfd-opncls.c	2012-12-18 18:09:13.000000000 +0100
@@ -0,0 +1,11 @@
+--- bfd/opncls.c.orig	2012-12-18 14:18:47.000000000 +0100
++++ bfd/opncls.c	2012-12-18 14:19:18.000000000 +0100
+@@ -254,7 +254,7 @@
+      then it may have been opened with special flags that make it
+      unsafe to close and reopen the file.  */
+   if (fd == -1)
+-    bfd_set_cacheable (nbfd, TRUE);
++    (void)bfd_set_cacheable (nbfd, TRUE);
+ 
+   return nbfd;
+ }
diff -Nru devel/gdb.orig/files/patch-bfd-peicode.h devel/gdb/files/patch-bfd-peicode.h
--- devel/gdb.orig/files/patch-bfd-peicode.h	1970-01-01 01:00:00.000000000 +0100
+++ devel/gdb/files/patch-bfd-peicode.h	2012-12-18 18:09:13.000000000 +0100
@@ -0,0 +1,11 @@
+--- bfd/peicode.h.orig	2012-12-18 14:22:02.000000000 +0100
++++ bfd/peicode.h	2012-12-18 14:22:21.000000000 +0100
+@@ -602,7 +602,7 @@
+ 
+   bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
+ 
+-  bfd_set_section_alignment (vars->abfd, sec, 2);
++  (void)bfd_set_section_alignment (vars->abfd, sec, 2);
+ 
+   /* Check that we will not run out of space.  */
+   BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
diff -Nru devel/gdb.orig/files/patch-opcodes-configure devel/gdb/files/patch-opcodes-configure
--- devel/gdb.orig/files/patch-opcodes-configure	2012-05-01 17:53:46.000000000 +0200
+++ devel/gdb/files/patch-opcodes-configure	1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
---- opcodes/configure.orig	2012-04-27 10:20:25.000000000 +0200
-+++ opcodes/configure	2012-04-27 10:24:01.000000000 +0200
-@@ -11525,7 +11525,13 @@
- 
- # Enable -Werror by default when using gcc
- if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
--    ERROR_ON_WARNING=yes
-+    if test "${CC}" = clang ; then
-+	echo "clang compiler - disabling -Werror"
-+	ERROR_ON_WARNING=no
-+    else
-+	echo "gcc compiler - enabling -Werror"
-+    	ERROR_ON_WARNING=yes
-+    fi
- fi
- 
- NO_WERROR=
diff -Nru devel/gdb.orig/files/patch-opcodes-i386-dis.c devel/gdb/files/patch-opcodes-i386-dis.c
--- devel/gdb.orig/files/patch-opcodes-i386-dis.c	1970-01-01 01:00:00.000000000 +0100
+++ devel/gdb/files/patch-opcodes-i386-dis.c	2012-12-18 18:09:13.000000000 +0100
@@ -0,0 +1,59 @@
+--- opcodes/i386-dis.c.orig	2012-07-16 14:58:29.000000000 +0200
++++ opcodes/i386-dis.c	2012-12-18 15:22:10.000000000 +0100
+@@ -11991,7 +11991,7 @@
+ static void
+ OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+ {
+-  oappend ("%st" + intel_syntax);
++  oappend (&"%st"[(short)intel_syntax]);
+ }
+ 
+ static void
+@@ -12520,32 +12520,32 @@
+   if (prefixes & PREFIX_CS)
+     {
+       used_prefixes |= PREFIX_CS;
+-      oappend ("%cs:" + intel_syntax);
++      oappend (&"%cs:"[(short)intel_syntax]);
+     }
+   if (prefixes & PREFIX_DS)
+     {
+       used_prefixes |= PREFIX_DS;
+-      oappend ("%ds:" + intel_syntax);
++      oappend (&"%ds:"[(short)intel_syntax]);
+     }
+   if (prefixes & PREFIX_SS)
+     {
+       used_prefixes |= PREFIX_SS;
+-      oappend ("%ss:" + intel_syntax);
++      oappend (&"%ss:"[(short)intel_syntax]);
+     }
+   if (prefixes & PREFIX_ES)
+     {
+       used_prefixes |= PREFIX_ES;
+-      oappend ("%es:" + intel_syntax);
++      oappend (&"%es:"[(short)intel_syntax]);
+     }
+   if (prefixes & PREFIX_FS)
+     {
+       used_prefixes |= PREFIX_FS;
+-      oappend ("%fs:" + intel_syntax);
++      oappend (&"%fs:"[(short)intel_syntax]);
+     }
+   if (prefixes & PREFIX_GS)
+     {
+       used_prefixes |= PREFIX_GS;
+-      oappend ("%gs:" + intel_syntax);
++      oappend (&"%gs:"[(short)intel_syntax]);
+     }
+ }
+ 
+@@ -13876,7 +13876,7 @@
+ 	  intel_operand_size (b_mode, sizeflag);
+ 	}
+     }
+-  oappend ("%es:" + intel_syntax);
++  oappend (&"%es:"[(short)intel_syntax]);
+   ptr_reg (code, sizeflag);
+ }
+ 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->rene 
Responsible-Changed-By: rene 
Responsible-Changed-When: Mon Dec 24 21:24:21 UTC 2012 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174568 
State-Changed-From-To: open->closed 
State-Changed-By: rene 
State-Changed-When: Mon Dec 24 22:27:07 UTC 2012 
State-Changed-Why:  
Committed, thanks 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/174568: commit references a PR
Date: Mon, 24 Dec 2012 22:26:59 +0000 (UTC)

 Author: rene
 Date: Mon Dec 24 22:26:50 2012
 New Revision: 309466
 URL: http://svnweb.freebsd.org/changeset/ports/309466
 
 Log:
   Improve/fix build with clang.
   
   PR:		ports/174568
   Submitted by:	maintainer
 
 Added:
   head/devel/gdb/files/patch-bfd-coffcode.h   (contents, props changed)
   head/devel/gdb/files/patch-bfd-opncls.c   (contents, props changed)
   head/devel/gdb/files/patch-bfd-peicode.h   (contents, props changed)
   head/devel/gdb/files/patch-opcodes-i386-dis.c   (contents, props changed)
 Deleted:
   head/devel/gdb/files/patch-bfd-configure
   head/devel/gdb/files/patch-opcodes-configure
 
 Added: head/devel/gdb/files/patch-bfd-coffcode.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/devel/gdb/files/patch-bfd-coffcode.h	Mon Dec 24 22:26:50 2012	(r309466)
 @@ -0,0 +1,11 @@
 +--- bfd/coffcode.h.orig	2012-12-18 14:22:56.000000000 +0100
 ++++ bfd/coffcode.h	2012-12-18 14:23:11.000000000 +0100
 +@@ -3442,7 +3442,7 @@
 + 	 incremented in coff_set_section_contents.  This is right for
 + 	 SVR3.2.  */
 +       if (strcmp (current->name, _LIB) == 0)
 +-	bfd_set_section_vma (abfd, current, 0);
 ++	(void)bfd_set_section_vma (abfd, current, 0);
 + #endif
 + 
 + #ifdef ALIGN_SECTIONS_IN_FILE
 
 Added: head/devel/gdb/files/patch-bfd-opncls.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/devel/gdb/files/patch-bfd-opncls.c	Mon Dec 24 22:26:50 2012	(r309466)
 @@ -0,0 +1,11 @@
 +--- bfd/opncls.c.orig	2012-12-18 14:18:47.000000000 +0100
 ++++ bfd/opncls.c	2012-12-18 14:19:18.000000000 +0100
 +@@ -254,7 +254,7 @@
 +      then it may have been opened with special flags that make it
 +      unsafe to close and reopen the file.  */
 +   if (fd == -1)
 +-    bfd_set_cacheable (nbfd, TRUE);
 ++    (void)bfd_set_cacheable (nbfd, TRUE);
 + 
 +   return nbfd;
 + }
 
 Added: head/devel/gdb/files/patch-bfd-peicode.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/devel/gdb/files/patch-bfd-peicode.h	Mon Dec 24 22:26:50 2012	(r309466)
 @@ -0,0 +1,11 @@
 +--- bfd/peicode.h.orig	2012-12-18 14:22:02.000000000 +0100
 ++++ bfd/peicode.h	2012-12-18 14:22:21.000000000 +0100
 +@@ -602,7 +602,7 @@
 + 
 +   bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
 + 
 +-  bfd_set_section_alignment (vars->abfd, sec, 2);
 ++  (void)bfd_set_section_alignment (vars->abfd, sec, 2);
 + 
 +   /* Check that we will not run out of space.  */
 +   BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
 
 Added: head/devel/gdb/files/patch-opcodes-i386-dis.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/devel/gdb/files/patch-opcodes-i386-dis.c	Mon Dec 24 22:26:50 2012	(r309466)
 @@ -0,0 +1,58 @@
 +--- opcodes/i386-dis.c.orig	2012-07-16 14:58:29.000000000 +0200
 ++++ opcodes/i386-dis.c	2012-12-18 15:22:10.000000000 +0100
 +@@ -11991,7 +11991,7 @@
 + static void
 + OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 + {
 +-  oappend ("%st" + intel_syntax);
 ++  oappend (&"%st"[(short)intel_syntax]);
 + }
 + 
 + static void
 +@@ -12520,32 +12520,32 @@
 +   if (prefixes & PREFIX_CS)
 +     {
 +       used_prefixes |= PREFIX_CS;
 +-      oappend ("%cs:" + intel_syntax);
 ++      oappend (&"%cs:"[(short)intel_syntax]);
 +     }
 +   if (prefixes & PREFIX_DS)
 +     {
 +       used_prefixes |= PREFIX_DS;
 +-      oappend ("%ds:" + intel_syntax);
 ++      oappend (&"%ds:"[(short)intel_syntax]);
 +     }
 +   if (prefixes & PREFIX_SS)
 +     {
 +       used_prefixes |= PREFIX_SS;
 +-      oappend ("%ss:" + intel_syntax);
 ++      oappend (&"%ss:"[(short)intel_syntax]);
 +     }
 +   if (prefixes & PREFIX_ES)
 +     {
 +       used_prefixes |= PREFIX_ES;
 +-      oappend ("%es:" + intel_syntax);
 ++      oappend (&"%es:"[(short)intel_syntax]);
 +     }
 +   if (prefixes & PREFIX_FS)
 +     {
 +       used_prefixes |= PREFIX_FS;
 +-      oappend ("%fs:" + intel_syntax);
 ++      oappend (&"%fs:"[(short)intel_syntax]);
 +     }
 +   if (prefixes & PREFIX_GS)
 +     {
 +       used_prefixes |= PREFIX_GS;
 +-      oappend ("%gs:" + intel_syntax);
 ++      oappend (&"%gs:"[(short)intel_syntax]);
 +     }
 + }
 + 
 +@@ -13876,7 +13876,7 @@
 + 	  intel_operand_size (b_mode, sizeflag);
 + 	}
 +     }
 +-  oappend ("%es:" + intel_syntax);
 ++  oappend (&"%es:"[(short)intel_syntax]);
 +   ptr_reg (code, sizeflag);
 + }
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
