Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2012 08:55:31 GMT
From:      Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/174568: [MAINTAINER] Improve build with clang
Message-ID:  <201212190855.qBJ8tVui059849@red.freebsd.org>
Resent-Message-ID: <201212190900.qBJ9002Y077327@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         174568
>Category:       ports
>Synopsis:       [MAINTAINER] Improve build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 19 09:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212190855.qBJ8tVui059849>