svn commit: r219076 - in head: contrib/llvm/lib/Support lib/clang/include/llvm/Config

2011-02-26 Thread Dimitry Andric
Author: dim
Date: Sun Feb 27 00:02:48 2011
New Revision: 219076
URL: http://svn.freebsd.org/changeset/base/219076

Log:
  Instead of defining LLVM_MULTITHREADED as 0 or 1, define or undefine it,
  and test appropriately.  Otherwise it might erroneously pick up some
  pthread primitives, and fail to link.

Modified:
  head/contrib/llvm/lib/Support/Atomic.cpp
  head/lib/clang/include/llvm/Config/config.h
  head/lib/clang/include/llvm/Config/llvm-config.h

Modified: head/contrib/llvm/lib/Support/Atomic.cpp
==
--- head/contrib/llvm/lib/Support/Atomic.cppSat Feb 26 23:30:32 2011
(r219075)
+++ head/contrib/llvm/lib/Support/Atomic.cppSun Feb 27 00:02:48 2011
(r219076)
@@ -22,7 +22,7 @@ using namespace llvm;
 #endif
 
 void sys::MemoryFence() {
-#if LLVM_MULTITHREADED==0
+#if !defined(LLVM_MULTITHREADED)
   return;
 #else
 #  if defined(__GNUC__)
@@ -38,7 +38,7 @@ void sys::MemoryFence() {
 sys::cas_flag sys::CompareAndSwap(volatile sys::cas_flag* ptr,
   sys::cas_flag new_value,
   sys::cas_flag old_value) {
-#if LLVM_MULTITHREADED==0
+#if !defined(LLVM_MULTITHREADED)
   sys::cas_flag result = *ptr;
   if (result == old_value)
 *ptr = new_value;
@@ -53,7 +53,7 @@ sys::cas_flag sys::CompareAndSwap(volati
 }
 
 sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) {
-#if LLVM_MULTITHREADED==0
+#if !defined(LLVM_MULTITHREADED)
   ++(*ptr);
   return *ptr;
 #elif defined(__GNUC__)
@@ -66,7 +66,7 @@ sys::cas_flag sys::AtomicIncrement(volat
 }
 
 sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) {
-#if LLVM_MULTITHREADED==0
+#if !defined(LLVM_MULTITHREADED)
   --(*ptr);
   return *ptr;
 #elif defined(__GNUC__)
@@ -79,7 +79,7 @@ sys::cas_flag sys::AtomicDecrement(volat
 }
 
 sys::cas_flag sys::AtomicAdd(volatile sys::cas_flag* ptr, sys::cas_flag val) {
-#if LLVM_MULTITHREADED==0
+#if !defined(LLVM_MULTITHREADED)
   *ptr += val;
   return *ptr;
 #elif defined(__GNUC__)

Modified: head/lib/clang/include/llvm/Config/config.h
==
--- head/lib/clang/include/llvm/Config/config.h Sat Feb 26 23:30:32 2011
(r219075)
+++ head/lib/clang/include/llvm/Config/config.h Sun Feb 27 00:02:48 2011
(r219076)
@@ -564,7 +564,7 @@
 /* #undef LLVM_MANDIR */
 
 /* Build multithreading support into LLVM */
-#define LLVM_MULTITHREADED 0
+/* #undef LLVM_MULTITHREADED */
 
 /* LLVM architecture name for the native architecture, if available */
 #define LLVM_NATIVE_ARCH X86

Modified: head/lib/clang/include/llvm/Config/llvm-config.h
==
--- head/lib/clang/include/llvm/Config/llvm-config.hSat Feb 26 23:30:32 
2011(r219075)
+++ head/lib/clang/include/llvm/Config/llvm-config.hSun Feb 27 00:02:48 
2011(r219076)
@@ -49,7 +49,7 @@
 /* #undef LLVM_MANDIR */
 
 /* Build multithreading support into LLVM */
-#define LLVM_MULTITHREADED 0
+/* #undef LLVM_MULTITHREADED */
 
 /* LLVM architecture name for the native architecture, if available */
 #define LLVM_NATIVE_ARCH X86
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r219078 - in head/usr.bin/clang: clang tblgen

2011-02-26 Thread Dimitry Andric
Author: dim
Date: Sun Feb 27 01:45:36 2011
New Revision: 219078
URL: http://svn.freebsd.org/changeset/base/219078

Log:
  Regenerate clang and tblgen manpages; the clang manpage has some minor
  updates.

Modified:
  head/usr.bin/clang/clang/clang.1
  head/usr.bin/clang/tblgen/tblgen.1

Modified: head/usr.bin/clang/clang/clang.1
==
--- head/usr.bin/clang/clang/clang.1Sun Feb 27 01:32:10 2011
(r219077)
+++ head/usr.bin/clang/clang/clang.1Sun Feb 27 01:45:36 2011
(r219078)
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
+.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
 .\"
 .\" Standard preamble:
 .\" 
@@ -125,7 +125,7 @@
 .\" 
 .\"
 .IX Title "CLANG 1"
-.TH CLANG 1 "2010-09-27" "Clang 2.8" "Clang Tools Documentation"
+.TH CLANG 1 "2010-10-25" "clang 2.9" "Clang Tools Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -197,7 +197,7 @@ stages.  In addition to compilation of c
 \&\fBClang Static Analyzer\fR
 .PP
 The Clang Static Analyzer is a tool that scans source code to try to find bugs
-though code analysis.  This tool uses many parts of Clang and is built into the
+through code analysis.  This tool uses many parts of Clang and is built into 
the
 same driver.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
@@ -264,6 +264,9 @@ Enable support for Pascal-style strings 
 .IP "\fB\-fms\-extensions\fR" 4
 .IX Item "-fms-extensions"
 Enable support for Microsoft extensions.
+.IP "\fB\-fmsc\-version=\fR" 4
+.IX Item "-fmsc-version="
+Set _MSC_VER. Defaults to 1300 on Windows. Not set otherwise.
 .IP "\fB\-fborland\-extensions\fR" 4
 .IX Item "-fborland-extensions"
 Enable support for Borland extensions.

Modified: head/usr.bin/clang/tblgen/tblgen.1
==
--- head/usr.bin/clang/tblgen/tblgen.1  Sun Feb 27 01:32:10 2011
(r219077)
+++ head/usr.bin/clang/tblgen/tblgen.1  Sun Feb 27 01:45:36 2011
(r219078)
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
+.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
 .\"
 .\" Standard preamble:
 .\" 
@@ -125,7 +125,7 @@
 .\" 
 .\"
 .IX Title "TBLGEN 1"
-.TH TBLGEN 1 "2010-06-19" "LLVM 2.8" "LLVM Command Guide"
+.TH TBLGEN 1 "2010-06-19" "LLVM 2.9" "LLVM Command Guide"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r219079 - in head/sys/boot/i386: gptboot gptzfsboot zfsboot

2011-02-26 Thread Dimitry Andric
Author: dim
Date: Sun Feb 27 02:06:09 2011
New Revision: 219079
URL: http://svn.freebsd.org/changeset/base/219079

Log:
  Clang's integrated assembler can now handle sys/boot/i386/boot2/sio.S.
  It used to choke on the notation "inb (%dx),%al" for "inb %dx,%al"; GNU
  as accepts both forms.  Which notation is more 'correct' is an open
  question. :)

Modified:
  head/sys/boot/i386/gptboot/Makefile
  head/sys/boot/i386/gptzfsboot/Makefile
  head/sys/boot/i386/zfsboot/Makefile

Modified: head/sys/boot/i386/gptboot/Makefile
==
--- head/sys/boot/i386/gptboot/Makefile Sun Feb 27 01:45:36 2011
(r219078)
+++ head/sys/boot/i386/gptboot/Makefile Sun Feb 27 02:06:09 2011
(r219079)
@@ -44,8 +44,6 @@ CFLAGS=   -DBOOTPROG=\"gptboot\" \
 .if ${CC:T:Mclang} == "clang"
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS+=   ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/}
-# XXX: clang integrated-as doesn't grok some 16-bit instructions yet
-CFLAGS+=   ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/}
 .endif
 
 LDFLAGS=-static -N --gc-sections

Modified: head/sys/boot/i386/gptzfsboot/Makefile
==
--- head/sys/boot/i386/gptzfsboot/Makefile  Sun Feb 27 01:45:36 2011
(r219078)
+++ head/sys/boot/i386/gptzfsboot/Makefile  Sun Feb 27 02:06:09 2011
(r219079)
@@ -41,8 +41,6 @@ CFLAGS=   -DBOOTPROG=\"gptzfsboot\" \
 .if ${CC:T:Mclang} == "clang"
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS+=   ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/}
-# XXX: clang integrated-as doesn't grok some 16-bit instructions yet
-CFLAGS+=   ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/}
 .endif
 
 LDFLAGS=-static -N --gc-sections

Modified: head/sys/boot/i386/zfsboot/Makefile
==
--- head/sys/boot/i386/zfsboot/Makefile Sun Feb 27 01:45:36 2011
(r219078)
+++ head/sys/boot/i386/zfsboot/Makefile Sun Feb 27 02:06:09 2011
(r219079)
@@ -41,8 +41,6 @@ CFLAGS=   -DBOOTPROG=\"zfsboot\" \
-Winline --param max-inline-insns-single=100
 
 .if ${CC:T:Mclang} == "clang"
-# XXX: clang integrated-as doesn't grok some 16-bit instructions yet
-CFLAGS+=   ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/}
 # XXX: clang integrated-as doesn't grok .codeNN directives yet
 CFLAGS+=   ${.IMPSRC:T:Mzfsldr.S:C/^.+$/-no-integrated-as/}
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r219139 - head/lib/libc/stdlib

2011-03-01 Thread Dimitry Andric
Author: dim
Date: Tue Mar  1 17:15:44 2011
New Revision: 219139
URL: http://svn.freebsd.org/changeset/base/219139

Log:
  Put in a temporary workaround for ctfmerge hanging on processing
  kernel.debug (or possibly other files), when WITH_CTF is active.
  
  This is caused by a bug in clang's integrated assembler, causing malloc
  to sometimes hang during initialization in statically linked executables
  that use threading, such as the copy of ctfmerge that is built during
  the bootstrap stage of buildworld.  The bug has been submitted upstream:
  
http://llvm.org/bugs/show_bug.cgi?id=9352
  
  Note that you might have to rebuild and install libc first, to get your
  kernel build to finish, because the ctfmerge binary built during
  bootstrap is linked with your base system's copy of libc.a, which might
  already contain a bad copy of malloc.o.

Modified:
  head/lib/libc/stdlib/Makefile.inc

Modified: head/lib/libc/stdlib/Makefile.inc
==
--- head/lib/libc/stdlib/Makefile.inc   Tue Mar  1 16:42:28 2011
(r219138)
+++ head/lib/libc/stdlib/Makefile.inc   Tue Mar  1 17:15:44 2011
(r219139)
@@ -51,3 +51,7 @@ MLINKS+=tsearch.3 tdelete.3 tsearch.3 tf
 CFLAGS+=   -DMALLOC_PRODUCTION
 .endif
 
+.if ${CC:T:Mclang} == "clang"
+# XXX: Temporary workaround for LLVM PR 9352
+CFLAGS+=   ${.IMPSRC:T:Mmalloc.c:C/^.+$/-no-integrated-as/}
+.endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r219139 - head/lib/libc/stdlib

2011-03-01 Thread Dimitry Andric

On 2011-03-01 20:01, Jung-uk Kim wrote:
...

   This is caused by a bug in clang's integrated assembler, causing
malloc to sometimes hang during initialization in statically linked
executables that use threading, such as the copy of ctfmerge that
is built during the bootstrap stage of buildworld.  The bug has
been submitted upstream:

 http://llvm.org/bugs/show_bug.cgi?id=9352

...

Is this somehow related?

http://llvm.org/viewvc/llvm-project?view=rev&revision=126720

Please see #6 in the following thread:

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013638.html


Yes, I already tried that fix, but it didn't work for this particular
issue.  In the PR you can see I tested with clang r126742, which already
contained the fix, but it still produces an incorrect result.

Note that usually this kind of problem is fixed pretty fast, the more so
since llvm/clang is going to branch for 2.9 soon (March 6th). :)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r223484 - head/contrib/binutils/gas/config

2011-06-23 Thread Dimitry Andric
Author: dim
Date: Thu Jun 23 20:54:44 2011
New Revision: 223484
URL: http://svn.freebsd.org/changeset/base/223484

Log:
  Make GNU as recognize the ARM 'rrx' mnemonic, which can be generated by
  clang for certain expressions.  Code taken from Apple cctools (GPLv2).
  
  Submitted by: damjan.mar...@gmail.com

Modified:
  head/contrib/binutils/gas/config/tc-arm.c

Modified: head/contrib/binutils/gas/config/tc-arm.c
==
--- head/contrib/binutils/gas/config/tc-arm.c   Thu Jun 23 20:31:52 2011
(r223483)
+++ head/contrib/binutils/gas/config/tc-arm.c   Thu Jun 23 20:54:44 2011
(r223484)
@@ -9974,6 +9974,13 @@ do_t_rbit (void)
 }
 
 static void
+do_t_rd_rm (void)
+{
+  inst.instruction |= inst.operands[0].reg << 8;
+  inst.instruction |= inst.operands[1].reg;
+}
+
+static void
 do_t_rev (void)
 {
   if (inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7
@@ -14901,6 +14908,9 @@ static const struct asm_opcode insns[] =
  TCE(rsb,  060, ebc0, 3, (RR, oRR, SH), arit, t_rsb),
  TC3(rsbs, 070, ebd0, 3, (RR, oRR, SH), arit, t_rsb),
 
+ TCE(rrx,  1a00060, ea4f0030, 2, (RR, RR),  rd_rm, t_rd_rm),
+ TCE(rrxs, 1b00060, ea5f0030, 2, (RR, RR),  rd_rm, t_rd_rm),
+
 #undef THUMB_VARIANT
 #define THUMB_VARIANT &arm_ext_v6
  TCE(cpy,   1a0, 4600, 2, (RR, RR),  rd_rm, t_cpy),
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r223579 - head/contrib/traceroute

2011-06-26 Thread Dimitry Andric
Author: dim
Date: Sun Jun 26 19:03:33 2011
New Revision: 223579
URL: http://svn.freebsd.org/changeset/base/223579

Log:
  For some reason, contrib/traceroute/traceroute.c ensures MAXHOSTNAMELEN
  is defined, but then proceeds to use a hardcoded maximum hostname length
  of 64 anyway.  Fix this by checking against MAXHOSTNAMELEN instead.
  
  PR:   bin/157732
  MFC after:3 days

Modified:
  head/contrib/traceroute/traceroute.c

Modified: head/contrib/traceroute/traceroute.c
==
--- head/contrib/traceroute/traceroute.cSun Jun 26 19:02:34 2011
(r223578)
+++ head/contrib/traceroute/traceroute.cSun Jun 26 19:03:33 2011
(r223579)
@@ -1618,7 +1618,7 @@ gethostinfo(register char *hostname)
register char **p;
register u_int32_t addr, *ap;
 
-   if (strlen(hostname) > 64) {
+   if (strlen(hostname) >= MAXHOSTNAMELEN) {
Fprintf(stderr, "%s: hostname \"%.32s...\" is too long\n",
prog, hostname);
exit(1);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224131 - in head/sys/boot/i386: . boot2 zfsboot

2011-07-17 Thread Dimitry Andric
Author: dim
Date: Sun Jul 17 13:50:21 2011
New Revision: 224131
URL: http://svn.freebsd.org/changeset/base/224131

Log:
  When building some of the boot loaders with clang, and DEBUG_FLAGS or
  CFLAGS having '-g' in it, clang outputs several assembly directives that
  are too new for our version of binutils.
  
  Therefore, assemble the resulting .s files with clang instead.  A more
  general solution can be implemented when a GNU as-compatible driver for
  clang's integrated assembler appears.
  
  Reported by:  dougb

Modified:
  head/sys/boot/i386/Makefile.inc
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/i386/zfsboot/Makefile

Modified: head/sys/boot/i386/Makefile.inc
==
--- head/sys/boot/i386/Makefile.inc Sun Jul 17 12:42:51 2011
(r224130)
+++ head/sys/boot/i386/Makefile.inc Sun Jul 17 13:50:21 2011
(r224131)
@@ -11,6 +11,7 @@ LDFLAGS+= -nostdlib
 
 .if ${MACHINE_CPUARCH} == "amd64"
 CFLAGS+=   -m32 -march=i386
+ACFLAGS+=  -m32
 LDFLAGS+=  -m elf_i386_fbsd
 AFLAGS+=   --32
 .endif

Modified: head/sys/boot/i386/boot2/Makefile
==
--- head/sys/boot/i386/boot2/Makefile   Sun Jul 17 12:42:51 2011
(r224130)
+++ head/sys/boot/i386/boot2/Makefile   Sun Jul 17 13:50:21 2011
(r224131)
@@ -89,6 +89,9 @@ boot2.out: ${BTXCRT} boot2.o sio.o
${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
 
 boot2.o: boot2.s
+.if ${CC:T:Mclang} == "clang"
+   ${CC} ${ACFLAGS} -c boot2.s
+.endif
 
 SRCS=  boot2.c boot2.h
 

Modified: head/sys/boot/i386/zfsboot/Makefile
==
--- head/sys/boot/i386/zfsboot/Makefile Sun Jul 17 12:42:51 2011
(r224130)
+++ head/sys/boot/i386/zfsboot/Makefile Sun Jul 17 13:50:21 2011
(r224131)
@@ -86,6 +86,9 @@ zfsboot.out: ${BTXCRT} zfsboot.o sio.o d
${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
 
 zfsboot.o: zfsboot.s
+.if ${CC:T:Mclang} == "clang"
+   ${CC} ${ACFLAGS} -c zfsboot.s
+.endif
 
 SRCS=  zfsboot.c
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224201 - head/lib/libc/stdlib

2011-07-18 Thread Dimitry Andric
Author: dim
Date: Mon Jul 18 20:07:29 2011
New Revision: 224201
URL: http://svn.freebsd.org/changeset/base/224201

Log:
  Fix building of 32-bit compat libraries on amd64 with clang, and using
  -g, by reverting r219139.  The LLVM PR referenced in that revision was
  fixed in the mean time, and we imported a clang snapshot soon
  afterwards, so the temporary workaround of disabling clang's integrated
  assembler is no longer needed.
  
  In this particular case, using e.g. DEBUG_FLAGS=-g causes clang to
  output certain directives into assembly that our version of GNU as
  chokes on.
  
  Reported by:  dougb
  Approved by:  re (kib)

Modified:
  head/lib/libc/stdlib/Makefile.inc

Modified: head/lib/libc/stdlib/Makefile.inc
==
--- head/lib/libc/stdlib/Makefile.inc   Mon Jul 18 20:06:49 2011
(r224200)
+++ head/lib/libc/stdlib/Makefile.inc   Mon Jul 18 20:07:29 2011
(r224201)
@@ -51,7 +51,3 @@ MLINKS+=tsearch.3 tdelete.3 tsearch.3 tf
 CFLAGS+=   -DMALLOC_PRODUCTION
 .endif
 
-.if ${CC:T:Mclang} == "clang"
-# XXX: Temporary workaround for LLVM PR 9352
-CFLAGS+=   ${.IMPSRC:T:Mmalloc.c:C/^.+$/-no-integrated-as/}
-.endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224722 - head/sys/boot/common

2011-08-08 Thread Dimitry Andric
Author: dim
Date: Mon Aug  8 20:53:04 2011
New Revision: 224722
URL: http://svn.freebsd.org/changeset/base/224722

Log:
  Fix buffer overflow in sys/boot/common/util.c's printf(), when printing
  large (>= 10^10) numbers.  In theory, 20 characaters should be enough,
  but bump the buffer to 32 characters, so we have some room for the
  future.
  
  Reviewed by:  pjd
  Approved by:  re (kib)

Modified:
  head/sys/boot/common/util.c

Modified: head/sys/boot/common/util.c
==
--- head/sys/boot/common/util.c Mon Aug  8 20:36:52 2011(r224721)
+++ head/sys/boot/common/util.c Mon Aug  8 20:53:04 2011(r224722)
@@ -119,7 +119,7 @@ printf(const char *fmt, ...)
 {
va_list ap;
const char *hex = "0123456789abcdef";
-   char buf[10], *s;
+   char buf[32], *s;
unsigned long long u;
int c, l;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r224721 - head/sys/sys

2011-08-10 Thread Dimitry Andric

On 2011-08-10 12:38, Alexander Best wrote:
...

any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being executed
in a

do { ... } while (0)

conditional loop? both macros are also defined in crypto/openssh/defines.h and
don't seem to need that extra one-time-loop.


It's a very common C idiom.  See:
http://stackoverflow.com/questions/154136/why-are-there-sometimes-meaningless-do-while-and-if-else-statements-in-c-c-macr
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r225366 - head/libexec/rtld-elf

2011-09-03 Thread Dimitry Andric
Author: dim
Date: Sat Sep  3 11:41:00 2011
New Revision: 225366
URL: http://svn.freebsd.org/changeset/base/225366

Log:
  When libexec/rtld-elf/rtld.c is compiled with clang, the r_debug_state()
  function (a hook necessary for gdb support), is inlined, but since the
  function contains no code, no calls to it are generated.  When gdb is
  debugging a dynamically linked program, this causes backtraces to be
  corrupted.
  
  Fix it by marking the function __noinline, and inserting an empty asm
  statement, that pretends to clobber memory.  This forces the compiler to
  emit calls to r_debug_state() throughout rtld.c.
  
  Approved by:  re (kib)

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cSat Sep  3 08:31:59 2011
(r225365)
+++ head/libexec/rtld-elf/rtld.cSat Sep  3 11:41:00 2011
(r225366)
@@ -144,7 +144,7 @@ static void ld_utrace_log(int, void *, v
 static void rtld_fill_dl_phdr_info(const Obj_Entry *obj,
 struct dl_phdr_info *phdr_info);
 
-void r_debug_state(struct r_debug *, struct link_map *);
+void r_debug_state(struct r_debug *, struct link_map *) __noinline;
 
 /*
  * Data declarations.
@@ -2782,6 +2782,14 @@ linkmap_delete(Obj_Entry *obj)
 void
 r_debug_state(struct r_debug* rd, struct link_map *m)
 {
+/*
+ * The following is a hack to force the compiler to emit calls to
+ * this function, even when optimizing.  If the function is empty,
+ * the compiler is not obliged to emit any code for calls to it,
+ * even when marked __noinline.  However, gdb depends on those
+ * calls being made.
+ */
+__asm __volatile("" : : : "memory");
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r225815 - head/usr.bin/fetch

2011-09-28 Thread Dimitry Andric

On 2011-09-28 01:11, Alexander Best wrote:

On Tue Sep 27 11, Dag-Erling Smorgrav wrote:

Author: des
Date: Tue Sep 27 19:02:44 2011
New Revision: 225815
URL: http://svn.freebsd.org/changeset/base/225815

...

--- head/usr.bin/fetch/fetch.1  Tue Sep 27 18:57:26 2011(r225814)
+++ head/usr.bin/fetch/fetch.1  Tue Sep 27 19:02:44 2011(r225815)
@@ -1,5 +1,5 @@
  .\"-
-.\" Copyright (c) 2000-2004 Dag-Erling Co?dan Sm?rgrav
+.\" Copyright (c) 2000-2011 Dag-Erling Sm?rgrav


your name isn't being displayed correctly here.

...

Modified: head/usr.bin/fetch/fetch.c
==
--- head/usr.bin/fetch/fetch.c  Tue Sep 27 18:57:26 2011(r225814)
+++ head/usr.bin/fetch/fetch.c  Tue Sep 27 19:02:44 2011(r225815)
@@ -1,5 +1,5 @@
  /*-
- * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 2000-2011 Dag-Erling Smørgrav


here your name gets displayed correctly.


The first file is plain ASCII, and has character 0xf8 for the letter ø.

The second file is UTF-8 without BOM, and uses 0xc3 0xb8 to represent
the same letter.

Maybe it would be nice if both files were UTF-8, but I'm not sure if
manpages support that.

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r225880 - in head: contrib/llvm contrib/llvm/lib/Support contrib/llvm/tools/clang etc/mtree share/doc share/doc/llvm share/doc/llvm/clang

2011-09-29 Thread Dimitry Andric
Author: dim
Date: Thu Sep 29 18:12:40 2011
New Revision: 225880
URL: http://svn.freebsd.org/changeset/base/225880

Log:
  Revive the LLVM and Clang license files, which were removed in my
  too-thorough cleanup of unused files, in r213695.  Also make sure these
  get installed under /usr/share/doc.
  
  Submitted by: rwatson, brooks
  Pointy hat to:dim
  MFC after:3 days

Added:
  head/contrib/llvm/LICENSE.TXT
 - copied unchanged from r225844, vendor/llvm/dist/LICENSE.TXT
  head/contrib/llvm/lib/Support/COPYRIGHT.regex
 - copied unchanged from r225844, 
vendor/llvm/dist/lib/Support/COPYRIGHT.regex
  head/contrib/llvm/tools/clang/LICENSE.TXT
 - copied unchanged from r225870, vendor/clang/dist/LICENSE.TXT
  head/share/doc/llvm/
  head/share/doc/llvm/Makefile   (contents, props changed)
  head/share/doc/llvm/clang/
  head/share/doc/llvm/clang/Makefile   (contents, props changed)
Modified:
  head/etc/mtree/BSD.usr.dist
  head/share/doc/Makefile

Copied: head/contrib/llvm/LICENSE.TXT (from r225844, 
vendor/llvm/dist/LICENSE.TXT)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/llvm/LICENSE.TXT   Thu Sep 29 18:12:40 2011
(r225880, copy of r225844, vendor/llvm/dist/LICENSE.TXT)
@@ -0,0 +1,69 @@
+==
+LLVM Release License
+==
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2003-2011 University of Illinois at Urbana-Champaign.
+All rights reserved.
+
+Developed by:
+
+LLVM Team
+
+University of Illinois at Urbana-Champaign
+
+http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+* Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimers.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimers in the
+  documentation and/or other materials provided with the distribution.
+
+* Neither the names of the LLVM Team, University of Illinois at
+  Urbana-Champaign, nor the names of its contributors may be used to
+  endorse or promote products derived from this Software without specific
+  prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+==
+Copyrights and Licenses for Third Party Software Distributed with LLVM:
+==
+The LLVM software contains code written by third parties.  Such software will
+have its own individual LICENSE.TXT file in the directory in which it appears.
+This file will describe the copyrights, license, and restrictions which apply
+to that code.
+
+The disclaimer of warranty in the University of Illinois Open Source License
+applies to all code in the LLVM Distribution, and nothing in any of the
+other licenses gives permission to use the names of the LLVM Team or the
+University of Illinois to endorse or promote products derived from this
+Software.
+
+The following pieces of software have additional or alternate copyrights,
+licenses, and/or restrictions:
+
+Program Directory
+--- -
+Autoconfllvm/autoconf
+llvm/projects/ModuleMaker/autoconf
+llvm/projects/sample/autoconf
+CellSPU backend llvm/lib/Target/CellSPU/README.txt
+Google Test llvm/utils/unittest/googletest
+OpenBSD regex   llvm/lib/Support/{reg*, COPYRIGHT.regex}

Copied: head/contrib/llvm/lib/Support/COPYRIGHT.regex (from r225844, 
vendor/llvm/dist/lib/Support/COPYRIGHT.regex)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/llvm/lib/Support/COPYRIGHT.regex   Thu Sep 29 18:12:40 
2011(r225880, copy of r225

svn commit: r226310 - head/usr.bin/clang/clang

2011-10-12 Thread Dimitry Andric
Author: dim
Date: Wed Oct 12 17:25:49 2011
New Revision: 226310
URL: http://svn.freebsd.org/changeset/base/226310

Log:
  Add manpage symlink for clang++(1).
  
  PR:   docs/149051
  MFC after:3 days

Modified:
  head/usr.bin/clang/clang/Makefile

Modified: head/usr.bin/clang/clang/Makefile
==
--- head/usr.bin/clang/clang/Makefile   Wed Oct 12 15:59:29 2011
(r226309)
+++ head/usr.bin/clang/clang/Makefile   Wed Oct 12 17:25:49 2011
(r226310)
@@ -10,6 +10,7 @@ SRCS= cc1_main.cpp \
driver.cpp
 
 LINKS= ${BINDIR}/clang ${BINDIR}/clang++
+MLINKS=clang.1 clang++.1
 
 TGHDRS=CC1AsOptions \
CC1Options \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226311 - head/usr.bin/clang/clang

2011-10-12 Thread Dimitry Andric
Author: dim
Date: Wed Oct 12 17:47:15 2011
New Revision: 226311
URL: http://svn.freebsd.org/changeset/base/226311

Log:
  Add symlink from clang to clang-cpp, so you can use CPP=clang-cpp in
  Makefiles.  Also add a manpage symlink for it.
  
  MFC after:3 days

Modified:
  head/usr.bin/clang/clang/Makefile

Modified: head/usr.bin/clang/clang/Makefile
==
--- head/usr.bin/clang/clang/Makefile   Wed Oct 12 17:25:49 2011
(r226310)
+++ head/usr.bin/clang/clang/Makefile   Wed Oct 12 17:47:15 2011
(r226311)
@@ -9,8 +9,10 @@ SRCS=  cc1_main.cpp \
cc1as_main.cpp \
driver.cpp
 
-LINKS= ${BINDIR}/clang ${BINDIR}/clang++
-MLINKS=clang.1 clang++.1
+LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \
+   ${BINDIR}/clang ${BINDIR}/clang-cpp
+MLINKS=clang.1 clang++.1 \
+   clang.1 clang-cpp.1
 
 TGHDRS=CC1AsOptions \
CC1Options \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226475 - head/lib/clang

2011-10-17 Thread Dimitry Andric
Author: dim
Date: Mon Oct 17 18:30:18 2011
New Revision: 226475
URL: http://svn.freebsd.org/changeset/base/226475

Log:
  Update llvm/clang's target triple (confusingly named LLVM_HOSTTRIPLE) to
  $arch-unknown-freebsd10.0.

Modified:
  head/lib/clang/clang.build.mk

Modified: head/lib/clang/clang.build.mk
==
--- head/lib/clang/clang.build.mk   Mon Oct 17 15:54:20 2011
(r226474)
+++ head/lib/clang/clang.build.mk   Mon Oct 17 18:30:18 2011
(r226475)
@@ -14,8 +14,7 @@ CFLAGS+= -O1
 .endif
 
 TARGET_ARCH?=  ${MACHINE_ARCH}
-# XXX: 8.0, to keep __FreeBSD_cc_version happy
-CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd9.0\"
+CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\"
 
 .ifndef LLVM_REQUIRES_EH
 CXXFLAGS+=-fno-exceptions
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r226475 - head/lib/clang

2011-10-18 Thread Dimitry Andric

On 2011-10-18 12:43, Nali Toja wrote:
...

-CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd9.0\"
+CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\"

I think this results in __FreeBSD__ macro being defined as `1' and
subsequently breaking clangworld where its value is used, e.g.

And it builds successfully with the following bandaid.


Thanks for reporting this, I'll commit a proper fix later today.

I've also sent it upstream, hopefully it will make the 3.0 release. :)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226518 - head/contrib/llvm/tools/clang/lib/Basic

2011-10-18 Thread Dimitry Andric
Author: dim
Date: Tue Oct 18 17:37:18 2011
New Revision: 226518
URL: http://svn.freebsd.org/changeset/base/226518

Log:
  Fix the way clang retrieves the major FreeBSD release number from the
  target triple, so that the __FreeBSD__ and __FreeBSD_cc_version builtin
  macros return the expected results.
  
  Spotted by:   nalitoja at gmail.com

Modified:
  head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp

Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
==
--- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Tue Oct 18 16:37:28 
2011(r226517)
+++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Tue Oct 18 17:37:18 
2011(r226518)
@@ -238,11 +238,12 @@ protected:
 MacroBuilder &Builder) const {
 // FreeBSD defines; list based off of gcc output
 
-// FIXME: Move version number handling to llvm::Triple.
-llvm::StringRef Release = Triple.getOSName().substr(strlen("freebsd"), 1);
+unsigned Release = Triple.getOSMajorVersion();
+if (Release == 0U)
+  Release = 8U;
 
-Builder.defineMacro("__FreeBSD__", Release);
-Builder.defineMacro("__FreeBSD_cc_version", Release + "1");
+Builder.defineMacro("__FreeBSD__", Twine(Release));
+Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 10U + 1U));
 Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
 DefineStd(Builder, "unix", Opts);
 Builder.defineMacro("__ELF__");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226519 - head/gnu/usr.bin/cc/cc_tools

2011-10-18 Thread Dimitry Andric
Author: dim
Date: Tue Oct 18 17:38:25 2011
New Revision: 226519
URL: http://svn.freebsd.org/changeset/base/226519

Log:
  Update gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 10.

Modified:
  head/gnu/usr.bin/cc/cc_tools/freebsd-native.h

Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h
==
--- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h   Tue Oct 18 17:37:18 
2011(r226518)
+++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h   Tue Oct 18 17:38:25 
2011(r226519)
@@ -7,8 +7,8 @@
 #define FREEBSD_NATIVE 1
 
 /* Fake out gcc/config/freebsd.h.  */
-#defineFBSD_MAJOR  8
-#defineFBSD_CC_VER 81  /* form like __FreeBSD_version 
*/
+#defineFBSD_MAJOR  10
+#defineFBSD_CC_VER 101 /* form like __FreeBSD_version 
*/
 
 #undef SYSTEM_INCLUDE_DIR  /* We don't need one for now. */
 #undef TOOL_INCLUDE_DIR/* We don't need one for now. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r226519 - head/gnu/usr.bin/cc/cc_tools

2011-10-18 Thread Dimitry Andric

On 2011-10-18 20:08, Alexander Best wrote:

On Tue Oct 18 11, Dimitry Andric wrote:

Author: dim
Date: Tue Oct 18 17:38:25 2011
New Revision: 226519
URL: http://svn.freebsd.org/changeset/base/226519

Log:
   Update gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 10.


should these also be updated to 9? maybe before it gets released?


It would be nice to do so.  I've asked re@ for approval.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226525 - head/contrib/llvm/tools/clang/lib/Basic

2011-10-18 Thread Dimitry Andric
Author: dim
Date: Wed Oct 19 06:24:53 2011
New Revision: 226525
URL: http://svn.freebsd.org/changeset/base/226525

Log:
  Fix breakage introduced by r226518.
  
  Spotted by:   tinderbox, yanefbsd at gmail.com
  Pointy hat to:dim

Modified:
  head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp

Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
==
--- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Oct 19 01:23:13 
2011(r226524)
+++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Oct 19 06:24:53 
2011(r226525)
@@ -242,8 +242,9 @@ protected:
 if (Release == 0U)
   Release = 8U;
 
-Builder.defineMacro("__FreeBSD__", Twine(Release));
-Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 10U + 1U));
+Builder.defineMacro("__FreeBSD__", llvm::Twine(Release));
+Builder.defineMacro("__FreeBSD_cc_version",
+llvm::Twine(Release * 10U + 1U));
 Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
 DefineStd(Builder, "unix", Opts);
 Builder.defineMacro("__ELF__");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r226518 - head/contrib/llvm/tools/clang/lib/Basic

2011-10-18 Thread Dimitry Andric

On 2011-10-19 05:13, Garrett Cooper wrote:

On Tue, Oct 18, 2011 at 8:08 PM, Garrett Cooper  wrote:

On Tue, Oct 18, 2011 at 10:37 AM, Dimitry Andric  wrote:

Author: dim
Date: Tue Oct 18 17:37:18 2011
New Revision: 226518
URL: http://svn.freebsd.org/changeset/base/226518

...

It looks like this commit broke tinderbox for multiple archs.


Rather than just complaining, I figured I should provide a fix (note
the llvm namespace scoping operators for the Twine method)...


Sorry for the breakage.  I committed the fix just now.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r226665 - head/sys/conf

2011-10-23 Thread Dimitry Andric

On 2011-10-23 18:27, Robert Millan wrote:

Author: rmh
Date: Sun Oct 23 16:27:03 2011
New Revision: 226665
URL: http://svn.freebsd.org/changeset/base/226665

Log:
   Conditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are only
   used with FreeBSD GCC.

   Approved by: kib (mentor)

Modified:
   head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Sun Oct 23 16:04:07 2011(r226664)
+++ head/sys/conf/kern.mk   Sun Oct 23 16:27:03 2011(r226665)
@@ -1,11 +1,21 @@
  # $FreeBSD$

+.if ${CC:T:Mclang} != "clang"
+FREEBSD_GCC!=  ${CC} --version | grep FreeBSD || true
+.endif
+
  #
  # Warning flags for compiling the kernel and components of the kernel:
  #
+.if ${FREEBSD_GCC}
+# FreeBSD extensions, not available in upstream GCC
+format_extensions= -fformat-extensions
+no_align_long_strings= -mno-align-long-strings
+.endif


Note: this breaks builds where CC=clang, with:


Kernel build for GENERIC started on Sun Oct 23 22:01:23 CEST 2011

...

stage 2.1: cleaning up the object tree

--
cd /usr/obj/usr/src/sys/GENERIC; MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=i386  MACHINE=i386  
CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin  
GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font  
GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac  _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp  
VERSION="FreeBSD 10.0-CURRENT i386 100"  INSTALL="sh 
/usr/src/tools/install.sh"  
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin
 make KERNEL=kernel cleandir
"/usr/src/sys/conf/kern.mk", line 10: Malformed conditional (${FREEBSD_GCC})
"/usr/src/sys/conf/kern.mk", line 14: if-less endif
make: fatal errors encountered -- cannot continue
*** Error code 1
1 error
*** Error code 2
1 error
Exited
Process exited with status 2

Since our base 'clang --version' also has 'FreeBSD' in its output, you
might want to drop the first .if ${CC:T:Mclang} != "clang" test.  E.g.
just unconditionally set the FREEBSD_GCC macro (although it's then no
longer correctly named, but that aside).
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226698 - head/sys/conf

2011-10-24 Thread Dimitry Andric
Author: dim
Date: Mon Oct 24 18:35:16 2011
New Revision: 226698
URL: http://svn.freebsd.org/changeset/base/226698

Log:
  Put in a temporary band-aid to fix kernel builds when CC=clang, after
  r226665.

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Mon Oct 24 18:29:50 2011(r226697)
+++ head/sys/conf/kern.mk   Mon Oct 24 18:35:16 2011(r226698)
@@ -7,7 +7,7 @@ FREEBSD_GCC!=   ${CC} --version | grep Fre
 #
 # Warning flags for compiling the kernel and components of the kernel:
 #
-.if ${FREEBSD_GCC}
+.if defined(FREEBSD_GCC) && ${FREEBSD_GCC}
 # FreeBSD extensions, not available in upstream GCC
 format_extensions= -fformat-extensions
 no_align_long_strings= -mno-align-long-strings
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r226702 - in head: contrib/gcc gnu/usr.bin/cc

2011-10-25 Thread Dimitry Andric

On 2011-10-24 22:52, David E. O'Brien wrote:

Author: obrien
Date: Mon Oct 24 20:52:41 2011
New Revision: 226702
URL: http://svn.freebsd.org/changeset/base/226702

Log:
   * Don't give the impression that this compiler is GPLv3.
 (It is "well known" that GCC 4.2.2 is GPLv3.)
   * Don't give the impression that this compiler isn't "trustable".


Hmm, this might be nice to have in 9.0R... :)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r226951 - head/contrib/llvm/tools/clang/lib/Basic

2011-10-30 Thread Dimitry Andric
Author: dim
Date: Sun Oct 30 22:20:17 2011
New Revision: 226951
URL: http://svn.freebsd.org/changeset/base/226951

Log:
  Pull in r143305 and r143312 from upstream clang trunk, so using "clang
  -march=native" on AMD K10 family processors no longer errors out with
  "unknown target CPU 'amdfam10'".  This also enables use of SSE4A.
  
  Reported by:  David Marec 
  MFC after:3 days

Modified:
  head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp

Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
==
--- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sun Oct 30 21:45:36 
2011(r226950)
+++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sun Oct 30 22:20:17 
2011(r226951)
@@ -1282,6 +1282,7 @@ class X86TargetInfo : public TargetInfo 
 CK_K8SSE3,
 CK_Opteron,
 CK_OpteronSSE3,
+CK_AMDFAM10,
 
 /// This specification is deprecated and will be removed in the future.
 /// Users should prefer \see CK_K8.
@@ -1381,6 +1382,7 @@ public:
   .Case("k8-sse3", CK_K8SSE3)
   .Case("opteron", CK_Opteron)
   .Case("opteron-sse3", CK_OpteronSSE3)
+  .Case("amdfam10", CK_AMDFAM10)
   .Case("x86-64", CK_x86_64)
   .Case("geode", CK_Geode)
   .Default(CK_Generic);
@@ -1441,6 +1443,7 @@ public:
 case CK_K8SSE3:
 case CK_Opteron:
 case CK_OpteronSSE3:
+case CK_AMDFAM10:
 case CK_x86_64:
   return true;
 }
@@ -1459,12 +1462,10 @@ void X86TargetInfo::getDefaultFeatures(l
   Features["ssse3"] = false;
   Features["sse41"] = false;
   Features["sse42"] = false;
+  Features["sse4a"] = false;
   Features["aes"] = false;
   Features["avx"] = false;
 
-  // LLVM does not currently recognize this.
-  // Features["sse4a"] = false;
-
   // FIXME: This *really* should not be here.
 
   // X86_64 always has SSE2.
@@ -1561,6 +1562,11 @@ void X86TargetInfo::getDefaultFeatures(l
 setFeatureEnabled(Features, "sse3", true);
 setFeatureEnabled(Features, "3dnowa", true);
 break;
+  case CK_AMDFAM10:
+setFeatureEnabled(Features, "sse3", true);
+setFeatureEnabled(Features, "sse4a", true);
+setFeatureEnabled(Features, "3dnowa", true);
+break;
   case CK_C3_2:
 setFeatureEnabled(Features, "mmx", true);
 setFeatureEnabled(Features, "sse", true);
@@ -1604,6 +1610,8 @@ bool X86TargetInfo::setFeatureEnabled(ll
 else if (Name == "avx")
   Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
+else if (Name == "sse4a")
+  Features["sse4a"] = true;
   } else {
 if (Name == "mmx")
   Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false;
@@ -1630,6 +1638,8 @@ bool X86TargetInfo::setFeatureEnabled(ll
   Features["aes"] = false;
 else if (Name == "avx")
   Features["avx"] = false;
+else if (Name == "sse4a")
+  Features["sse4a"] = false;
   }
 
   return true;
@@ -1826,6 +1836,11 @@ void X86TargetInfo::getTargetDefines(con
 Builder.defineMacro("__k8__");
 Builder.defineMacro("__tune_k8__");
 break;
+  case CK_AMDFAM10:
+Builder.defineMacro("__amdfam10");
+Builder.defineMacro("__amdfam10__");
+Builder.defineMacro("__tune_amdfam10__");
+break;
   case CK_Geode:
 Builder.defineMacro("__geode");
 Builder.defineMacro("__geode__");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233683 - head/sys/x86/include

2012-03-29 Thread Dimitry Andric
Author: dim
Date: Thu Mar 29 23:30:17 2012
New Revision: 233683
URL: http://svn.freebsd.org/changeset/base/233683

Log:
  Revert sys/x86/include/endian.h to what it was before r233419, as that
  revision has two problems:
  - It can produce worse code with both clang and gcc.
  - It doesn't fix the actual issue introduced in r232721, which will be
fixed in the next commit.
  
  Submitted by: bde, tijl and jh
  Pointy hat to:dim

Modified:
  head/sys/x86/include/endian.h

Modified: head/sys/x86/include/endian.h
==
--- head/sys/x86/include/endian.h   Thu Mar 29 21:54:19 2012
(r233682)
+++ head/sys/x86/include/endian.h   Thu Mar 29 23:30:17 2012
(r233683)
@@ -63,11 +63,11 @@
 #defineBYTE_ORDER  _BYTE_ORDER
 #endif
 
-#define__bswap16_gen(x)((__uint16_t)((x) << 8 | (x) >> 8))
+#define__bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8)
 #define__bswap32_gen(x)\
-   (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16))
+   (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
 #define__bswap64_gen(x)\
-   (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32))
+   (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32))
 
 #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P
 #define__bswap16(x)\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233684 - head/sys/x86/include

2012-03-29 Thread Dimitry Andric
Author: dim
Date: Thu Mar 29 23:31:48 2012
New Revision: 233684
URL: http://svn.freebsd.org/changeset/base/233684

Log:
  Fix an issue introduced in sys/x86/include/endian.h with r232721.  In
  that revision, the bswapXX_const() macros were renamed to bswapXX_gen().
  
  Also, bswap64_gen() was implemented as two calls to bswap32(), and
  similarly, bswap32_gen() as two calls to bswap16().  This mainly helps
  our base gcc to produce more efficient assembly.
  
  However, the arguments are not properly masked, which results in the
  wrong value being calculated in some instances.  For example,
  bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0)
  returns 0xfcdefc9a7c563412.
  
  Fix this by appropriately masking the arguments to bswap16() in
  bswap32_gen(), and to bswap32() in bswap64_gen().  This should also
  silence warnings from clang.
  
  Submitted by: jh

Modified:
  head/sys/x86/include/endian.h

Modified: head/sys/x86/include/endian.h
==
--- head/sys/x86/include/endian.h   Thu Mar 29 23:30:17 2012
(r233683)
+++ head/sys/x86/include/endian.h   Thu Mar 29 23:31:48 2012
(r233684)
@@ -65,9 +65,9 @@
 
 #define__bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8)
 #define__bswap32_gen(x)\
-   (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
+   (((__uint32_t)__bswap16((x) & 0x) << 16) | __bswap16((x) >> 16))
 #define__bswap64_gen(x)\
-   (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32))
+   (((__uint64_t)__bswap32((x) & 0x) << 32) | __bswap32((x) >> 32))
 
 #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P
 #define__bswap16(x)\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r233684 - head/sys/x86/include

2012-03-30 Thread Dimitry Andric

On 2012-03-30 10:25, Andrey Chernov wrote:

On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote:

   However, the arguments are not properly masked, which results in the
   wrong value being calculated in some instances.  For example,
   bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0)
   returns 0xfcdefc9a7c563412.


Is sign extension considered in that place? Shifting any signed value to
">>" direction (char, short, int, etc.) replicates sign bit, so cast to
corresponding unsigned value must be done first, which may take less
instructions, than masking (I am not sure about this part, just
guessing). Casting in that case applies to the argument (x) not to result
(x>>  YY).


Yes, the arguments are all converted to unsigned types where necessary.
The __bswapXX_gen() macros are only used internally by the __bswapXX()
macros and the __bswapXX_var() inline functions.

In case of the __bswapXX() macros, you can see that the argument to
__bswapXX_gen() is first explicitly cast to an unsigned type, for
example with __bswap32():

#define __bswap32(x)\
(__builtin_constant_p(x) ?  \
__bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))

Therefore, right shifting will not give any problems.  For the call to
__bswap32_var(), such casting is not needed, since the argument will be
implicitly converted to __uint32_t.

As Bruce has mentioned, you could add more explicit casts and additional
parentheses, but those would be superfluous.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r233700 - head/sys/kern

2012-03-30 Thread Dimitry Andric

On 2012-03-30 15:30, Stefan Farfeleder wrote:

here are a few similar cases.


Hm, what about this one that clang warns about:

  sys/dev/asr/asr.c:2420:57: warning: for loop has empty body [-Wempty-body]
  for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next));
 ^
  sys/dev/asr/asr.c:2420:57: note: put the semicolon on a separate line to 
silence this warning [-Wempty-body]

I'm not sure about it though, the code looks like this:

static int
asr_attach(device_t dev)
{
[...]
Asr_softc_t  *sc, **ha;
[...]
LIST_INIT(&(sc->ha_ccb));
/* Link us into the HA list */
for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next));
*(ha) = sc;

It seems the for loop walks the list until the end, then tacks 'sc' onto
it.

So to 'fix' the warning, and make the meaning more explicit, we should
probably rewrite that fragment as:

LIST_INIT(&(sc->ha_ccb));
/* Link us into the HA list */
for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next))
;
*(ha) = sc;

Is this OK?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233710 - head/sys/dev/isci

2012-03-30 Thread Dimitry Andric
Author: dim
Date: Fri Mar 30 22:52:08 2012
New Revision: 233710
URL: http://svn.freebsd.org/changeset/base/233710

Log:
  Fix the following compilation warning with clang trunk in isci(4):
  
sys/dev/isci/isci_task_request.c:198:7: error: case value not in enumerated 
type 'SCI_TASK_STATUS' (aka 'enum _SCI_TASK_STATUS') [-Werror,-Wswitch]
  case SCI_FAILURE_TIMEOUT:
 ^
  
  This is because the switch is done on a SCI_TASK_STATUS enum type, but
  the SCI_FAILURE_TIMEOUT value belongs to SCI_STATUS instead.
  
  Because the list of SCI_TASK_STATUS values cannot be modified at this
  time, use the simplest way to get rid of this warning, which is to cast
  the switch argument to int.  No functional change.
  
  Reviewed by:  jimharris
  MFC after:3 days

Modified:
  head/sys/dev/isci/isci_task_request.c

Modified: head/sys/dev/isci/isci_task_request.c
==
--- head/sys/dev/isci/isci_task_request.c   Fri Mar 30 20:17:39 2012
(r233709)
+++ head/sys/dev/isci/isci_task_request.c   Fri Mar 30 22:52:08 2012
(r233710)
@@ -188,7 +188,7 @@ isci_task_request_complete(SCI_CONTROLLE
 
isci_remote_device->is_resetting = FALSE;
 
-   switch (completion_status) {
+   switch ((int)completion_status) {
case SCI_TASK_SUCCESS:
case SCI_TASK_FAILURE_RESPONSE_VALID:
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234058 - head/usr.bin/kdump

2012-04-09 Thread Dimitry Andric
Author: dim
Date: Mon Apr  9 14:47:18 2012
New Revision: 234058
URL: http://svn.freebsd.org/changeset/base/234058

Log:
  In kdump's mkioctls script, use '${CPP}' instead of hardcodedly using
  'gcc -E'.  This fixes building when WITH_CLANG_IS_CC is in effect.
  
  Report by:Niclas Zeising 
  MFC after:1 week

Modified:
  head/usr.bin/kdump/Makefile
  head/usr.bin/kdump/mkioctls

Modified: head/usr.bin/kdump/Makefile
==
--- head/usr.bin/kdump/Makefile Mon Apr  9 14:17:22 2012(r234057)
+++ head/usr.bin/kdump/Makefile Mon Apr  9 14:47:18 2012(r234058)
@@ -21,7 +21,7 @@ NO_WERROR?=   YES
 CLEANFILES=ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c
 
 ioctl.c: mkioctls
-   env MACHINE=${MACHINE} \
+   env MACHINE=${MACHINE} CPP="${CPP}" \
sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET}
 
 kdump_subr.h: mksubr

Modified: head/usr.bin/kdump/mkioctls
==
--- head/usr.bin/kdump/mkioctls Mon Apr  9 14:17:22 2012(r234057)
+++ head/usr.bin/kdump/mkioctls Mon Apr  9 14:47:18 2012(r234058)
@@ -38,7 +38,7 @@ case "${MACHINE}" in
 esac
 
 awk -v x="$ioctl_includes" 'BEGIN {print x}' |
-   gcc -E -I$1 -dM -DCOMPAT_43TTY - |
+   $CPP -I$1 -dM -DCOMPAT_43TTY - |
awk -v ioctl_includes="$ioctl_includes" -v style="$style" '
 BEGIN {
print "/* XXX obnoxious prerequisites. */"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234060 - head/usr.bin/truss

2012-04-09 Thread Dimitry Andric
Author: dim
Date: Mon Apr  9 15:34:22 2012
New Revision: 234060
URL: http://svn.freebsd.org/changeset/base/234060

Log:
  Since truss also uses kdump's mkioctls script, pass the value of ${CPP}
  there too, similar to r234058.
  
  MFC after:1 week

Modified:
  head/usr.bin/truss/Makefile

Modified: head/usr.bin/truss/Makefile
==
--- head/usr.bin/truss/Makefile Mon Apr  9 15:20:16 2012(r234059)
+++ head/usr.bin/truss/Makefile Mon Apr  9 15:34:22 2012(r234060)
@@ -23,7 +23,7 @@ syscalls.h:   syscalls.master
${.CURDIR}/i386.conf
 
 ioctl.c: ${.CURDIR}/../kdump/mkioctls
-   env MACHINE=${MACHINE} \
+   env MACHINE=${MACHINE} CPP="${CPP}" \
/bin/sh ${.CURDIR}/../kdump/mkioctls return 
${DESTDIR}/usr/include > ${.TARGET}
 
 .if ${MACHINE_CPUARCH} == "i386"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234289 - head/tools/build/mk

2012-04-14 Thread Dimitry Andric
Author: dim
Date: Sat Apr 14 16:42:17 2012
New Revision: 234289
URL: http://svn.freebsd.org/changeset/base/234289

Log:
  Add files and directories to be cleaned up if WITHOUT_GCC is in effect
  to OptionalObsoleteFiles.inc.
  
  MFC after:1 week

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Apr 14 14:02:34 
2012(r234288)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Apr 14 16:42:17 
2012(r234289)
@@ -1409,6 +1409,42 @@ OLD_FILES+=usr/share/man/man8/strfile.8.
 OLD_FILES+=usr/share/man/man8/unstr.8.gz
 .endif
 
+.if ${MK_GCC} == no
+OLD_FILES+=usr/bin/c++filt
+OLD_FILES+=usr/bin/g++
+OLD_FILES+=usr/bin/gcc
+OLD_FILES+=usr/bin/gcov
+OLD_FILES+=usr/bin/gcpp
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/include/gcc/4.2/emmintrin.h
+OLD_FILES+=usr/include/gcc/4.2/mm_malloc.h
+OLD_FILES+=usr/include/gcc/4.2/mmintrin.h
+OLD_FILES+=usr/include/gcc/4.2/pmmintrin.h
+OLD_FILES+=usr/include/gcc/4.2/tmmintrin.h
+OLD_FILES+=usr/include/gcc/4.2/xmmintrin.h
+.elif ${TARGET_ARCH} == "ia64"
+OLD_FILES+=usr/include/gcc/4.2/ia64intrin.h
+.elif ${TARGET_ARCH} == "arm"
+OLD_FILES+=usr/include/gcc/4.2/mmintrin.h
+.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64"
+OLD_FILES+=usr/include/gcc/4.2/altivec.h
+OLD_FILES+=usr/include/gcc/4.2/ppc-asm.h
+OLD_FILES+=usr/include/gcc/4.2/spe.h
+.endif
+OLD_DIRS+=usr/include/gcc/4.2
+OLD_DIRS+=usr/include/gcc
+OLD_FILES+=usr/libexec/cc1
+OLD_FILES+=usr/libexec/cc1plus
+OLD_FILES+=usr/share/info/cpp.info.gz
+OLD_FILES+=usr/share/info/cppinternals.info.gz
+OLD_FILES+=usr/share/info/gcc.info.gz
+OLD_FILES+=usr/share/info/gccint.info.gz
+OLD_FILES+=usr/share/man/man1/g++.1.gz
+OLD_FILES+=usr/share/man/man1/gcc.1.gz
+OLD_FILES+=usr/share/man/man1/gcov.1.gz
+OLD_FILES+=usr/share/man/man1/gcpp.1.gz
+.endif
+
 .if ${MK_GCOV} == no
 OLD_FILES+=usr/bin/gcov
 OLD_FILES+=usr/share/man/man1/gcov.1.gz
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234355 - head/sys/sys

2012-04-16 Thread Dimitry Andric
Author: dim
Date: Mon Apr 16 21:28:04 2012
New Revision: 234355
URL: http://svn.freebsd.org/changeset/base/234355

Log:
  Bump __FreeBSD_version due to the import of a new clang 3.1 prerelease
  snapshot.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Apr 16 21:24:23 2012(r234354)
+++ head/sys/sys/param.hMon Apr 16 21:28:04 2012(r234355)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 110  /* Master, propagated to newvers */
+#define __FreeBSD_version 111  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234356 - in head: gnu/lib/csu lib/clang lib/csu/powerpc

2012-04-16 Thread Dimitry Andric
Author: dim
Date: Mon Apr 16 21:36:55 2012
New Revision: 234356
URL: http://svn.freebsd.org/changeset/base/234356

Log:
  Work around an issue on 32-bit PowerPC, where clang executable can get
  too big, causing 'relocation truncated to fit' errors at link time.
  
  Reviewed by:  nwhitehorn

Modified:
  head/gnu/lib/csu/Makefile
  head/lib/clang/clang.build.mk
  head/lib/csu/powerpc/Makefile

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Mon Apr 16 21:28:04 2012(r234355)
+++ head/gnu/lib/csu/Makefile   Mon Apr 16 21:36:55 2012(r234356)
@@ -34,6 +34,7 @@ CFLAGS+=  -include osreldate.h
 .if ${MACHINE_CPUARCH} == "powerpc"
 TGTOBJS=   crtsavres.o
 SRCS+= crtsavres.asm
+CFLAGS+=   -mlongcall
 .endif
 .if ${MACHINE_CPUARCH} == "sparc64"
 TGTOBJS=   crtfastmath.o

Modified: head/lib/clang/clang.build.mk
==
--- head/lib/clang/clang.build.mk   Mon Apr 16 21:28:04 2012
(r234355)
+++ head/lib/clang/clang.build.mk   Mon Apr 16 21:36:55 2012
(r234356)
@@ -11,6 +11,12 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG
 # LLVM is not strict aliasing safe as of 12/31/2011
 CFLAGS+= -fno-strict-aliasing
 
+# Work around an issue on 32-bit PowerPC, where the clang executable can get
+# too big, causing 'relocation truncated to fit' errors at link time.
+.if ${MACHINE_ARCH} == "powerpc"
+CFLAGS+=-mlongcall
+.endif
+
 TARGET_ARCH?=  ${MACHINE_ARCH}
 
CFLAGS+=-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\"
 

Modified: head/lib/csu/powerpc/Makefile
==
--- head/lib/csu/powerpc/Makefile   Mon Apr 16 21:28:04 2012
(r234355)
+++ head/lib/csu/powerpc/Makefile   Mon Apr 16 21:36:55 2012
(r234356)
@@ -6,7 +6,8 @@ SRCS=   crt1.c crti.S crtn.S
 OBJS=  ${SRCS:N*.h:R:S/$/.o/g}
 OBJS+= Scrt1.o gcrt1.o
 CFLAGS+=   -I${.CURDIR}/../common \
-   -I${.CURDIR}/../../libc/include
+   -I${.CURDIR}/../../libc/include \
+   -mlongcall
 
 all: ${OBJS}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r234355 - head/sys/sys

2012-04-16 Thread Dimitry Andric

On 2012-04-17 00:38, Bjoern A. Zeeb wrote:

On 16. Apr 2012, at 21:28 , Dimitry Andric wrote:

Author: dim
Date: Mon Apr 16 21:28:04 2012
New Revision: 234355
URL: http://svn.freebsd.org/changeset/base/234355

Log:
  Bump __FreeBSD_version due to the import of a new clang 3.1 prerelease
  snapshot.


With SVN can we please try to get these bumps done more atomically with the 
real changes and if we do not maybe reference which revision forced the bump?


I thought it was clearer to do this in a separate commit, since the
import modifies a large number of files, sort of "drowning out" this
change.



That said, why does 3.1-pre need a bump?


To make it easier for ports people to detect there is a new version.

Some command line options have changed, some new behaviour has been
introduced, etc.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r233700 - head/sys/kern

2012-04-17 Thread Dimitry Andric

On 2012-04-02 13:52, John Baldwin wrote:
...

It seems the for loop walks the list until the end, then tacks 'sc' onto
it.

So to 'fix' the warning, and make the meaning more explicit, we should
probably rewrite that fragment as:

  LIST_INIT(&(sc->ha_ccb));
  /* Link us into the HA list */
  for (ha =&Asr_softc_list; *ha; ha =&((*ha)->ha_next))
;
*(ha) = sc;

Is this OK?


Can we just make that code use a STAILQ() instead of doing it obscurely by
hand?


That would be a more invasive change, and since this driver is
essentially unmaintained, I'd like to change as little as possible. :)

Another solution is to just silence the warning for this driver.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r233700 - head/sys/kern

2012-04-18 Thread Dimitry Andric

On 2012-04-18 15:54, John Baldwin wrote:
...

http://www.FreeBSD.org/~jhb/patches/asr_stailq.patch


Yes, that seems to work just fine, at least for the list juggling.  Thanks!

The only additional fix needed now is the following.  Shall I commit
that including your patch?

Index: sys/dev/asr/asr.c
===
--- sys/dev/asr/asr.c   (revision 234390)
+++ sys/dev/asr/asr.c   (working copy)
@@ -2700,7 +2701,7 @@ asr_action(struct cam_sim *sim, union ccb  *ccb)
 
 	ccb->ccb_h.spriv_ptr0 = sc = (struct Asr_softc *)cam_sim_softc(sim);
 
-	switch (ccb->ccb_h.func_code) {

+   switch ((int)ccb->ccb_h.func_code) {
 
 	/* Common cases first */

case XPT_SCSI_IO:   /* Execute the requested I/O operation */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234502 - in head/lib/csu: amd64 arm i386-elf ia64 mips powerpc powerpc64

2012-04-20 Thread Dimitry Andric
Author: dim
Date: Fri Apr 20 21:00:39 2012
New Revision: 234502
URL: http://svn.freebsd.org/changeset/base/234502

Log:
  After r217375, some startup objects under lib/csu are built in a special
  way: first they are compiled to assembly, then some sed'ing is done on
  the assembly, and lastly the assembly is compiled to an object file.
  
  This last step is done using ${CC}, and not ${AS}, because when the
  compiler is clang, it outputs directives that are too advanced for our
  old gas.  So we use clang's integrated assembler instead.  (When the
  compiler is gcc, it just calls gas, and nothing is different, except one
  extra fork.)
  
  However, in the .s to .o rules in lib/csu/$ARCH/Makefile, I still passed
  CFLAGS to the compiler, instead of ACFLAGS, which are specifically for
  compiling .s files.
  
  In case you are using '-g' for debug info anywhere in your CFLAGS, it
  causes the .s files to already contain debug information in the assembly
  itself.  In the next step, the .s files are also compiled using '-g',
  and if the compiler is clang, it complains: "error: input can't have
  .file dwarf directives when -g is used to generate dwarf debug info for
  assembly code".
  
  Fix this by using ${ACFLAGS} for compiling the .s files instead.
  
  Reported by:  jasone
  MFC after:1 week

Modified:
  head/lib/csu/amd64/Makefile
  head/lib/csu/arm/Makefile
  head/lib/csu/i386-elf/Makefile
  head/lib/csu/ia64/Makefile
  head/lib/csu/mips/Makefile
  head/lib/csu/powerpc/Makefile
  head/lib/csu/powerpc64/Makefile

Modified: head/lib/csu/amd64/Makefile
==
--- head/lib/csu/amd64/Makefile Fri Apr 20 20:27:31 2012(r234501)
+++ head/lib/csu/amd64/Makefile Fri Apr 20 21:00:39 2012(r234502)
@@ -22,21 +22,21 @@ crt1.s: crt1.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 crt1.o: crt1.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
 
 gcrt1.s: crt1.c
${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 gcrt1.o: gcrt1.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
 
 Scrt1.s: crt1.c
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 Scrt1.o: Scrt1.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
 
 realinstall:
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \

Modified: head/lib/csu/arm/Makefile
==
--- head/lib/csu/arm/Makefile   Fri Apr 20 20:27:31 2012(r234501)
+++ head/lib/csu/arm/Makefile   Fri Apr 20 21:00:39 2012(r234502)
@@ -21,21 +21,21 @@ crt1.s: crt1.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 crt1.o: crt1.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
 
 gcrt1.s: crt1.c
${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 gcrt1.o: gcrt1.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
 
 Scrt1.s: crt1.c
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 Scrt1.o: Scrt1.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
 
 realinstall:
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \

Modified: head/lib/csu/i386-elf/Makefile
==
--- head/lib/csu/i386-elf/Makefile  Fri Apr 20 20:27:31 2012
(r234501)
+++ head/lib/csu/i386-elf/Makefile  Fri Apr 20 21:00:39 2012
(r234502)
@@ -21,7 +21,7 @@ gcrt1_c.s: crt1_c.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 gcrt1_c.o: gcrt1_c.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1_c.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s
 
 gcrt1.o: gcrt1_c.o crt1_s.o
${LD} ${LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
@@ -31,7 +31,7 @@ crt1_c.s: crt1_c.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 crt1_c.o: crt1_c.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} crt1_c.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s
 
 crt1.o:crt1_c.o crt1_s.o
${LD} ${LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
@@ -42,7 +42,7 @@ Scrt1_c.s: crt1_c.c
sed ${SED_FIX_NOTE} ${.TARGET}
 
 Scrt1_c.o: Scrt1_c.s
-   ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1_c.s
+   ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s
 
 Scrt1.o: Scrt1_c.o crt1_s.o
${LD} ${LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o

Modified: head/lib/csu/ia64/Makefile
==
--- head/lib/csu/ia64/Makefile  Fri Apr 20 20:27:31 2012(r234501)
+++ head/lib/csu/ia64/Makefile  Fri Apr 20 21:00:39

svn commit: r234503 - head/sys/dev/asr

2012-04-20 Thread Dimitry Andric
Author: dim
Date: Fri Apr 20 21:17:33 2012
New Revision: 234503
URL: http://svn.freebsd.org/changeset/base/234503

Log:
  Replace homegrown list implementation in sys/dev/asr/asr.c with
  STAILQ().  While here, fix another clang warning about a switch which
  tests an enum type for a regular integer value.
  
  Submitted by: jhb
  MFC after:1 week

Modified:
  head/sys/dev/asr/asr.c

Modified: head/sys/dev/asr/asr.c
==
--- head/sys/dev/asr/asr.c  Fri Apr 20 21:00:39 2012(r234502)
+++ head/sys/dev/asr/asr.c  Fri Apr 20 21:17:33 2012(r234503)
@@ -378,11 +378,12 @@ typedef struct Asr_softc {
u_int16_t   ha_Msgs_Count;
 
/* Links into other parents and HBAs */
-   struct Asr_softc  * ha_next;   /* HBA list */
+   STAILQ_ENTRY(Asr_softc) ha_next;   /* HBA list */
struct cdev *ha_devt;
 } Asr_softc_t;
 
-static Asr_softc_t *Asr_softc_list;
+static STAILQ_HEAD(, Asr_softc) Asr_softc_list =
+   STAILQ_HEAD_INITIALIZER(Asr_softc_list);
 
 /*
  * Prototypes of the routines we have in this object.
@@ -1959,7 +1960,7 @@ ASR_setSysTab(Asr_softc_t *sc)
 {
PI2O_EXEC_SYS_TAB_SET_MESSAGE Message_Ptr;
PI2O_SET_SYSTAB_HEADERSystemTable;
-   Asr_softc_t * ha;
+   Asr_softc_t * ha, *next;
PI2O_SGE_SIMPLE_ELEMENT   sg;
int   retVal;
 
@@ -1967,7 +1968,7 @@ ASR_setSysTab(Asr_softc_t *sc)
  sizeof(I2O_SET_SYSTAB_HEADER), M_TEMP, M_WAITOK | M_ZERO)) == NULL) {
return (ENOMEM);
}
-   for (ha = Asr_softc_list; ha; ha = ha->ha_next) {
+   STAILQ_FOREACH(ha, &Asr_softc_list, ha_next) {
++SystemTable->NumberEntries;
}
if ((Message_Ptr = (PI2O_EXEC_SYS_TAB_SET_MESSAGE)malloc (
@@ -1998,9 +1999,9 @@ ASR_setSysTab(Asr_softc_t *sc)
  &(Message_Ptr->StdMessageFrame)) & 0xF0) >> 2));
SG(sg, 0, I2O_SGL_FLAGS_DIR, SystemTable, 
sizeof(I2O_SET_SYSTAB_HEADER));
++sg;
-   for (ha = Asr_softc_list; ha; ha = ha->ha_next) {
+   STAILQ_FOREACH_SAFE(ha, &Asr_softc_list, ha_next, next) {
SG(sg, 0,
- ((ha->ha_next)
+ ((next)
? (I2O_SGL_FLAGS_DIR)
: (I2O_SGL_FLAGS_DIR | I2O_SGL_FLAGS_END_OF_BUFFER)),
  &(ha->ha_SystemTable), sizeof(ha->ha_SystemTable));
@@ -2396,7 +2397,7 @@ asr_attach(device_t dev)
 {
PI2O_EXEC_STATUS_GET_REPLY status;
PI2O_LCT_ENTRY   Device;
-   Asr_softc_t  *sc, **ha;
+   Asr_softc_t  *sc;
struct scsi_inquiry_data *iq;
int  bus, size, unit;
int  error;
@@ -2405,7 +2406,7 @@ asr_attach(device_t dev)
unit = device_get_unit(dev);
sc->ha_dev = dev;
 
-   if (Asr_softc_list == NULL) {
+   if (STAILQ_EMPTY(&Asr_softc_list)) {
/*
 *  Fixup the OS revision as saved in the dptsig for the
 *  engine (dptioctl.h) to pick up.
@@ -2417,8 +2418,7 @@ asr_attach(device_t dev)
 */
LIST_INIT(&(sc->ha_ccb));
/* Link us into the HA list */
-   for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next));
-   *(ha) = sc;
+   STAILQ_INSERT_TAIL(&Asr_softc_list, sc, ha_next);
 
/*
 *  This is the real McCoy!
@@ -2700,7 +2700,7 @@ asr_action(struct cam_sim *sim, union cc
 
ccb->ccb_h.spriv_ptr0 = sc = (struct Asr_softc *)cam_sim_softc(sim);
 
-   switch (ccb->ccb_h.func_code) {
+   switch ((int)ccb->ccb_h.func_code) {
 
/* Common cases first */
case XPT_SCSI_IO:   /* Execute the requested I/O operation */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234506 - head/sys/dev/nxge

2012-04-20 Thread Dimitry Andric
Author: dim
Date: Fri Apr 20 21:43:19 2012
New Revision: 234506
URL: http://svn.freebsd.org/changeset/base/234506

Log:
  Fix the following compilation warnings in nxge(4):
  
sys/dev/nxge/if_nxge.c:1276:11: error: case value not in enumerated type 
'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch]
  case XGE_LL_EVENT_TRY_XMIT_AGAIN:
   ^
sys/dev/nxge/if_nxge.c:1289:11: error: case value not in enumerated type 
'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch]
  case XGE_LL_EVENT_DEVICE_RESETTING:
   ^
  
  This is because the switch uses xge_queue_item_t::event_type, which is
  an enum xge_hal_event_e, while the XGE_LL_EVENT_xx values are of the
  enum xge_event_e.
  
  Since messing around with the enum definitions is too disruptive, the
  simplest fix is to cast the argument of the switch to int.
  
  Reviewed by:  gnn
  MFC after:1 week

Modified:
  head/sys/dev/nxge/if_nxge.c

Modified: head/sys/dev/nxge/if_nxge.c
==
--- head/sys/dev/nxge/if_nxge.c Fri Apr 20 21:40:31 2012(r234505)
+++ head/sys/dev/nxge/if_nxge.c Fri Apr 20 21:43:19 2012(r234506)
@@ -1272,7 +1272,7 @@ xge_callback_event(xge_queue_item_t *ite
lldev  = xge_hal_device_private(hldev);
ifnetp = lldev->ifnetp;
 
-   switch(item->event_type) {
+   switch((int)item->event_type) {
case XGE_LL_EVENT_TRY_XMIT_AGAIN:
if(lldev->initialized) {
if(xge_hal_channel_dtr_count(lldev->fifo_channel[0]) > 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234507 - head/sys/contrib/rdma

2012-04-20 Thread Dimitry Andric
Author: dim
Date: Fri Apr 20 21:52:57 2012
New Revision: 234507
URL: http://svn.freebsd.org/changeset/base/234507

Log:
  Fix the following compilation warnings in sys/contrib/rdma/rdma_cma.c:
  
sys/contrib/rdma/rdma_cma.c:1259:8: error: case value not in enumerated 
type 'enum iw_cm_event_status' [-Werror,-Wswitch]
  case ECONNRESET:
   ^
@/sys/errno.h:118:20: note: expanded from macro 'ECONNRESET'
#define ECONNRESET  54  /* Connection reset by peer */
  ^
sys/contrib/rdma/rdma_cma.c:1263:8: error: case value not in enumerated 
type 'enum iw_cm_event_status' [-Werror,-Wswitch]
  case ETIMEDOUT:
   ^
@/sys/errno.h:124:19: note: expanded from macro 'ETIMEDOUT'
#define ETIMEDOUT   60  /* Operation timed out */
  ^
sys/contrib/rdma/rdma_cma.c:1260:8: error: case value not in enumerated 
type 'enum iw_cm_event_status' [-Werror,-Wswitch]
  case ECONNREFUSED:
   ^
@/sys/errno.h:125:22: note: expanded from macro 'ECONNREFUSED'
#define ECONNREFUSED61  /* Connection refused */
  ^
  
  This is because the switch uses iw_cm_event::status, which is an enum
  iw_cm_event_status, while ECONNRESET, ETIMEDOUT and ECONNREFUSED are
  just plain defines from errno.h.
  
  It looks like there is only one use of any of the enumeration values of
  iw_cm_event_status, in:
  
sys/contrib/rdma/rdma_iwcm.c:   if (iw_event->status == 
IW_CM_EVENT_STATUS_ACCEPTED) {
  
  So messing around with the enum definitions to fix the warning seems too
  disruptive; the simplest fix is to cast the argument of the switch to
  int.
  
  Reviewed by:  kmacy
  MFC after:1 week

Modified:
  head/sys/contrib/rdma/rdma_cma.c

Modified: head/sys/contrib/rdma/rdma_cma.c
==
--- head/sys/contrib/rdma/rdma_cma.cFri Apr 20 21:43:19 2012
(r234506)
+++ head/sys/contrib/rdma/rdma_cma.cFri Apr 20 21:52:57 2012
(r234507)
@@ -1252,7 +1252,7 @@ static int cma_iw_handler(struct iw_cm_i
*sin = iw_event->local_addr;
sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr;
*sin = iw_event->remote_addr;
-   switch (iw_event->status) {
+   switch ((int)iw_event->status) {
case 0:
event.event = RDMA_CM_EVENT_ESTABLISHED;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r234353 - in head: . contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/A

2012-04-21 Thread Dimitry Andric

On 2012-04-19 23:14, Alexander Best wrote:

On Mon Apr 16 12, Dimitry Andric wrote:

Author: dim
Date: Mon Apr 16 21:23:25 2012
New Revision: 234353
URL: http://svn.freebsd.org/changeset/base/234353

Log:
   Upgrade our copy of llvm/clang to trunk r154661, in preparation of the
   upcoming 3.1 release (expected in a few weeks).  Preliminary release
   notes can be found at:<http://llvm.org/docs/ReleaseNotes.html>


very nice. :)

any reason '-fformat-extensions'-support still hasn't been pushed upstream as
something like '-fbsd-extensions'?


Simply ENOTIME.  The support as it is now, is not really acceptable for
upstream, because it is rather a quick 'n dirty hack. :)

Besides, llvm/clang 3.1 has branched for release, and only serious bugs
will be fixed in there, from now on.  So even if I got something whipped
up right now, it would probably not make it in.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234540 - head/sys/dev/dpt

2012-04-21 Thread Dimitry Andric
Author: dim
Date: Sat Apr 21 14:23:46 2012
New Revision: 234540
URL: http://svn.freebsd.org/changeset/base/234540

Log:
  Fix the following clang warning in dpt(4):
  
sys/dev/dpt/dpt_scsi.c:612:18: error: implicit truncation from 'int' to 
bitfield changes value from -2 to 2 [-Werror,-Wconstant-conversion]
  dpt->cache_type = DPT_CACHE_WRITEBACK;
  ^ ~~~
  
  by defining DPT_CACHE_WRITEBACK as 2, since dpt_softc::cache_type is an
  unsigned bitfield.  No binary change.
  
  MFC after:1 week

Modified:
  head/sys/dev/dpt/dpt.h

Modified: head/sys/dev/dpt/dpt.h
==
--- head/sys/dev/dpt/dpt.h  Sat Apr 21 11:53:24 2012(r234539)
+++ head/sys/dev/dpt/dpt.h  Sat Apr 21 14:23:46 2012(r234540)
@@ -142,7 +142,7 @@ typedef void *physaddr;
  */
 #define DPT_NO_CACHE   0
 #define DPT_CACHE_WRITETHROUGH 1
-#define DPT_CACHE_WRITEBACK-2
+#define DPT_CACHE_WRITEBACK2
 
 #define min(a,b) ((ahttp://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234596 - in head: gnu/lib/csu lib/clang lib/csu/powerpc

2012-04-22 Thread Dimitry Andric
Author: dim
Date: Mon Apr 23 06:33:27 2012
New Revision: 234596
URL: http://svn.freebsd.org/changeset/base/234596

Log:
  Revert r234356 for now, as it leads to run-time problems on 32-bit
  PowerPC.  Note this will break world.
  
  Reported by:  andreast
  Pointy hat to:dim

Modified:
  head/gnu/lib/csu/Makefile
  head/lib/clang/clang.build.mk
  head/lib/csu/powerpc/Makefile

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Mon Apr 23 03:42:23 2012(r234595)
+++ head/gnu/lib/csu/Makefile   Mon Apr 23 06:33:27 2012(r234596)
@@ -34,7 +34,6 @@ CFLAGS+=  -include osreldate.h
 .if ${MACHINE_CPUARCH} == "powerpc"
 TGTOBJS=   crtsavres.o
 SRCS+= crtsavres.asm
-CFLAGS+=   -mlongcall
 .endif
 .if ${MACHINE_CPUARCH} == "sparc64"
 TGTOBJS=   crtfastmath.o

Modified: head/lib/clang/clang.build.mk
==
--- head/lib/clang/clang.build.mk   Mon Apr 23 03:42:23 2012
(r234595)
+++ head/lib/clang/clang.build.mk   Mon Apr 23 06:33:27 2012
(r234596)
@@ -11,12 +11,6 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG
 # LLVM is not strict aliasing safe as of 12/31/2011
 CFLAGS+= -fno-strict-aliasing
 
-# Work around an issue on 32-bit PowerPC, where the clang executable can get
-# too big, causing 'relocation truncated to fit' errors at link time.
-.if ${MACHINE_ARCH} == "powerpc"
-CFLAGS+=-mlongcall
-.endif
-
 TARGET_ARCH?=  ${MACHINE_ARCH}
 
CFLAGS+=-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\"
 

Modified: head/lib/csu/powerpc/Makefile
==
--- head/lib/csu/powerpc/Makefile   Mon Apr 23 03:42:23 2012
(r234595)
+++ head/lib/csu/powerpc/Makefile   Mon Apr 23 06:33:27 2012
(r234596)
@@ -6,8 +6,7 @@ SRCS=   crt1.c crti.S crtn.S
 OBJS=  ${SRCS:N*.h:R:S/$/.o/g}
 OBJS+= Scrt1.o gcrt1.o
 CFLAGS+=   -I${.CURDIR}/../common \
-   -I${.CURDIR}/../../libc/include \
-   -mlongcall
+   -I${.CURDIR}/../../libc/include
 
 all: ${OBJS}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r234356 - in head: gnu/lib/csu lib/clang lib/csu/powerpc

2012-04-22 Thread Dimitry Andric
On 2012-04-23 02:55, Nathan Whitehorn wrote:
> On 04/22/12 15:41, Andreas Tobler wrote:
>> On 16.04.12 23:36, Dimitry Andric wrote:
>>> Author: dim
>>> Date: Mon Apr 16 21:36:55 2012
>>> New Revision: 234356
>>> URL: http://svn.freebsd.org/changeset/base/234356
>>>
>>> Log:
>>>Work around an issue on 32-bit PowerPC, where clang executable can 
>>> get
>>>too big, causing 'relocation truncated to fit' errors at link time.
>>>
>>>Reviewed by:nwhitehorn
>>
>>
>> Did you build and boot a 32-bit world with gcc?
>>
>> I get an unusable install with this commit, every command segfaults. 
>> This is on a G5 SMP with 32-bit OS, gcc built.
>>
>> 64-bit world/kernel did boot.
> 
> I hadn't tested it before acking the review request. This does appear to 
> break everything for 32-bit PPC. Have you looked into why? Can this be 
> reverted in the interim?

Reverted in r234596.  Sorry for the breakage.  Now world won't build for
powrpc, but WITHOUT_CLANG should solve that.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234656 - head/share/mk

2012-04-24 Thread Dimitry Andric
Author: dim
Date: Tue Apr 24 17:00:30 2012
New Revision: 234656
URL: http://svn.freebsd.org/changeset/base/234656

Log:
  After r234596, temporarily disable building clang on 32-bit PowerPC,
  until we are able to fix the binutils bug that makes linking clang fail
  with "relocation truncated to fit: R_PPC_REL24" errors.  This should fix
  the tinderboxes for now.

Modified:
  head/share/mk/bsd.own.mk

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Apr 24 14:06:07 2012(r234655)
+++ head/share/mk/bsd.own.mkTue Apr 24 17:00:30 2012(r234656)
@@ -441,7 +441,8 @@ __T=${TARGET_ARCH}
 __T=${MACHINE_ARCH}
 .endif
 # Clang is only for x86 and powerpc right now, by default.
-.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
+# XXX: Temporarily disabled for 32-bit powerpc, due to a binutils bug.
+.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64"
 __DEFAULT_YES_OPTIONS+=CLANG
 .else
 __DEFAULT_NO_OPTIONS+=CLANG
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234658 - head/contrib/jemalloc/src

2012-04-24 Thread Dimitry Andric
Author: dim
Date: Tue Apr 24 18:41:17 2012
New Revision: 234658
URL: http://svn.freebsd.org/changeset/base/234658

Log:
  Work around llvm PR 12623, which makes variables declared with .symver
  sometimes disappear from the resulting object file, if compiled with
  clang.  In particular, this can lead to errors when building world with
  clang and -g, similar to:
  
/usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to 
`_malloc_options'
  
  Reported by:  Conrad J. Sabatier 
  Reviewed by:  jasone

Modified:
  head/contrib/jemalloc/src/jemalloc.c

Modified: head/contrib/jemalloc/src/jemalloc.c
==
--- head/contrib/jemalloc/src/jemalloc.cTue Apr 24 17:51:36 2012
(r234657)
+++ head/contrib/jemalloc/src/jemalloc.cTue Apr 24 18:41:17 2012
(r234658)
@@ -8,7 +8,8 @@ malloc_tsd_data(, arenas, arena_t *, NUL
 malloc_tsd_data(, thread_allocated, thread_allocated_t,
 THREAD_ALLOCATED_INITIALIZER)
 
-const char *__malloc_options_1_0;
+/* Work around : */
+const char *__malloc_options_1_0 = NULL;
 __sym_compat(_malloc_options, __malloc_options_1_0, FBSD_1.0);
 
 /* Runtime configuration options. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r234785 - in head: include sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys

2012-04-29 Thread Dimitry Andric
Author: dim
Date: Sun Apr 29 11:04:31 2012
New Revision: 234785
URL: http://svn.freebsd.org/changeset/base/234785

Log:
  Add a convenience macro for the returns_twice attribute, and apply it to
  the prototypes of the appropriate functions (getcontext, savectx,
  setjmp, sigsetjmp and vfork).
  
  MFC after:2 weeks

Modified:
  head/include/setjmp.h
  head/include/unistd.h
  head/sys/amd64/include/pcb.h
  head/sys/arm/include/pcb.h
  head/sys/i386/include/pcb.h
  head/sys/ia64/include/pcb.h
  head/sys/mips/include/pcb.h
  head/sys/powerpc/include/cpu.h
  head/sys/sparc64/include/pcb.h
  head/sys/sys/cdefs.h
  head/sys/sys/systm.h
  head/sys/sys/ucontext.h

Modified: head/include/setjmp.h
==
--- head/include/setjmp.h   Sun Apr 29 10:04:20 2012(r234784)
+++ head/include/setjmp.h   Sun Apr 29 11:04:31 2012(r234785)
@@ -46,16 +46,16 @@
 __BEGIN_DECLS
 #if __BSD_VISIBLE || __XSI_VISIBLE >= 600
 void   _longjmp(jmp_buf, int) __dead2;
-int_setjmp(jmp_buf);
+int_setjmp(jmp_buf) __returns_twice;
 #endif
 void   longjmp(jmp_buf, int) __dead2;
 #if __BSD_VISIBLE
 void   longjmperror(void);
 #endif
-intsetjmp(jmp_buf);
+intsetjmp(jmp_buf) __returns_twice;
 #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
 void   siglongjmp(sigjmp_buf, int) __dead2;
-intsigsetjmp(sigjmp_buf, int);
+intsigsetjmp(sigjmp_buf, int) __returns_twice;
 #endif
 __END_DECLS
 

Modified: head/include/unistd.h
==
--- head/include/unistd.h   Sun Apr 29 10:04:20 2012(r234784)
+++ head/include/unistd.h   Sun Apr 29 11:04:31 2012(r234785)
@@ -479,7 +479,7 @@ char*getwd(char *); /* obsoleted by 
g
 useconds_t
 ualarm(useconds_t, useconds_t);
 int usleep(useconds_t);
-pid_t   vfork(void);
+pid_t   vfork(void) __returns_twice;
 #endif
 
 #if __BSD_VISIBLE

Modified: head/sys/amd64/include/pcb.h
==
--- head/sys/amd64/include/pcb.hSun Apr 29 10:04:20 2012
(r234784)
+++ head/sys/amd64/include/pcb.hSun Apr 29 11:04:31 2012
(r234785)
@@ -130,7 +130,7 @@ clear_pcb_flags(struct pcb *pcb, const u
 }
 
 void   makectx(struct trapframe *, struct pcb *);
-intsavectx(struct pcb *);
+intsavectx(struct pcb *) __returns_twice;
 
 #endif
 

Modified: head/sys/arm/include/pcb.h
==
--- head/sys/arm/include/pcb.h  Sun Apr 29 10:04:20 2012(r234784)
+++ head/sys/arm/include/pcb.h  Sun Apr 29 11:04:31 2012(r234785)
@@ -94,7 +94,7 @@ void  makectx(struct trapframe *tf, struc
 
 #ifdef _KERNEL
 
-voidsavectx(struct pcb *);
+voidsavectx(struct pcb *) __returns_twice;
 #endif /* _KERNEL */
 
 #endif /* !_MACHINE_PCB_H_ */

Modified: head/sys/i386/include/pcb.h
==
--- head/sys/i386/include/pcb.h Sun Apr 29 10:04:20 2012(r234784)
+++ head/sys/i386/include/pcb.h Sun Apr 29 11:04:31 2012(r234785)
@@ -84,7 +84,7 @@ struct pcb {
 struct trapframe;
 
 void   makectx(struct trapframe *, struct pcb *);
-void   savectx(struct pcb *);
+void   savectx(struct pcb *) __returns_twice;
 #endif
 
 #endif /* _I386_PCB_H_ */

Modified: head/sys/ia64/include/pcb.h
==
--- head/sys/ia64/include/pcb.h Sun Apr 29 10:04:20 2012(r234784)
+++ head/sys/ia64/include/pcb.h Sun Apr 29 11:04:31 2012(r234785)
@@ -65,10 +65,10 @@ struct trapframe;
 
 void makectx(struct trapframe *, struct pcb *);
 void restorectx(struct pcb *) __dead2;
-int swapctx(struct pcb *old, struct pcb *new);
+int swapctx(struct pcb *old, struct pcb *new) __returns_twice;
 
 void ia32_restorectx(struct pcb *);
-void ia32_savectx(struct pcb *);
+void ia32_savectx(struct pcb *) __returns_twice;
 
 #endif
 

Modified: head/sys/mips/include/pcb.h
==
--- head/sys/mips/include/pcb.h Sun Apr 29 10:04:20 2012(r234784)
+++ head/sys/mips/include/pcb.h Sun Apr 29 11:04:31 2012(r234785)
@@ -78,7 +78,7 @@ struct pcb
 extern struct pcb *curpcb; /* the current running pcb */
 
 void makectx(struct trapframe *, struct pcb *);
-int savectx(struct pcb *);
+int savectx(struct pcb *) __returns_twice;
 #endif
 
 #endif /* !_MACHINE_PCB_H_ */

Modified: head/sys/powerpc/include/cpu.h
==
--- head/sys/powerpc/include/cpu.h  Sun Apr 29 10:04:20 2012
(r234784)
+++ head/sys/powerpc/include/cpu.h  Sun Apr 29 11:04:31 2012
(r234785)
@@ -99,6 +99,6 @@ void  fork_trampoline(void);
 void   swi_vm(void *);
 
 /* 

svn commit: r235058 - in head: . lib/clang/include

2012-05-05 Thread Dimitry Andric
Author: dim
Date: Sat May  5 15:35:22 2012
New Revision: 235058
URL: http://svn.freebsd.org/changeset/base/235058

Log:
  Make sure a few new internal clang headers get installed, I missed these
  in the last import.  They are sometimes needed when you want to use
  advanced instructions.
  
  Also, add clang's internal stdalign.h header to ObsoleteFiles.inc, since
  it is redundant: we already have a stdalign.h header in /usr/include.
  
  Pointy hat to:dim
  PR:   kern/167574
  Submitted by: jkim
  Reported by:  Oliver Hartmann 
  MFC after:2 weeks

Modified:
  head/ObsoleteFiles.inc
  head/lib/clang/include/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat May  5 14:06:15 2012(r235057)
+++ head/ObsoleteFiles.inc  Sat May  5 15:35:22 2012(r235058)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20120505: new clang import installed a redundant internal header
+OLD_FILES+=usr/include/clang/3.1/stdalign.h
 # 20120425: libusb version bump (r234684)
 OLD_LIBS+=usr/lib/libusb.so.2
 OLD_LIBS+=usr/lib32/libusb.so.2

Modified: head/lib/clang/include/Makefile
==
--- head/lib/clang/include/Makefile Sat May  5 14:06:15 2012
(r235057)
+++ head/lib/clang/include/Makefile Sat May  5 15:35:22 2012
(r235058)
@@ -5,17 +5,23 @@
 INCSDIR=${INCLUDEDIR}/clang/3.1
 
 INCS=  altivec.h \
+   avx2intrin.h \
avxintrin.h \
+   bmi2intrin.h \
+   bmiintrin.h \
cpuid.h \
emmintrin.h \
+   fma4intrin.h \
immintrin.h \
+   lzcntintrin.h \
mm3dnow.h \
mm_malloc.h \
mmintrin.h \
+   module.map \
nmmintrin.h \
pmmintrin.h \
+   popcntintrin.h \
smmintrin.h \
-   stdalign.h \
tmmintrin.h \
unwind.h \
wmmintrin.h \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r235133 - in head: contrib/binutils/ld/emultempl share/mk

2012-05-07 Thread Dimitry Andric
Author: dim
Date: Mon May  7 17:13:36 2012
New Revision: 235133
URL: http://svn.freebsd.org/changeset/base/235133

Log:
  Revert r234656, and apply a proper fix for binutils PR 10474, which
  caused linking clang on 32-bit PowerPC to fail with "relocation
  truncated to fit: R_PPC_REL24" errors.
  
  Original diffs (relicensed under GPLv2 with permission from author):
  
http://sourceware.org/git/?p=binutils.git;a=commit;h=1fd262ff7d7ea5adf4894c6b960e092e7e43e3cd
  
http://sourceware.org/git/?p=binutils.git;a=commit;h=053c49fbff58bd33bd0d12200ea61302f92caceb
  
  Tested by:andreast
  MFC after:1 week

Modified:
  head/contrib/binutils/ld/emultempl/ppc32elf.em
  head/share/mk/bsd.own.mk

Modified: head/contrib/binutils/ld/emultempl/ppc32elf.em
==
--- head/contrib/binutils/ld/emultempl/ppc32elf.em  Mon May  7 15:41:31 
2012(r235132)
+++ head/contrib/binutils/ld/emultempl/ppc32elf.em  Mon May  7 17:13:36 
2012(r235133)
@@ -119,7 +119,40 @@ ppc_before_allocation (void)
}
}
 }
+
   gld${EMULATION_NAME}_before_allocation ();
+
+  /* Turn on relaxation if executable sections have addresses that
+ might make branches overflow.  */
+  if (!command_line.relax)
+{
+  bfd_vma low = (bfd_vma) -1;
+  bfd_vma high = 0;
+  asection *o;
+
+  /* Run lang_size_sections (if not already done).  */
+  if (expld.phase != lang_mark_phase_enum)
+   {
+ expld.phase = lang_mark_phase_enum;
+ expld.dataseg.phase = exp_dataseg_none;
+ one_lang_size_sections_pass (NULL, FALSE);
+ lang_reset_memory_regions ();
+   }
+
+  for (o = output_bfd->sections; o != NULL; o = o->next)
+   {
+ if ((o->flags & (SEC_ALLOC | SEC_CODE)) != (SEC_ALLOC | SEC_CODE))
+   continue;
+ if (o->rawsize == 0)
+   continue;
+ if (low > o->vma)
+   low = o->vma;
+ if (high < o->vma + o->rawsize - 1)
+   high = o->vma + o->rawsize - 1;
+   }
+  if (high > low && high - low > (1 << 25) - 1)
+   command_line.relax = TRUE;
+}
 }
 
 EOF

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkMon May  7 15:41:31 2012(r235132)
+++ head/share/mk/bsd.own.mkMon May  7 17:13:36 2012(r235133)
@@ -442,8 +442,7 @@ __T=${TARGET_ARCH}
 __T=${MACHINE_ARCH}
 .endif
 # Clang is only for x86 and powerpc right now, by default.
-# XXX: Temporarily disabled for 32-bit powerpc, due to a binutils bug.
-.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64"
+.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
 __DEFAULT_YES_OPTIONS+=CLANG
 .else
 __DEFAULT_NO_OPTIONS+=CLANG
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r235158 - head/sys/boot/i386/loader

2012-05-09 Thread Dimitry Andric
On 2012-05-09 10:23, Andriy Gapon wrote:
> Author: avg
> Date: Wed May  9 08:23:24 2012
> New Revision: 235158
> URL: http://svn.freebsd.org/changeset/base/235158
> 
> Log:
>   r235154 followup: add stddef.h for offsetof

Thanks, this fixes the build with clang. :)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r235239 - head/lib/libc/locale

2012-05-10 Thread Dimitry Andric
Author: dim
Date: Thu May 10 20:03:34 2012
New Revision: 235239
URL: http://svn.freebsd.org/changeset/base/235239

Log:
  Fix copy/paste error in lib/libc/locale/toupper.c.
  
  Submitted by: Kohji Okuno 

Modified:
  head/lib/libc/locale/toupper.c

Modified: head/lib/libc/locale/toupper.c
==
--- head/lib/libc/locale/toupper.c  Thu May 10 18:29:40 2012
(r235238)
+++ head/lib/libc/locale/toupper.c  Thu May 10 20:03:34 2012
(r235239)
@@ -51,7 +51,7 @@ ___toupper_l(c, l)
 {
size_t lim;
FIX_LOCALE(l);
-   _RuneRange *rr = &XLOCALE_CTYPE(l)->runes->__maplower_ext;
+   _RuneRange *rr = &XLOCALE_CTYPE(l)->runes->__mapupper_ext;
_RuneEntry *base, *re;
 
if (c < 0 || c == EOF)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r235267 - in head/usr.bin/sort: . nls

2012-05-11 Thread Dimitry Andric
On 2012-05-11 15:02, Colin Percival wrote:> On 05/11/12 05:48, Konstantin 
Belousov wrote:
>> On Fri, May 11, 2012 at 12:37:16PM +, Gabor Kovesdan wrote:
>>> +bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
>>> unsigned char **cmonths = NULL;
>>
>> Such initializations are useless. You only increase the size of the binary 
>> on the disk as the consequence.
> 
> I just tested this hypothesis, and found no change in binary size using
> either clang or gcc46.  Presumably they're smart enough to ignore explicit
> (and unnecessary) initializations of statics to zero.

This is default behaviour, which can be toggled with gcc's (and clang's)
command line option -fno-zero-initialized-in-bss:

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fno_002dzero_002dinitialized_002din_002dbss-744
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r235281 - head/sys/boot/i386/cdboot

2012-05-11 Thread Dimitry Andric
Author: dim
Date: Fri May 11 18:07:23 2012
New Revision: 235281
URL: http://svn.freebsd.org/changeset/base/235281

Log:
  Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219.
  This file uses .code16 directives, which are not yet supported by
  clang's integrated assembler.
  
  MFC after:1 month

Modified:
  head/sys/boot/i386/cdboot/Makefile

Modified: head/sys/boot/i386/cdboot/Makefile
==
--- head/sys/boot/i386/cdboot/Makefile  Fri May 11 17:50:51 2012
(r235280)
+++ head/sys/boot/i386/cdboot/Makefile  Fri May 11 18:07:23 2012
(r235281)
@@ -13,3 +13,7 @@ ORG=  0x7c00
 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
 
 .include 
+
+# XXX: clang integrated-as doesn't grok .codeNN directives yet
+CFLAGS.cdboot.S=   ${CLANG_NO_IAS}
+CFLAGS+=   ${CFLAGS.${.IMPSRC:T}}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r235773 - head/contrib/ncurses/man

2012-05-21 Thread Dimitry Andric
Author: dim
Date: Tue May 22 06:28:53 2012
New Revision: 235773
URL: http://svn.freebsd.org/changeset/base/235773

Log:
  Correct use_screen() and use_window() prototypes in curs_threads(3x).
  
  Submitted by: Yanhui Shen 
  MFC after:3 days

Modified:
  head/contrib/ncurses/man/curs_threads.3x

Modified: head/contrib/ncurses/man/curs_threads.3x
==
--- head/contrib/ncurses/man/curs_threads.3xTue May 22 05:18:30 2012
(r235772)
+++ head/contrib/ncurses/man/curs_threads.3xTue May 22 06:28:53 2012
(r235773)
@@ -45,9 +45,9 @@
 .br
 \fBint set_tabsize(int size);\fR
 .br
-\fBint use_screen(SCREEN *scr, NCURSES_WINDOW_CB func, void *data);\fR
+\fBint use_screen(SCREEN *scr, NCURSES_SCREEN_CB func, void *data);\fR
 .br
-\fBint use_window(WINDOW *win, NCURSES_SCREEN_CB func, void *data);\fR
+\fBint use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data);\fR
 .br
 .SH DESCRIPTION
 This implementation can be configured to provide rudimentary support
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test

2012-05-22 Thread Dimitry Andric
On 2012-05-22 12:22, Dag-Erling Smørgrav wrote:
> Baptiste Daroussin  writes:
>> Log:
>>   Import byacc from invisible island, it brings us lots of compatibilities 
>> with
>>   bison, keeping full compatibility with our previous yacc
>>   implementation.
> 
> This commit broke the build, in large part because Baptiste tested with
> Clang instead of GCC, and GCC generates a warning when compiling the
> generated code.

It doesn't seem to compile with clang either, at least not as of r235777:

/usr/src/bin/expr/expr.y:291:2: error: implicit declaration of function 
'yyparse' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
yyparse();
^

Note that it looks like the expr.c file is still generated with the
system yacc, so I'm not entirely sure what's going on here...

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test

2012-05-22 Thread Dimitry Andric
On 2012-05-22 16:44, Garrett Cooper wrote:
...
> I mentioned it in a private email, but the issue is that the yacc
> used during the build seems to be coming from the base system (despite
> the fact that it's a bootstrap tool). Once I installed yacc onto my
> stable-9 system at work, all of the changes that should have been
> checked in with this commit became apparent.
> Thanks,
> -Garrett
> 
> 1022 .if ${BOOTSTRAPPING} < 96

Yes, Dag-Erling mentioned he will fix this particular test for head,
which needs a version bump.

Though I still think it might have been less churn if yacc had just
continued to not declare yyparse()... :)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r235797 - head/contrib/gcc

2012-05-22 Thread Dimitry Andric
On 2012-05-22 23:07, m...@freebsd.org wrote:
...
> We run with the following at Isilon, which is somewhat bogus because
> it allows a bit of sloppiness in types, but is also terribly
> convenient since it means no casting on printf arguments is needed:

Please don't.  If you want to write portable code, use the (admittedly
horrible) PRId64 macros instead.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r235797 - head/contrib/gcc

2012-05-23 Thread Dimitry Andric
On 2012-05-22 20:18, David E. O'Brien wrote:
> Author: obrien
> Date: Tue May 22 18:18:06 2012
> New Revision: 235797
> URL: http://svn.freebsd.org/changeset/base/235797
> 
> Log:
>   Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit 
> platforms.
> 
> Modified:
>   head/contrib/gcc/c-format.c
> 
> Modified: head/contrib/gcc/c-format.c
> ==
> --- head/contrib/gcc/c-format.c   Tue May 22 17:44:01 2012
> (r235796)
> +++ head/contrib/gcc/c-format.c   Tue May 22 18:18:06 2012
> (r235797)
> @@ -287,7 +287,11 @@ static const format_length_info printf_l
>  {
>{ "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 },
>{ "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L },
> +#ifdef __LP64__
> +  { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 },
> +#else
>{ "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 },
> +#endif
>{ "L", FMT_LEN_L, STD_C89, NULL, 0, 0 },
>{ "z", FMT_LEN_z, STD_C99, NULL, 0, 0 },
>{ "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 },

Until all the additional warnings this causes have been fixed, can this commit 
please be reverted for now?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r235864 - in head: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/clang/P...

2012-05-23 Thread Dimitry Andric
Author: dim
Date: Wed May 23 21:48:49 2012
New Revision: 235864
URL: http://svn.freebsd.org/changeset/base/235864

Log:
  Upgrade our copy of llvm/clang to 3.1 release.  Release notes can be
  found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html
  
  MFC after:3 days

Modified:
  head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
  head/contrib/llvm/tools/clang/include/clang/AST/Decl.h
  head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
  head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def
  head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h
  head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h
  head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h
  head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
  head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
  head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp
  head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp
  head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
  head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp
  head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp
  head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp
  head/lib/clang/include/clang/Basic/Version.inc
  head/lib/clang/include/llvm/Config/config.h
Directory Properties:
  head/contrib/llvm/   (props changed)
  head/contrib/llvm/tools/clang/   (props changed)

Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
==
--- head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp   Wed May 
23 21:39:39 2012(r235863)
+++ head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp   Wed May 
23 21:48:49 2012(r235864)
@@ -131,30 +131,16 @@ static void CheckForPhysRegDependency(SD
   }
 }
 
-static void AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) {
-  SmallVector VTs;
-  SDNode *GlueDestNode = Glue.getNode();
-
-  // Don't add glue from a node to itself.
-  if (GlueDestNode == N) return;
-
-  // Don't add glue to something that already has it, either as a use or value.
-  if (N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue ||
-  N->getValueType(N->getNumValues() - 1) == MVT::Glue) {
-return;
-  }
-  for (unsigned I = 0, E = N->getNumValues(); I != E; ++I)
-VTs.push_back(N->getValueType(I));
-
-  if (AddGlue)
-VTs.push_back(MVT::Glue);
-
+// Helper for AddGlue to clone node operands.
+static void CloneNodeWithValues(SDNode *N, SelectionDAG *DAG,
+SmallVectorImpl &VTs,
+SDValue ExtraOper = SDValue()) {
   SmallVector Ops;
   for (unsigned I = 0, E = N->getNumOperands(); I != E; ++I)
 Ops.push_back(N->getOperand(I));
 
-  if (GlueDestNode)
-Ops.push_back(Glue);
+  if (ExtraOper.getNode())
+Ops.push_back(ExtraOper);
 
   SDVTList VTList = DAG->getVTList(&VTs[0], VTs.size());
   MachineSDNode::mmo_iterator Begin = 0, End = 0;
@@ -173,6 +159,46 @@ static void AddGlue(SDNode *N, SDValue G
 MN->setMemRefs(Begin, End);
 }
 
+static bool AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) {
+  SmallVector VTs;
+  SDNode *GlueDestNode = Glue.getNode();
+
+  // Don't add glue from a node to itself.
+  if (GlueDestNode == N) return false;
+
+  // Don't add a glue operand to something that already uses glue.
+  if (GlueDestNode &&
+  N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue) {
+return false;
+  }
+  // Don't add glue to something that already has a glue value.
+  if (N->getValueType(N->getNumValues() - 1) == MVT::Glue) return false;
+
+  for (unsigned I = 0, E = N->getNumValues(); I != E; ++I)
+VTs.push_back(N->getValueType(I));
+
+  if (AddGlue)
+VTs.push_back(MVT::Glue);
+
+  CloneNodeWithValues(N, DAG, VTs, Glue);
+
+  return true;
+}
+
+// Cleanup after unsuccessful AddGlue. Use the standard method of morphing the
+// node even though simply shrinking the value list is sufficient.
+static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG) {
+  assert((N->getValueType(N->getNumValues() - 1) == MVT::Glue &&
+  !N->hasAnyUseOfValue(N->getNumValues() - 1)) &&
+ "expected an unused glue value");
+
+  SmallVector VTs;
+  for (unsigned I = 0, E = N->getNumValues()-1; I != E; ++I)
+VTs.push_back(N->getValueType(I));
+
+  CloneNodeWithValues(N, DAG, VTs);
+}
+
 /// ClusterNeighboringLoads - Force nearby loads together by "gluing" them.
 /// This f

svn commit: r235925 - head/sys/dev/drm2/i915

2012-05-24 Thread Dimitry Andric
Author: dim
Date: Thu May 24 19:13:54 2012
New Revision: 235925
URL: http://svn.freebsd.org/changeset/base/235925

Log:
  Fix the following clang warning in drm2:
  
sys/dev/drm2/i915/intel_display.c:8861:3: error: expression result unused 
[-Werror,-Wunused-value]
_intel_wait_for(dev,
^~~~
@/dev/drm2/i915/intel_drv.h:55:2: note: expanded from macro 
'_intel_wait_for'
ret;\
^~~
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/dev/drm2/i915/intel_display.c

Modified: head/sys/dev/drm2/i915/intel_display.c
==
--- head/sys/dev/drm2/i915/intel_display.c  Thu May 24 18:25:09 2012
(r235924)
+++ head/sys/dev/drm2/i915/intel_display.c  Thu May 24 19:13:54 2012
(r235925)
@@ -8858,7 +8858,7 @@ static void ironlake_disable_rc6(struct 
if (I915_READ(PWRCTXA)) {
/* Wake the GPU, prevent RC6, then restore RSTDBYCTL */
I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) | RCX_SW_EXIT);
-   _intel_wait_for(dev,
+   (void)_intel_wait_for(dev,
((I915_READ(RSTDBYCTL) & RSX_STATUS_MASK) == RSX_STATUS_ON),
50, 1, "915pro");
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236149 - head/contrib/llvm/tools/clang/lib/CodeGen

2012-05-27 Thread Dimitry Andric
Author: dim
Date: Sun May 27 13:33:54 2012
New Revision: 236149
URL: http://svn.freebsd.org/changeset/base/236149

Log:
  Pull in r157212 from upstream clang trunk:
  
Revert r115805. An array type is required to have a range type,
however, the range can be unknown for the upper bound.
  
Testcase to follow.
  
Part of rdar://11457152
  
  This should fix ctfconvert producing error messages during kernel
  builds, similar to:
  
ERROR: scsi_all.c: die 24561: failed to retrieve array bounds
  
  These were caused by incorrect debug information for flexible array
  members of structs.
  
  MFC after:3 days

Modified:
  head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp

Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
==
--- head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp   Sun May 27 
12:54:41 2012(r236148)
+++ head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp   Sun May 27 
13:33:54 2012(r236149)
@@ -1479,25 +1479,21 @@ llvm::DIType CGDebugInfo::CreateType(con
   // obvious/recursive way?
   SmallVector Subscripts;
   QualType EltTy(Ty, 0);
-  if (Ty->isIncompleteArrayType())
+  while ((Ty = dyn_cast(EltTy))) {
+int64_t UpperBound = 0;
+int64_t LowerBound = 0;
+if (const ConstantArrayType *CAT = dyn_cast(Ty)) {
+  if (CAT->getSize().getZExtValue())
+UpperBound = CAT->getSize().getZExtValue() - 1;
+} else
+  // This is an unbounded array. Use Low = 1, Hi = 0 to express such 
+  // arrays.
+  LowerBound = 1;
+
+// FIXME: Verify this is right for VLAs.
+Subscripts.push_back(DBuilder.getOrCreateSubrange(LowerBound,
+  UpperBound));
 EltTy = Ty->getElementType();
-  else {
-while ((Ty = dyn_cast(EltTy))) {
-  int64_t UpperBound = 0;
-  int64_t LowerBound = 0;
-  if (const ConstantArrayType *CAT = dyn_cast(Ty)) {
-if (CAT->getSize().getZExtValue())
-  UpperBound = CAT->getSize().getZExtValue() - 1;
-  } else
-// This is an unbounded array. Use Low = 1, Hi = 0 to express such 
-// arrays.
-LowerBound = 1;
-
-  // FIXME: Verify this is right for VLAs.
-  Subscripts.push_back(DBuilder.getOrCreateSubrange(LowerBound,
-UpperBound));
-  EltTy = Ty->getElementType();
-}
   }
 
   llvm::DIArray SubscriptArray = DBuilder.getOrCreateArray(Subscripts);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236137 - head/contrib/gcc/config/i386

2012-05-28 Thread Dimitry Andric
On 2012-05-27 22:31, Roman Divacky wrote:
> Fwiw, to enable the same thing in clang you want this simple patch:
> 
> ===
> --- Tools.cpp   (revision 157545)
> +++ Tools.cpp   (working copy)
> @@ -4794,6 +4794,7 @@
>if (Args.hasArg(options::OPT_static)) {
>  CmdArgs.push_back("-Bstatic");
>} else {
> +CmdArgs.push_back("--hash-style=both");
>  if (Args.hasArg(options::OPT_rdynamic))
>CmdArgs.push_back("-export-dynamic");
>  CmdArgs.push_back("--eh-frame-hdr");
> 
> 
> 
> I cant commit this upstream as this option doesn't work with ld 2.15. What
> should be done here? Commit this to local FreeBSD version? Commit it upstream
> making it not work with old ld? Leave it out completely?

I think this can be committed locally in our version, especially if it
is better for performance.  We already have a few local modifications,
this one isn't very shocking. :)

For upstream, you should really add a configure check for gnu hash
support in ld, and then surround the above addition with conditionals,
e.g. #ifdef HAVE_LINK_GNU_HASH or something.

On the other hand, it's really platform-dependent: I've checked several
Linux distributions, and it is fairly unpredictable whether their gcc
passes --hash-style to the linker, or if they do, which option they use.

For example, Debian stable uses --hash-style=both, while Ubuntu 12.04
uses --hash-style=gnu.  So the correct mechanism for this is tricky.  It
should be discussed on the clang mailing list, not here.

Lastly, my personal preference would be to adjust these defaults in the
linker itself, depending on platform, but apparently nobody does that...
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236137 - head/contrib/gcc/config/i386

2012-05-28 Thread Dimitry Andric
On 2012-05-28 22:17, David Chisnall wrote:
> On 28 May 2012, at 20:33, Dimitry Andric wrote:
>> On the other hand, it's really platform-dependent: I've checked several
>> Linux distributions, and it is fairly unpredictable whether their gcc
>> passes --hash-style to the linker, or if they do, which option they use.
> 
> Can we make it dependent on the triple?  i.e. if the triple is 
> arch-whatever-freebsd9 or greater, make it pass the flag, otherwise don't 
> bother?  Or is it not worth caring about older FreeBSD?  There's no real 
> disadvantage in passing it unconditionally (marginally longer link times) and 
> potentially a big benefit.

We only ship clang in FreeBSD 9 or later, so in our own copy it can be
unconditional.  FreeBSD 8 and earlier still use ld 2.15, which doesn't
support --hash-style.  But to not inconvenience users of the clang port,
it would be nice to pass it only for freebsd9 and later.


> I don't see a problem with committing it upstream, but it would be nice to 
> pull that change in locally before 9.1 and not have to wait for LLVM 3.2 
> before we got to make use of it.
> 
> Misleading and poorly designed benchmarks on Phoronix are at stake!

Sure, I'll commit this now, and merge it to stable/9 later.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236258 - head/contrib/llvm/tools/clang/lib/Driver

2012-05-29 Thread Dimitry Andric
Author: dim
Date: Tue May 29 20:21:24 2012
New Revision: 236258
URL: http://svn.freebsd.org/changeset/base/236258

Log:
  For clang, similar to r236137, enable gnu hash generation for dynamic
  ELF binaries on x86.

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Tue May 29 20:16:26 
2012(r236257)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Tue May 29 20:21:24 
2012(r236258)
@@ -4760,6 +4760,9 @@ void freebsd::Link::ConstructJob(Compila
   CmdArgs.push_back("-dynamic-linker");
   CmdArgs.push_back("/libexec/ld-elf.so.1");
 }
+llvm::Triple::ArchType Arch = getToolChain().getArch();
+if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
+  CmdArgs.push_back("--hash-style=both");
   }
 
   // When building 32-bit code on FreeBSD/amd64, we have to explicitly
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236260 - in head/contrib/llvm: include/llvm/Support lib/Support/Unix lib/Support/Windows tools/clang/lib/Frontend

2012-05-29 Thread Dimitry Andric
Author: dim
Date: Tue May 29 21:59:09 2012
New Revision: 236260
URL: http://svn.freebsd.org/changeset/base/236260

Log:
  Pull in r156591 from upstream llvm trunk:
  
Allow unique_file to take a mode for file permissions, but default
to user only read/write.
  
  and r156592 from upstream clang trunk:
  
For final output files create them with mode 0664 to match other
compilers and expected defaults.
  
  This should fix clang creating files with mode 0600.
  
  Reported by:  James 
  MFC after:3 days

Modified:
  head/contrib/llvm/include/llvm/Support/FileSystem.h
  head/contrib/llvm/lib/Support/Unix/PathV2.inc
  head/contrib/llvm/lib/Support/Windows/PathV2.inc
  head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp

Modified: head/contrib/llvm/include/llvm/Support/FileSystem.h
==
--- head/contrib/llvm/include/llvm/Support/FileSystem.h Tue May 29 21:34:09 
2012(r236259)
+++ head/contrib/llvm/include/llvm/Support/FileSystem.h Tue May 29 21:59:09 
2012(r236260)
@@ -422,8 +422,8 @@ error_code status_known(const Twine &pat
 /// @results errc::success if result_{fd,path} have been successfully set,
 ///  otherwise a platform specific error_code.
 error_code unique_file(const Twine &model, int &result_fd,
- SmallVectorImpl &result_path,
- bool makeAbsolute = true);
+   SmallVectorImpl &result_path,
+   bool makeAbsolute = true, unsigned mode = 0600);
 
 /// @brief Canonicalize path.
 ///

Modified: head/contrib/llvm/lib/Support/Unix/PathV2.inc
==
--- head/contrib/llvm/lib/Support/Unix/PathV2.inc   Tue May 29 21:34:09 
2012(r236259)
+++ head/contrib/llvm/lib/Support/Unix/PathV2.inc   Tue May 29 21:59:09 
2012(r236260)
@@ -346,9 +346,10 @@ error_code status(const Twine &path, fil
   return error_code::success();
 }
 
+// Since this is most often used for temporary files, mode defaults to 0600.
 error_code unique_file(const Twine &model, int &result_fd,
- SmallVectorImpl &result_path,
- bool makeAbsolute) {
+   SmallVectorImpl &result_path,
+   bool makeAbsolute, unsigned mode) {
   SmallString<128> Model;
   model.toVector(Model);
   // Null terminate.
@@ -395,7 +396,7 @@ retry_random_path:
 
   // Try to open + create the file.
 rety_open_create:
-  int RandomFD = ::open(RandomPath.c_str(), O_RDWR | O_CREAT | O_EXCL, 0600);
+  int RandomFD = ::open(RandomPath.c_str(), O_RDWR | O_CREAT | O_EXCL, mode);
   if (RandomFD == -1) {
 // If the file existed, try again, otherwise, error.
 if (errno == errc::file_exists)

Modified: head/contrib/llvm/lib/Support/Windows/PathV2.inc
==
--- head/contrib/llvm/lib/Support/Windows/PathV2.incTue May 29 21:34:09 
2012(r236259)
+++ head/contrib/llvm/lib/Support/Windows/PathV2.incTue May 29 21:59:09 
2012(r236260)
@@ -487,9 +487,11 @@ handle_status_error:
   return error_code::success();
 }
 
+// FIXME: mode should be used here and default to user r/w only,
+// it currently comes in as a UNIX mode.
 error_code unique_file(const Twine &model, int &result_fd,
- SmallVectorImpl &result_path,
- bool makeAbsolute) {
+   SmallVectorImpl &result_path,
+   bool makeAbsolute, unsigned mode) {
   // Use result_path as temp storage.
   result_path.set_size(0);
   StringRef m = model.toStringRef(result_path);

Modified: head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp
==
--- head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp Tue May 
29 21:34:09 2012(r236259)
+++ head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp Tue May 
29 21:59:09 2012(r236260)
@@ -560,7 +560,8 @@ CompilerInstance::createOutputFile(Strin
   TempPath += "-";
   int fd;
   if (llvm::sys::fs::unique_file(TempPath.str(), fd, TempPath,
-   /*makeAbsolute=*/false) == llvm::errc::success) 
{
+ /*makeAbsolute=*/false, 0664)
+  == llvm::errc::success) {
 OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true));
 OSFile = TempFile = TempPath.str();
   }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236386 - head/contrib/llvm/tools/bugpoint

2012-06-01 Thread Dimitry Andric
Author: dim
Date: Fri Jun  1 06:50:37 2012
New Revision: 236386
URL: http://svn.freebsd.org/changeset/base/236386

Log:
  Pull in r155978 from upstream llvm trunk:
  
Fix unintentional use of operator bool.
  
  This enables llvm's bugpoint tool to build with libc++.
  
  MFC after:3 days

Modified:
  head/contrib/llvm/tools/bugpoint/ToolRunner.cpp

Modified: head/contrib/llvm/tools/bugpoint/ToolRunner.cpp
==
--- head/contrib/llvm/tools/bugpoint/ToolRunner.cpp Fri Jun  1 06:45:14 
2012(r236385)
+++ head/contrib/llvm/tools/bugpoint/ToolRunner.cpp Fri Jun  1 06:50:37 
2012(r236386)
@@ -128,7 +128,7 @@ static int RunProgramRemotelyWithTimeout
   ErrorFile.close();
 }
 
-errs() << OS;
+errs() << OS.str();
   }
 
   return ReturnCode;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236387 - head/contrib/libc++/include

2012-06-01 Thread Dimitry Andric
Author: dim
Date: Fri Jun  1 06:55:01 2012
New Revision: 236387
URL: http://svn.freebsd.org/changeset/base/236387

Log:
  Fix dangling else in libc++'s __bit_reference header.  This has also
  been sent upstream.
  
  MFC after:3 days

Modified:
  head/contrib/libc++/include/__bit_reference

Modified: head/contrib/libc++/include/__bit_reference
==
--- head/contrib/libc++/include/__bit_reference Fri Jun  1 06:50:37 2012
(r236386)
+++ head/contrib/libc++/include/__bit_reference Fri Jun  1 06:55:01 2012
(r236387)
@@ -950,11 +950,15 @@ __equal_unaligned(__bit_iterator<_Cp, tr
 __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
 __m = (~__storage_type(0) << __first2.__ctz_) & 
(~__storage_type(0) >> (__clz_r - __ddn));
 if (__first2.__ctz_ > __first1.__ctz_)
+{
 if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - 
__first1.__ctz_)))
 return false;
+}
 else
+{
 if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - 
__first2.__ctz_)))
 return false;
+}
 __first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word;
 __first2.__ctz_ = static_cast((__ddn + __first2.__ctz_)  
% __bits_per_word);
 __dn -= __ddn;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236388 - head/sbin/devd

2012-06-01 Thread Dimitry Andric
Author: dim
Date: Fri Jun  1 06:56:35 2012
New Revision: 236388
URL: http://svn.freebsd.org/changeset/base/236388

Log:
  Make devd build with libc++.
  
  MFC after:3 days

Modified:
  head/sbin/devd/devd.cc

Modified: head/sbin/devd/devd.cc
==
--- head/sbin/devd/devd.cc  Fri Jun  1 06:55:01 2012(r236387)
+++ head/sbin/devd/devd.cc  Fri Jun  1 06:56:35 2012(r236388)
@@ -807,7 +807,7 @@ create_socket(const char *name)
unlink(name);
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
err(1, "fcntl");
-   if (bind(fd, (struct sockaddr *) & sun, slen) < 0)
+   if (::bind(fd, (struct sockaddr *) & sun, slen) < 0)
err(1, "bind");
listen(fd, 4);
chown(name, 0, 0);  /* XXX - root.wheel */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236442 - in head/lib: libc++ libcxxrt

2012-06-02 Thread Dimitry Andric
Author: dim
Date: Sat Jun  2 11:00:48 2012
New Revision: 236442
URL: http://svn.freebsd.org/changeset/base/236442

Log:
  Tabify libcxxrt and libc++'s Makefiles.
  
  MFC after:3 days

Modified:
  head/lib/libc++/Makefile
  head/lib/libcxxrt/Makefile

Modified: head/lib/libc++/Makefile
==
--- head/lib/libc++/MakefileSat Jun  2 10:50:25 2012(r236441)
+++ head/lib/libc++/MakefileSat Jun  2 11:00:48 2012(r236442)
@@ -1,156 +1,156 @@
 # $FreeBSD$
 
-LIBCXXRTDIR=${.CURDIR}/../../contrib/libcxxrt
-HDRDIR= ${.CURDIR}/../../contrib/libc++/include
-SRCDIR= ${.CURDIR}/../../contrib/libc++/src
-CXXINCLUDEDIR=  ${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
+LIBCXXRTDIR=   ${.CURDIR}/../../contrib/libcxxrt
+HDRDIR=${.CURDIR}/../../contrib/libc++/include
+SRCDIR=${.CURDIR}/../../contrib/libc++/src
+CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
 
 .PATH: ${SRCDIR}
 
-LIB=c++
-SHLIB_MAJOR=1
+LIB=   c++
+SHLIB_MAJOR=   1
 
-SRCS+=  algorithm.cpp\
-bind.cpp\
-chrono.cpp\
-condition_variable.cpp\
-debug.cpp\
-exception.cpp\
-future.cpp\
-hash.cpp\
-ios.cpp\
-iostream.cpp\
-locale.cpp\
-memory.cpp\
-mutex.cpp\
-new.cpp\
-random.cpp\
-regex.cpp\
-stdexcept.cpp\
-string.cpp\
-strstream.cpp\
-system_error.cpp\
-thread.cpp\
-typeinfo.cpp\
-utility.cpp\
-valarray.cpp
-
-WARNS=  0
-CXXFLAGS+=  -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT
-
-DPADD=  ${LIBCXXRT}
-LDADD=  -lcxxrt
-LDFLAGS+=   --verbose
-INCSGROUPS= STD EXT
-
-STD_HEADERS=__bit_reference\
-__config\
-__debug\
-__functional_03\
-__functional_base\
-__functional_base_03\
-__hash_table\
-__locale\
-__mutex_base\
-__split_buffer\
-__sso_allocator\
-__std_stream\
-__tree\
-__tuple\
-__tuple_03\
-__undef_min_max\
-algorithm\
-array\
-atomic\
-bitset\
-cassert\
-ccomplex\
-cctype\
-cerrno\
-cfenv\
-cfloat\
-chrono\
-cinttypes\
-ciso646\
-climits\
-clocale\
-cmath\
-codecvt\
-complex\
-complex.h\
-condition_variable\
-csetjmp\
-csignal\
-cstdarg\
-cstdbool\
-cstddef\
-cstdint\
-cstdio\
-cstdlib\
-cstring\
-ctgmath\
-ctime\
-cwchar\
-cwctype\
-deque\
-exception\
-forward_list\
-fstream\
-functional\
-future\
-initializer_list\
-iomanip\
-ios\
-iosfwd\
-iostream\
-istream\
-iterator\
-limits\
-list\
-locale\
-map\
-memory\
-mutex\
-new\
-numeric\
-ostream\
-queue\
-random\
-ratio\
-regex\
-scoped_allocator\
-set\
-sstream\
-stack\
-stdexcept\
-streambuf\
-string\
-strstream\
-system_error\
-tgmath.h\
-thread\
-tuple\
-type_traits\
-typeindex\
-typeinfo\
-unordered_map\
-unordered_set\
-utility\
-valarray\
-vector
+SRCS+= algorithm.cpp\
+   bind.cpp\
+   chrono.cpp\
+   condition_variable.cpp\
+   debug.cpp\
+   exception.cpp\
+   future.cpp\
+   hash.cpp\
+   ios.cpp\
+   iostream.cpp\
+   locale.cpp\
+   memory.cpp\
+   mutex.cpp\
+   new.cpp\
+  

svn commit: r236444 - head/lib/libc++

2012-06-02 Thread Dimitry Andric
Author: dim
Date: Sat Jun  2 11:07:19 2012
New Revision: 236444
URL: http://svn.freebsd.org/changeset/base/236444

Log:
  Install libcxxrt's C++ ABI and unwind headers.  This is done in libc++'s
  Makefile, so these headers go into the same destination directory as
  libc++'s own headers, currently /usr/include/c++/v1.
  
  MFC after:3 days

Modified:
  head/lib/libc++/Makefile

Modified: head/lib/libc++/Makefile
==
--- head/lib/libc++/MakefileSat Jun  2 11:03:14 2012(r236443)
+++ head/lib/libc++/MakefileSat Jun  2 11:07:19 2012(r236444)
@@ -138,10 +138,17 @@ STD_HEADERS=  __bit_reference\
utility\
valarray\
vector
+RT_HEADERS=cxxabi.h\
+   unwind.h\
+   unwind-arm.h\
+   unwind-itanium.h
 
 .for hdr in ${STD_HEADERS}
 STD+=  ${HDRDIR}/${hdr}
 .endfor
+.for hdr in ${RT_HEADERS}
+STD+=  ${LIBCXXRTDIR}/${hdr}
+.endfor
 STDDIR=${CXXINCLUDEDIR}
 
 EXT_HEADERS=   __hash\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236528 - in head: . share/mk

2012-06-03 Thread Dimitry Andric
Author: dim
Date: Sun Jun  3 20:35:41 2012
New Revision: 236528
URL: http://svn.freebsd.org/changeset/base/236528

Log:
  During buildworld and buildkernel, define EARLY_BUILD in the earlier
  stages (build-tools, cross-tools, etc) of the build, so we can detect in
  bsd.*.mk whether to pass compiler-specific flags to ${CC}.
  
  In particular, this commit will allow using WITH_CLANG_IS_CC when the
  base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
  at their defaults.  The early stages will then be built using gcc, and
  no clang-specific flags will be passed to it.  The later stages will be
  built as usual.
  
  The EARLY_BUILD define can also serve other uses, such as building the
  world stage C++ executables with libc++ instead of libstdc++: during the
  early build stages, we cannot assume libc++ is already available, so we
  must still build with libstdc++ at that time.
  
  MFC after:1 week

Modified:
  head/Makefile.inc1
  head/share/mk/bsd.sys.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Jun  3 20:29:28 2012(r236527)
+++ head/Makefile.inc1  Sun Jun  3 20:35:41 2012(r236528)
@@ -242,7 +242,7 @@ BMAKE=  MAKEOBJDIRPREFIX=${WORLDTMP} \
SSP_CFLAGS= \
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
-DNO_PIC -DNO_PROFILE -DNO_SHARED \
-   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
+   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
 
 # build-tools stage
 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
@@ -252,7 +252,7 @@ TMAKE=  MAKEOBJDIRPREFIX=${OBJTREE} \
BOOTSTRAPPING=${OSRELDATE} \
SSP_CFLAGS= \
-DNO_LINT \
-   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
+   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
 
 # cross-tools stage
 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
@@ -487,7 +487,8 @@ build32:
 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
cd ${.CURDIR}/${_dir}; \
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
-   DIRPRFX=${_dir}/ build-tools
+   DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
+   -DEARLY_BUILD build-tools
 .endfor
cd ${.CURDIR}; \
${LIB32WMAKE} -f Makefile.inc1 libraries
@@ -829,7 +830,7 @@ buildkernel:
cd ${KRNLOBJDIR}/${_kernel}; \
PATH=${BPATH}:${PATH} \
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
-   ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \
+   ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && 
exists(${KERNSRCDIR}/modules)
@@ -837,7 +838,7 @@ buildkernel:
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
PATH=${BPATH}:${PATH} \
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
-   ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target}
+   ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target}
 .endfor
 .endif
 .if !defined(NO_KERNELDEPEND)

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkSun Jun  3 20:29:28 2012(r236527)
+++ head/share/mk/bsd.sys.mkSun Jun  3 20:35:41 2012(r236528)
@@ -61,7 +61,8 @@ CWARNFLAGS+=  -Wno-uninitialized
 CWARNFLAGS+=   -Wno-pointer-sign
 # Clang has more warnings enabled by default, and when using -Wall, so if WARNS
 # is set to low values, these have to be disabled explicitly.
-.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
+.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \
+!defined(EARLY_BUILD)
 .if ${WARNS} <= 6
 CWARNFLAGS+=   -Wno-empty-body -Wno-string-plus-int
 .endif # WARNS <= 6
@@ -88,7 +89,8 @@ WFORMAT=  1
 .if ${WFORMAT} > 0
 #CWARNFLAGS+=  -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
 CWARNFLAGS+=   -Wformat=2 -Wno-format-extra-args
-.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
+.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \
+!defined(EARLY_BUILD)
 .if ${WARNS} <= 3
 CWARNFLAGS+=   -Wno-format-nonliteral
 .endif # WARNS <= 3
@@ -109,7 +111,8 @@ CWARNFLAGS+=-Wno-format
 CWARNFLAGS+=   -Wno-unknown-pragmas
 .endif # IGNORE_PRAGMA
 
-.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
+.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \
+!defined(EARLY_BUILD)
 CLANG_NO_IAS=   -no-integrated-as
 CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
 -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret
__

svn commit: r236571 - head/sys/dev/aic7xxx/aicasm

2012-06-04 Thread Dimitry Andric
Author: dim
Date: Mon Jun  4 17:22:43 2012
New Revision: 236571
URL: http://svn.freebsd.org/changeset/base/236571

Log:
  Make aicasm compile without warnings if -Wpointer-sign is enabled.
  
  MFC after:3 days

Modified:
  head/sys/dev/aic7xxx/aicasm/aicasm.c

Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c
==
--- head/sys/dev/aic7xxx/aicasm/aicasm.cMon Jun  4 17:13:32 2012
(r236570)
+++ head/sys/dev/aic7xxx/aicasm/aicasm.cMon Jun  4 17:22:43 2012
(r236571)
@@ -530,7 +530,7 @@ output_listing(char *ifilename)
int instrptr;
unsigned int line;
int func_count;
-   int skip_addr;
+   unsigned int skip_addr;
 
instrcount = 0;
instrptr = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236578 - head/sys/dev/aic7xxx/aicasm

2012-06-04 Thread Dimitry Andric
Author: dim
Date: Mon Jun  4 20:36:11 2012
New Revision: 236578
URL: http://svn.freebsd.org/changeset/base/236578

Log:
  Fix build of aicasm when CC=clang.  This was due to a side-effect of the
  EARLY_BUILD macro: the -Qunused-arguments flag isn't passed anymore when
  building this particular program.  However, with clang 3.1 and -Werror,
  such unused argument warnings are flagged as errors, causing buildkernel
  to fail at this stage, due to the -nostdinc flag passed during linking.
  Since the -nostdinc flag isn't actually needed, just remove it.
  
  X-MFC-With:   r236528

Modified:
  head/sys/dev/aic7xxx/aicasm/Makefile

Modified: head/sys/dev/aic7xxx/aicasm/Makefile
==
--- head/sys/dev/aic7xxx/aicasm/MakefileMon Jun  4 19:09:14 2012
(r236577)
+++ head/sys/dev/aic7xxx/aicasm/MakefileMon Jun  4 20:36:11 2012
(r236578)
@@ -24,8 +24,7 @@ WARNS?=   5
 DEPENDFILE=.depend_aicasm
 .endif
 
-NOSTDINC=  -nostdinc
-CFLAGS+= ${NOSTDINC} -I/usr/include -I.
+CFLAGS+= -I.
 .ifdef MAKESRCPATH
 CFLAGS+= -I${MAKESRCPATH}
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236582 - head/lib/libc/stdlib

2012-06-05 Thread Dimitry Andric
On 2012-06-04 23:34, Andrey A. Chernov wrote:> Author: ache
> Date: Mon Jun  4 21:34:49 2012
> New Revision: 236582
> URL: http://svn.freebsd.org/changeset/base/236582
> 
> Log:
>   1) IEEE Std 1003.1-2008, "errno" section, is explicit that
>   
>   "The setting of errno after a successful call to a function is
>   unspecified unless the description of that function specifies that
>   errno shall not be modified."
>   
>   However, free() in IEEE Std 1003.1-2008 does not mention its interaction
>   with errno, so MAY modify it after successful call
>   (it depends on particular free() implementation, OS-specific, etc.).

Actually, it says the following:

  RETURN VALUE

  The free() function shall not return a value.

  ERRORS

  No errors are defined.

How much clearer do you want it? ;)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236695 - in head/lib/libc: include net

2012-06-06 Thread Dimitry Andric
Author: dim
Date: Wed Jun  6 21:16:26 2012
New Revision: 236695
URL: http://svn.freebsd.org/changeset/base/236695

Log:
  Fix two warnings about self-assignment in libc.  These normally only
  trigger with clang, when you either use -save-temps, or ccache.
  
  Reported by:  Sevan / Venture37 
  MFC after:3 days

Modified:
  head/lib/libc/include/port_before.h
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/include/port_before.h
==
--- head/lib/libc/include/port_before.h Wed Jun  6 18:04:49 2012
(r236694)
+++ head/lib/libc/include/port_before.h Wed Jun  6 21:16:26 2012
(r236695)
@@ -17,6 +17,6 @@
 var = _u.v; \
 } while (0)
 
-#define UNUSED(x) (x) = (x)
+#define UNUSED(x) (void)(x)
 
 #endif /* _PORT_BEFORE_H_ */

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Wed Jun  6 18:04:49 2012
(r236694)
+++ head/lib/libc/net/getaddrinfo.c Wed Jun  6 21:16:26 2012
(r236695)
@@ -464,7 +464,7 @@ getaddrinfo(const char *hostname, const 
}
error = get_portmatch(pai, servname);
if (error)
-   ERR(error);
+   goto bad;
 
*pai = ai0;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236759 - head/usr.bin/sort

2012-06-08 Thread Dimitry Andric
Author: dim
Date: Fri Jun  8 17:08:27 2012
New Revision: 236759
URL: http://svn.freebsd.org/changeset/base/236759

Log:
  In usr.bin/sort, use another method of silencing warnings about unused
  arguments, which does not trigger self-assignment warnings in certain
  circumstances (for example, using clang with ccache).
  
  MFC after:3 days

Modified:
  head/usr.bin/sort/sort.h

Modified: head/usr.bin/sort/sort.h
==
--- head/usr.bin/sort/sort.hFri Jun  8 16:16:03 2012(r236758)
+++ head/usr.bin/sort/sort.hFri Jun  8 17:08:27 2012(r236759)
@@ -41,7 +41,7 @@
 
 #defineVERSION "2.3-FreeBSD"
 
-#defineUNUSED_ARG(A) do { A=A; } while(0)
+#defineUNUSED_ARG(A) do { (void)(A); } while(0)
 
 #ifdef WITHOUT_NLS
 #definegetstr(n)nlsstr[n]
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r236759 - head/usr.bin/sort

2012-06-08 Thread Dimitry Andric
On 2012-06-08 19:30, Gabor Kovesdan wrote:
> On 2012.06.08. 19:08, Dimitry Andric wrote:
...
>> -#define UNUSED_ARG(A) do { A=A; } while(0)
>> +#define UNUSED_ARG(A) do { (void)(A); } while(0)
> My fault, I should have fixed this. But what about this version? I think 
> it is more elegant and this is how it should have been done initially:

No worries, I just used the least disruptive way of fixing it.  Note
that it also only occurs specifically when you compile with -save-temps
or with ccache, which does preprocessing and compiling separately.

Your new diff looks good to me.  Though please attach diffs next time,
for some reason your mail client (or mine) badly mangled the tabs, and
it was tricky to apply. :)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r236810 - head/share/mk

2012-06-09 Thread Dimitry Andric
Author: dim
Date: Sat Jun  9 11:41:29 2012
New Revision: 236810
URL: http://svn.freebsd.org/changeset/base/236810

Log:
  Amend r227797 by also passing ${STATIC_CXXFLAGS} for the other supported
  C++ file extensions.
  
  MFC after:3 days

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkSat Jun  9 10:43:33 2012(r236809)
+++ head/share/mk/bsd.lib.mkSat Jun  9 11:41:29 2012(r236810)
@@ -74,7 +74,7 @@ PO_FLAG=-pg
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o 
${.TARGET}
${CTFCONVERT_CMD}
 
-.cc.o:
+.cc.o .C.o .cpp.o .cxx.o:
${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 
 .cc.po .C.po .cpp.po .cxx.po:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r204101 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2010-02-20 Thread Dimitry Andric

On 2010-02-20 12:56, Alexey Dokuchaev wrote:

URL: http://svn.freebsd.org/changeset/base/204101

Don't set f_bsize to recordsize. It might confuse some software (like squid).


Can submitter (or maybe you, Pawel) elaborate on the subject please?
Particularly, what exactly breaks squid and in what way?  This was not
immediately obvious from reading the diff.  Thanks.


See here for the original post to -current:

http://lists.freebsd.org/pipermail/freebsd-current/2010-February/015494.html
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r285644 - head/contrib/sqlite3

2015-07-18 Thread Dimitry Andric
On 18 Jul 2015, at 00:53, Pedro Giffuni  wrote:
> 
> On 07/17/15 17:26, Peter Jeremy wrote:
>> On 2015-Jul-16 22:07:14 +, "Pedro F. Giffuni"  wrote:
>>> Log:
>> ...
>>>  sqlite: clean a couple of invocations of memcpy(3)
>>>Found almost accidentally by our native gcc when enhanced with
>>>  FORTIFY_SOURCE.
>> ...
>>> -  memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
>>> +  memcpy((void *)&aHdr[1], (const void *)&pWal->hdr, sizeof(WalIndexHdr));
>>>   walShmBarrier(pWal);
>>> -  memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));
>>> +  memcpy((void *)&aHdr[0], (const void *)&pWal->hdr, sizeof(WalIndexHdr));
>> If the compiler complained about that, the compiler is broken.
> 
> The change was rather collateral (read cosmetical) to the real warning
> which remains unfixed.
> 
> The compiler warning is this:
> ...
> ===> lib/libsqlite3 (obj,depend,all,install)
> cc1: warnings being treated as errors
> /scratch/tmp/pfg/head/lib/libsqlite3/../../contrib/sqlite3/sqlite3.c: In 
> function 'walIndexWriteHdr':
> /scratch/tmp/pfg/head/lib/libsqlite3/../../contrib/sqlite3/sqlite3.c:49490: 
> warning: passing argument 1 of 'memcpy' discards qualifiers from pointer 
> target type
> /scratch/tmp/pfg/head/lib/libsqlite3/../../contrib/sqlite3/sqlite3.c:49492: 
> warning: passing argument 1 of 'memcpy' discards qualifiers from pointer 
> target type
> --- sqlite3.So ---
> *** [sqlite3.So] Error code 1
> ...
> 
> make[6]: stopped in /scratch/tmp/pfg/head/lib/libsqlite3
> 
> It only happens when using the experimental FORTIFY_SOURCE support [1],
> and it only happens with gcc (the base one is the only tested).
> 
> Yes, I am suspecting a compiler bug but gcc has been really useful to find
> bugs in fortify_source.

Actually, it is right to warn about this, as the casts drop a volatile
specifier:

 49482  static void walIndexWriteHdr(Wal *pWal){
 49483volatile WalIndexHdr *aHdr = walIndexHdr(pWal);
...
 49490memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
 49491walShmBarrier(pWal);
 49492memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));

If you compile this with clang, and a high enough WARNS level, it tells
you where the problem is:

contrib/sqlite3/sqlite3.c:49490:18: error: cast from 'volatile struct 
WalIndexHdr *' to 'void *' drops volatile qualifier [-Werror,-Wcast-qual]
  memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
 ^
contrib/sqlite3/sqlite3.c:49492:18: error: cast from 'volatile struct 
WalIndexHdr *' to 'void *' drops volatile qualifier [-Werror,-Wcast-qual]
  memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));
 ^

Similar with newer versions of gcc:

contrib/sqlite3/sqlite3.c:49490:10: error: cast discards 'volatile' qualifier 
from pointer target type [-Werror=cast-qual]
   memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
  ^
contrib/sqlite3/sqlite3.c:49492:10: error: cast discards 'volatile' qualifier 
from pointer target type [-Werror=cast-qual]
   memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));
  ^

Removing all the casts does not help, with base gcc it still gives:

contrib/sqlite3/sqlite3.c:49490: warning: passing argument 1 of 'memcpy' 
discards qualifiers from pointer target type
contrib/sqlite3/sqlite3.c:49492: warning: passing argument 1 of 'memcpy' 
discards qualifiers from pointer target type

and with clang:

contrib/sqlite3/sqlite3.c:49490:10: error: passing 'volatile WalIndexHdr *' 
(aka 'volatile struct WalIndexHdr *') to parameter of type 'void *' discards 
qualifiers
  [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  memcpy(&aHdr[1], &pWal->hdr, sizeof(WalIndexHdr));
 ^~~~
/usr/include/string.h:62:31: note: passing argument to parameter here
void*memcpy(void * __restrict, const void * __restrict, size_t);
 ^
contrib/sqlite3/sqlite3.c:49492:10: error: passing 'volatile WalIndexHdr *' 
(aka 'volatile struct WalIndexHdr *') to parameter of type 'void *' discards 
qualifiers
  [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  memcpy(&aHdr[0], &pWal->hdr, sizeof(WalIndexHdr));
 ^~~~
/usr/include/string.h:62:31: note: passing argument to parameter here
void*memcpy(void * __restrict, const void * __restrict, size_t);
 ^

>>  'const'
>> is a promise to the caller that the given parameter will not be modified
>> by the callee.  There's no requirement that the passed argument be const.
>> As bde commented, the casts are all spurious.
> 
> And since this is contrib'ed code I am not going through the
> code churn but upstream has been notified.

I don't think it is likely that upstream will go through the trouble of
removing -Wcast-qual warnings.  There are 152 of them in sqlite3.c. :-)

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r286515 - head/lib/msun/src

2015-08-09 Thread Dimitry Andric
Author: dim
Date: Sun Aug  9 10:00:13 2015
New Revision: 286515
URL: https://svnweb.freebsd.org/changeset/base/286515

Log:
  In libm's exp2(3), avoid left-shifting a negative integer, which is
  undefined.  Replace it with the intended value, in a defined way.
  
  Reviewed by:  bde
  MFC after:3 days

Modified:
  head/lib/msun/src/s_exp2.c

Modified: head/lib/msun/src/s_exp2.c
==
--- head/lib/msun/src/s_exp2.c  Sun Aug  9 09:54:29 2015(r286514)
+++ head/lib/msun/src/s_exp2.c  Sun Aug  9 10:00:13 2015(r286515)
@@ -376,14 +376,14 @@ exp2(double x)
/* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */
t = tbl[i0];/* exp2t[i0] */
z -= tbl[i0 + 1];   /* eps[i0]   */
-   if (k >= -1021 << 20)
+   if (k >= -(1021 << 20))
INSERT_WORDS(twopk, 0x3ff0 + k, 0);
else
INSERT_WORDS(twopkp1000, 0x3ff0 + k + (1000 << 20), 0);
r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5;
 
/* Scale by 2**(k>>20). */
-   if(k >= -1021 << 20) {
+   if(k >= -(1021 << 20)) {
if (k == 1024 << 20)
return (r * 2.0 * 0x1p1023);
return (r * twopk);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286519 - head/contrib/binutils/gas/config

2015-08-09 Thread Dimitry Andric
Author: dim
Date: Sun Aug  9 11:06:40 2015
New Revision: 286519
URL: https://svnweb.freebsd.org/changeset/base/286519

Log:
  In GNU as, avoid left-shifting negative integers, which is undefined.
  
  MFC after:3 days

Modified:
  head/contrib/binutils/gas/config/tc-i386.c

Modified: head/contrib/binutils/gas/config/tc-i386.c
==
--- head/contrib/binutils/gas/config/tc-i386.c  Sun Aug  9 10:36:25 2015
(r286518)
+++ head/contrib/binutils/gas/config/tc-i386.c  Sun Aug  9 11:06:40 2015
(r286519)
@@ -914,8 +914,8 @@ fits_in_signed_long (offsetT num ATTRIBU
 #ifndef BFD64
   return 1;
 #else
-  return (!(((offsetT) -1 << 31) & num)
- || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31));
+  return (!(-((offsetT) 1 << 31) & num)
+ || (-((offsetT) 1 << 31) & num) == -((offsetT) 1 << 31));
 #endif
 }  /* fits_in_signed_long() */
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286699 - head/contrib/gcclibs/libcpp

2015-08-12 Thread Dimitry Andric
Author: dim
Date: Wed Aug 12 20:16:13 2015
New Revision: 286699
URL: https://svnweb.freebsd.org/changeset/base/286699

Log:
  In gcc's libcpp, stop using the INTTYPE_MAXIMUM() macro, which relies on
  undefined behavior.  The code used this macro to avoid problems on some
  broken systems which define SSIZE_MAX incorrectly, but this is not
  needed on FreeBSD, obviously.
  
  MFC after: 3 days

Modified:
  head/contrib/gcclibs/libcpp/files.c

Modified: head/contrib/gcclibs/libcpp/files.c
==
--- head/contrib/gcclibs/libcpp/files.c Wed Aug 12 20:08:54 2015
(r286698)
+++ head/contrib/gcclibs/libcpp/files.c Wed Aug 12 20:16:13 2015
(r286699)
@@ -567,7 +567,7 @@ read_file_guts (cpp_reader *pfile, _cpp_
 SSIZE_MAX to be much smaller than the actual range of the
 type.  Use INTTYPE_MAXIMUM unconditionally to ensure this
 does not bite us.  */
-  if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t))
+  if (file->st.st_size > SSIZE_MAX)
{
  cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path);
  return false;
@@ -581,7 +581,7 @@ read_file_guts (cpp_reader *pfile, _cpp_
file->path);
  return false;
}
-  else if (offset > INTTYPE_MAXIMUM (ssize_t) || (ssize_t)offset > size)
+  else if (offset > SSIZE_MAX || (ssize_t)offset > size)
{
  cpp_error (pfile, CPP_DL_ERROR, "current position of %s is too large",
file->path);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286702 - head/sbin/ipfw

2015-08-12 Thread Dimitry Andric
Author: dim
Date: Wed Aug 12 21:07:57 2015
New Revision: 286702
URL: https://svnweb.freebsd.org/changeset/base/286702

Log:
  In ipfw2, avoid left-shifting negative integers, which is undefined.
  While here, make some other arguments to htonl(3) unsigned too.
  
  MFC after:3 days

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Wed Aug 12 20:50:20 2015(r286701)
+++ head/sbin/ipfw/ipfw2.c  Wed Aug 12 21:07:57 2015(r286702)
@@ -2869,14 +2869,14 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int
case '/':
masklen = atoi(p);
if (masklen == 0)
-   d[1] = htonl(0);/* mask */
+   d[1] = htonl(0U);   /* mask */
else if (masklen > 32)
errx(EX_DATAERR, "bad width ``%s''", p);
else
-   d[1] = htonl(~0 << (32 - masklen));
+   d[1] = htonl(~0U << (32 - masklen));
break;
case '{':   /* no mask, assume /24 and put back the '{' */
-   d[1] = htonl(~0 << (32 - 24));
+   d[1] = htonl(~0U << (32 - 24));
*(--p) = md;
break;
 
@@ -2885,7 +2885,7 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int
/* FALLTHROUGH */
case 0: /* initialization value */
default:
-   d[1] = htonl(~0);   /* force /32 */
+   d[1] = htonl(~0U);  /* force /32 */
break;
}
d[0] &= d[1];   /* mask base address with mask */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286733 - head/sys/dev/bxe

2015-08-13 Thread Dimitry Andric
Author: dim
Date: Thu Aug 13 18:24:41 2015
New Revision: 286733
URL: https://svnweb.freebsd.org/changeset/base/286733

Log:
  Avoid left-shifting negative signed values in bxe(4).
  
  Reviewed by:  davidcs
  MFC after:3 days

Modified:
  head/sys/dev/bxe/ecore_hsi.h

Modified: head/sys/dev/bxe/ecore_hsi.h
==
--- head/sys/dev/bxe/ecore_hsi.hThu Aug 13 18:01:50 2015
(r286732)
+++ head/sys/dev/bxe/ecore_hsi.hThu Aug 13 18:24:41 2015
(r286733)
@@ -2536,9 +2536,9 @@ struct shmem2_region {
#define SHMEM_EEE_SUPPORTED_MASK   0x000f
#define SHMEM_EEE_SUPPORTED_SHIFT  16
#define SHMEM_EEE_ADV_STATUS_MASK  0x00f0
-   #define SHMEM_EEE_100M_ADV (1<<0)
-   #define SHMEM_EEE_1G_ADV   (1<<1)
-   #define SHMEM_EEE_10G_ADV  (1<<2)
+   #define SHMEM_EEE_100M_ADV (1U<<0)
+   #define SHMEM_EEE_1G_ADV   (1U<<1)
+   #define SHMEM_EEE_10G_ADV  (1U<<2)
#define SHMEM_EEE_ADV_STATUS_SHIFT 20
#define SHMEM_EEE_LP_ADV_STATUS_MASK   0x0f00
#define SHMEM_EEE_LP_ADV_STATUS_SHIFT  24
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287007 - head/share/mk

2015-08-21 Thread Dimitry Andric
On 21 Aug 2015, at 21:51, Warner Losh  wrote:
> 
> Author: imp
> Date: Fri Aug 21 19:51:27 2015
> New Revision: 287007
> URL: https://svnweb.freebsd.org/changeset/base/287007
> 
> Log:
>  Document bsd.compiler.mk and the variables it defines.

Thanks!!



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r287501 - head/contrib/llvm/tools/lldb

2015-09-06 Thread Dimitry Andric
Author: dim
Date: Sun Sep  6 11:48:50 2015
New Revision: 287501
URL: https://svnweb.freebsd.org/changeset/base/287501

Log:
  Update lldb's FREEBSD-Xlist to match reality.

Modified:
  head/contrib/llvm/tools/lldb/FREEBSD-Xlist

Modified: head/contrib/llvm/tools/lldb/FREEBSD-Xlist
==
--- head/contrib/llvm/tools/lldb/FREEBSD-Xlist  Sun Sep  6 11:23:01 2015
(r287500)
+++ head/contrib/llvm/tools/lldb/FREEBSD-Xlist  Sun Sep  6 11:48:50 2015
(r287501)
@@ -3,6 +3,7 @@
 .clang-format
 .gitignore
 CMakeLists.txt
+CODE_OWNERS.txt
 INSTALL.txt
 Makefile
 cmake/
@@ -27,6 +28,7 @@ include/lldb/Host/msvc/
 include/lldb/Host/windows/
 include/lldb/Makefile
 lib/
+lit/
 lldb.xcodeproj/
 lldb.xcworkspace/
 resources/
@@ -46,12 +48,15 @@ source/Expression/CMakeLists.txt
 source/Expression/Makefile
 source/Host/CMakeLists.txt
 source/Host/Makefile
+source/Host/android/
 source/Host/common/Makefile
 source/Host/freebsd/Makefile
 source/Host/linux/
 source/Host/macosx/
 source/Host/posix/Makefile
 source/Host/windows/
+source/Initialization/CMakeLists.txt
+source/Initialization/Makefile
 source/Interpreter/CMakeLists.txt
 source/Interpreter/Makefile
 source/Makefile
@@ -62,8 +67,18 @@ source/Plugins/ABI/MacOSX-arm64/CMakeLis
 source/Plugins/ABI/MacOSX-arm64/Makefile
 source/Plugins/ABI/MacOSX-i386/CMakeLists.txt
 source/Plugins/ABI/MacOSX-i386/Makefile
+source/Plugins/ABI/SysV-arm/CMakeLists.txt
+source/Plugins/ABI/SysV-arm/Makefile
+source/Plugins/ABI/SysV-arm64/CMakeLists.txt
+source/Plugins/ABI/SysV-arm64/Makefile
 source/Plugins/ABI/SysV-hexagon/CMakeLists.txt
 source/Plugins/ABI/SysV-hexagon/Makefile
+source/Plugins/ABI/SysV-i386/CMakeLists.txt
+source/Plugins/ABI/SysV-i386/Makefile
+source/Plugins/ABI/SysV-mips/CMakeLists.txt
+source/Plugins/ABI/SysV-mips/Makefile
+source/Plugins/ABI/SysV-mips64/CMakeLists.txt
+source/Plugins/ABI/SysV-mips64/Makefile
 source/Plugins/ABI/SysV-ppc/CMakeLists.txt
 source/Plugins/ABI/SysV-ppc/Makefile
 source/Plugins/ABI/SysV-ppc64/CMakeLists.txt
@@ -88,6 +103,10 @@ source/Plugins/Instruction/ARM/Makefile
 source/Plugins/Instruction/ARM64/CMakeLists.txt
 source/Plugins/Instruction/ARM64/Makefile
 source/Plugins/Instruction/CMakeLists.txt
+source/Plugins/Instruction/MIPS/CMakeLists.txt
+source/Plugins/Instruction/MIPS/Makefile
+source/Plugins/Instruction/MIPS64/CMakeLists.txt
+source/Plugins/Instruction/MIPS64/Makefile
 source/Plugins/InstrumentationRuntime/AddressSanitizer/CMakeLists.txt
 source/Plugins/InstrumentationRuntime/AddressSanitizer/Makefile
 source/Plugins/InstrumentationRuntime/CMakeLists.txt
@@ -99,6 +118,9 @@ source/Plugins/LanguageRuntime/CPlusPlus
 source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt
 source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/Makefile
 source/Plugins/LanguageRuntime/ObjC/
+source/Plugins/LanguageRuntime/RenderScript/CMakeLists.txt
+source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
+source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/Makefile
 source/Plugins/Makefile
 source/Plugins/MemoryHistory/CMakeLists.txt
 source/Plugins/MemoryHistory/asan/CMakeLists.txt
@@ -117,6 +139,7 @@ source/Plugins/ObjectFile/PECOFF/
 source/Plugins/OperatingSystem/CMakeLists.txt
 source/Plugins/OperatingSystem/Python/CMakeLists.txt
 source/Plugins/OperatingSystem/Python/Makefile
+source/Plugins/Platform/Android/
 source/Plugins/Platform/CMakeLists.txt
 source/Plugins/Platform/FreeBSD/CMakeLists.txt
 source/Plugins/Platform/FreeBSD/Makefile
@@ -168,6 +191,7 @@ source/Utility/Makefile
 test/
 tools/CMakeLists.txt
 tools/Makefile
+tools/argdumper/CMakeLists.txt
 tools/darwin-debug/
 tools/darwin-threads/
 tools/debugserver/
@@ -180,7 +204,9 @@ tools/lldb-mi/CMakeLists.txt
 tools/lldb-mi/Makefile
 tools/lldb-mi/lldb-Info.plist
 tools/lldb-perf/
-tools/lldb-platform/CMakeLists.txt
-tools/lldb-platform/Makefile
+tools/lldb-platform/
+tools/lldb-server/CMakeLists.txt
+tools/lldb-server/Makefile
+unittests/
 utils/
 www/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287541 - head/lib/libz

2015-09-07 Thread Dimitry Andric
Author: dim
Date: Mon Sep  7 20:55:14 2015
New Revision: 287541
URL: https://svnweb.freebsd.org/changeset/base/287541

Log:
  In libz's inflateMark(), avoid left-shifting a negative integer, which
  is undefined.
  
  Reviewed by:  delphij
  Differential Revision: https://reviews.freebsd.org/D3344
  MFC after:3 days

Modified:
  head/lib/libz/inflate.c

Modified: head/lib/libz/inflate.c
==
--- head/lib/libz/inflate.c Mon Sep  7 20:05:56 2015(r287540)
+++ head/lib/libz/inflate.c Mon Sep  7 20:55:14 2015(r287541)
@@ -1504,7 +1504,7 @@ z_streamp strm;
 {
 struct inflate_state FAR *state;
 
-if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16);
 state = (struct inflate_state FAR *)strm->state;
 return ((long)(state->back) << 16) +
 (state->mode == COPY ? state->length :
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287679 - in head/contrib/libc++: . include

2015-09-11 Thread Dimitry Andric
Author: dim
Date: Fri Sep 11 17:14:58 2015
New Revision: 287679
URL: https://svnweb.freebsd.org/changeset/base/287679

Log:
  Since contrib/libc++'s ancestry was never correct, subversion 1.8 and
  higher cannot merge to it from the vendor area.
  
  Re-bootstrap the ancestry by doing (apologies to your retinas):
  * svn rm contrib/libc++
  * svn cp ^/vendor/libc++/dist@276792 contrib/libc++
  * svn cp ^/head/contrib/libc++/FREEBSD-upgrade@287629 contrib/libc++
  * svn cp ^/head/contrib/libc++/include/__bit_reference@287629 
contrib/libc++/include
  * svn cp ^/head/contrib/libc++/include/__config@287629 contrib/libc++/include
  * svn cp ^/head/contrib/libc++/include/__tree@287629 contrib/libc++/include
  * svn cp ^/head/contrib/libc++/include/algorithm@287629 contrib/libc++/include
  * svn cp ^/head/contrib/libc++/include/stdexcept@287629 contrib/libc++/include
  * svn cp ^/head/contrib/libc++/include/type_traits@287629 
contrib/libc++/include
  * svn pd -R svn:mergeinfo contrib/libc++
  * svn ps -F mergeinfo.txt contrib/libc++

Added:
  head/contrib/libc++/FREEBSD-upgrade
 - copied unchanged from r287629, head/contrib/libc++/FREEBSD-upgrade
Replaced:
 - copied from r276792, vendor/libc++/dist/
  head/contrib/libc++/include/__bit_reference
 - copied unchanged from r287629, 
head/contrib/libc++/include/__bit_reference
  head/contrib/libc++/include/__config
 - copied unchanged from r287629, head/contrib/libc++/include/__config
  head/contrib/libc++/include/__tree
 - copied unchanged from r287629, head/contrib/libc++/include/__tree
  head/contrib/libc++/include/algorithm
 - copied unchanged from r287629, head/contrib/libc++/include/algorithm
  head/contrib/libc++/include/stdexcept
 - copied unchanged from r287629, head/contrib/libc++/include/stdexcept
  head/contrib/libc++/include/type_traits
 - copied unchanged from r287629, head/contrib/libc++/include/type_traits
Directory Properties:
  head/contrib/libc++/   (props changed)

Copied: head/contrib/libc++/FREEBSD-upgrade (from r287629, 
head/contrib/libc++/FREEBSD-upgrade)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/libc++/FREEBSD-upgrade Fri Sep 11 17:14:58 2015
(r287679, copy of r287629, head/contrib/libc++/FREEBSD-upgrade)
@@ -0,0 +1,8 @@
+$FreeBSD$
+
+The FreeBSD copy of libc++.  This contains everything from the include and 
+source directories upstream, with the exception of the support/win32 
directory, 
+which is only required for building on Windows (FreeBSD is not Windows).
+
+To update, bring in anything new in source or include that is not
+platform-dependent (unless the platform in question is FreeBSD, obviously).

Copied: head/contrib/libc++/include/__bit_reference (from r287629, 
head/contrib/libc++/include/__bit_reference)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/libc++/include/__bit_reference Fri Sep 11 17:14:58 2015
(r287679, copy of r287629, head/contrib/libc++/include/__bit_reference)
@@ -0,0 +1,1286 @@
+// -*- C++ -*-
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP___BIT_REFERENCE
+#define _LIBCPP___BIT_REFERENCE
+
+#include <__config>
+#include 
+
+#include <__undef_min_max>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template  class 
__bit_iterator;
+template  class __bit_const_reference;
+
+template 
+struct __has_storage_type
+{
+static const bool value = false;
+};
+
+template ::value>
+class __bit_reference
+{
+typedef typename _Cp::__storage_type__storage_type;
+typedef typename _Cp::__storage_pointer __storage_pointer;
+
+__storage_pointer __seg_;
+__storage_type__mask_;
+
+#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
+friend typename _Cp::__self;
+#else
+friend class _Cp::__self;
+#endif
+friend class __bit_const_reference<_Cp>;
+friend class __bit_iterator<_Cp, false>;
+public:
+_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
+{return static_cast(*__seg_ & __mask_);}
+_LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT
+{return !static_cast(*this);}
+
+_LIBCPP_INLINE_VISIBILITY
+__bit_reference& operator=(bool __x) _NOEXCEPT
+{
+if (__x)
+*__seg_ |= __mask_;
+else
+*__seg_ &= ~__mask_;
+return *this;
+}
+
+_LIBCPP_INLINE_VISIBILITY
+__bit_reference& operat

svn commit: r274697 - head/sys/cddl/contrib/opensolaris/uts/common/sys

2014-11-18 Thread Dimitry Andric
Author: dim
Date: Wed Nov 19 07:44:21 2014
New Revision: 274697
URL: https://svnweb.freebsd.org/changeset/base/274697

Log:
  Fix the following -Werror warning from clang 3.5.0, while building 
cddl/lib/libctf:
  
  In file included from cddl/contrib/opensolaris/common/ctf/ctf_create.c:31:
  In file included from 
sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h:34:
  sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h:334:9: warning: 
'_ILP32' macro redefined [-Wmacro-redefined]
  #define _ILP32
  ^
  :26:9: note: previous definition is here
  #define _ILP32 1
  ^
  1 warning generated.
  
  This is because clang 3.5.0 started predefining _ILP32 and __ILP32__ for
  the i386 arch.  (Earlier versions already predefined _LP64 and __LP64__
  for the x86_64 arch.)
  
  Reviewed by:  emaste, avg, smh, delphij, markj
  Differential Revision: https://reviews.freebsd.org/D1187

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Wed Nov 19 
07:24:43 2014(r274696)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Wed Nov 19 
07:44:21 2014(r274697)
@@ -331,7 +331,9 @@ extern "C" {
 /*
  * Define the appropriate "implementation choices".
  */
+#if !defined(_ILP32)
 #define_ILP32
+#endif
 #if !defined(_I32LPx) && defined(_KERNEL)
 #define_I32LPx
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r274698 - head/sys/contrib/ngatm/netnatm/saal

2014-11-18 Thread Dimitry Andric
Author: dim
Date: Wed Nov 19 07:47:37 2014
New Revision: 274698
URL: https://svnweb.freebsd.org/changeset/base/274698

Log:
  Fix the following -Werror warning from clang 3.5.0, while building
  lib/libngatm:
  
  sys/contrib/ngatm/netnatm/saal/saal_sscop.c:4030:32: error: 'break' is bound 
to current loop, GCC binds it to the enclosing loop [-Werror,-Wgcc-compat]
  } while(sn < sscop->vr_h && !QFIND(&sscop->rbuf, sn));
   ^
  sys/contrib/ngatm/netnatm/saal/saal_sscop.c:173:4: note: expanded from macro 
'QFIND'
  break;  \
  ^
  1 error generated.
  
  The idea is to remove any ambiguity by replacing the macro with an
  equivalent static inline function.
  
  Reviewed by:  emaste, rpaulo
  See also: http://reviews.llvm.org/D2518
  Differential Revision: https://reviews.freebsd.org/D1188

Modified:
  head/sys/contrib/ngatm/netnatm/saal/saal_sscop.c

Modified: head/sys/contrib/ngatm/netnatm/saal/saal_sscop.c
==
--- head/sys/contrib/ngatm/netnatm/saal/saal_sscop.cWed Nov 19 07:44:21 
2014(r274697)
+++ head/sys/contrib/ngatm/netnatm/saal/saal_sscop.cWed Nov 19 07:47:37 
2014(r274698)
@@ -163,18 +163,17 @@ static void sscop_set_state(struct sscop
}   \
 } while(0)
 
-
-#define QFIND(Q,RN)\
-({ \
-   struct sscop_msg *_msg = NULL, *_m; \
-   MSGQ_FOREACH(_m, (Q)) { \
-   if(_m->seqno == (RN)) { \
-   _msg = _m;  \
-   break;  \
-   }   \
-   }   \
-   _msg;   \
-})
+static inline struct sscop_msg *QFIND(sscop_msgq_head_t *q, u_int rn)
+{
+   struct sscop_msg *msg = NULL, *m;
+   MSGQ_FOREACH(m, q) {
+   if(m->seqno == rn) {
+   msg = m;
+   break;
+   }
+   }
+   return msg;
+}
 
 #define QINSERT(Q,M)   \
 do {   \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r274846 - head/contrib/libarchive/cpio

2014-11-22 Thread Dimitry Andric
Author: dim
Date: Sat Nov 22 12:10:09 2014
New Revision: 274846
URL: https://svnweb.freebsd.org/changeset/base/274846

Log:
  Fix the following -Werror warning from clang 3.5.0, while building
  usr.bin/cpio on amd64 (or any arch with 64-bit time_t):
  
  contrib/libarchive/cpio/cpio.c:1143:6: error: absolute value function 'abs' 
given an argument of type 'long' but has parameter of type 'int' which may 
cause truncation of value [-Werror,-Wabsolute-value]
  if (abs(mtime - now) > (365/2)*86400)
  ^
  contrib/libarchive/cpio/cpio.c:1143:6: note: use function 'labs' instead
  if (abs(mtime - now) > (365/2)*86400)
  ^~~
  labs
  1 error generated.
  
  This is because time_t is a long on amd64. To avoid the warning, just
  copy the equivalent test from a few lines before, which is used in the
  Windows case, and which is type safe.
  
  Reviewed by:  emaste
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D1198

Modified:
  head/contrib/libarchive/cpio/cpio.c

Modified: head/contrib/libarchive/cpio/cpio.c
==
--- head/contrib/libarchive/cpio/cpio.c Sat Nov 22 09:45:32 2014
(r274845)
+++ head/contrib/libarchive/cpio/cpio.c Sat Nov 22 12:10:09 2014
(r274846)
@@ -1140,7 +1140,8 @@ list_item_verbose(struct cpio *cpio, str
else
fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M";
 #else
-   if (abs(mtime - now) > (365/2)*86400)
+   if (mtime - now > 365*86400/2
+   || mtime - now < -365*86400/2)
fmt = cpio->day_first ? "%e %b  %Y" : "%b %e  %Y";
else
fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r274847 - head/usr.bin/locate/locate

2014-11-22 Thread Dimitry Andric
Author: dim
Date: Sat Nov 22 12:13:05 2014
New Revision: 274847
URL: https://svnweb.freebsd.org/changeset/base/274847

Log:
  Fix the following -Werror warnings from clang 3.5.0, while building
  usr.bin/locate:
  
  usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of 
unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
  MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : 
htonl(i));
   ^
  usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since 
unsigned values cannot be negative
  MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : 
htonl(i));
   ^~~
  usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of 
unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
  MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
  ^
  usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since 
unsigned values cannot be negative
  MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
  ^~~
  
  The problem is that ntohl() always returns an unsigned quantity.  In
  this case, it's expected to be cast back to a signed integer, but to
  stop complaints about abs() we just store it into an integer, and don't
  call ntohl() again.
  
  Reviewed by:  ngie
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D1196

Modified:
  head/usr.bin/locate/locate/util.c

Modified: head/usr.bin/locate/locate/util.c
==
--- head/usr.bin/locate/locate/util.c   Sat Nov 22 12:10:09 2014
(r274846)
+++ head/usr.bin/locate/locate/util.c   Sat Nov 22 12:13:05 2014
(r274847)
@@ -235,7 +235,7 @@ getwm(p)
char buf[INTSIZE];
int i;
} u;
-   register int i;
+   register int i, hi;
 
for (i = 0; i < (int)INTSIZE; i++)
u.buf[i] = *p++;
@@ -243,10 +243,11 @@ getwm(p)
i = u.i;
 
if (i > MAXPATHLEN || i < -(MAXPATHLEN)) {
-   i = ntohl(i);
-   if (i > MAXPATHLEN || i < -(MAXPATHLEN))
+   hi = ntohl(i);
+   if (hi > MAXPATHLEN || hi < -(MAXPATHLEN))
errx(1, "integer out of +-MAXPATHLEN (%d): %u",
-   MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
+   MAXPATHLEN, abs(i) < abs(hi) ? i : hi);
+   return(hi);
}
return(i);
 }
@@ -263,16 +264,16 @@ int
 getwf(fp)
FILE *fp;
 {
-   register int word;
+   register int word, hword;
 
word = getw(fp);
 
if (word > MAXPATHLEN || word < -(MAXPATHLEN)) {
-   word = ntohl(word);
-   if (word > MAXPATHLEN || word < -(MAXPATHLEN))
+   hword = ntohl(word);
+   if (hword > MAXPATHLEN || hword < -(MAXPATHLEN))
errx(1, "integer out of +-MAXPATHLEN (%d): %u",
-   MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
-   htonl(word));
+   MAXPATHLEN, abs(word) < abs(hword) ? word : hword);
+   return(hword);
}
return(word);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r274856 - head/contrib/binutils/gas/config

2014-11-22 Thread Dimitry Andric
Author: dim
Date: Sat Nov 22 16:30:31 2014
New Revision: 274856
URL: https://svnweb.freebsd.org/changeset/base/274856

Log:
  Avoid undefined behaviour in gas's rotate_left() macro for n == 0.
  Otherwise, clang can effectively remove the first iteration of the for
  loops where this macro is invoked, and as a result, "cmp r0, #99" fails
  to assemble.
  
  Obtained from:joerg at netbsd
  MFC after:3 days

Modified:
  head/contrib/binutils/gas/config/tc-arm.c

Modified: head/contrib/binutils/gas/config/tc-arm.c
==
--- head/contrib/binutils/gas/config/tc-arm.c   Sat Nov 22 16:27:51 2014
(r274855)
+++ head/contrib/binutils/gas/config/tc-arm.c   Sat Nov 22 16:30:31 2014
(r274856)
@@ -6079,7 +6079,7 @@ parse_operands (char *str, const unsigne
 
 /* Functions for operand encoding.  ARM, then Thumb.  */
 
-#define rotate_left(v, n) (v << n | v >> (32 - n))
+#define rotate_left(v, n) (v << (n % 32) | v >> ((32 - n) % 32))
 
 /* If VAL can be encoded in the immediate field of an ARM instruction,
return the encoded form.  Otherwise, return FAIL.  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r274898 - head/usr.sbin/rtadvd

2014-11-22 Thread Dimitry Andric
Author: dim
Date: Sat Nov 22 23:04:33 2014
New Revision: 274898
URL: https://svnweb.freebsd.org/changeset/base/274898

Log:
  Fix the following -Werror warnings from clang 3.5.0, while building
  usr.sbin/rtadvd:
  
  usr.sbin/rtadvd/rtadvd.c:1291:7: error: taking the absolute value of unsigned 
type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
  abs(preferred_time - pfx->pfx_pltimeexpire) > 
rai->rai_clockskew) {
  ^
  usr.sbin/rtadvd/rtadvd.c:1291:7: note: remove the call to 'abs' since 
unsigned values cannot be negative
  abs(preferred_time - pfx->pfx_pltimeexpire) > 
rai->rai_clockskew) {
  ^~~
  usr.sbin/rtadvd/rtadvd.c:1324:7: error: taking the absolute value of unsigned 
type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
  abs(valid_time - pfx->pfx_vltimeexpire) > 
rai->rai_clockskew) {
  ^
  usr.sbin/rtadvd/rtadvd.c:1324:7: note: remove the call to 'abs' since 
unsigned values cannot be negative
  abs(valid_time - pfx->pfx_vltimeexpire) > 
rai->rai_clockskew) {
  ^~~
  2 errors generated.
  
  These warnings occur because both preferred_time and pfx_pltimeexpire
  are uint32_t's, so the subtraction expression is also unsigned, and
  calling abs() is a no-op.
  
  However, the intention was to look at the absolute difference between
  the two unsigned quantities.  Introduce a small static function to
  clarify what we're doing, and call that instead.
  
  Reviewed by:  hrs
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D1197

Modified:
  head/usr.sbin/rtadvd/rtadvd.c

Modified: head/usr.sbin/rtadvd/rtadvd.c
==
--- head/usr.sbin/rtadvd/rtadvd.c   Sat Nov 22 22:13:00 2014
(r274897)
+++ head/usr.sbin/rtadvd/rtadvd.c   Sat Nov 22 23:04:33 2014
(r274898)
@@ -1230,6 +1230,12 @@ ra_input(int len, struct nd_router_adver
return;
 }
 
+static uint32_t
+udiff(uint32_t u, uint32_t v)
+{
+   return (u >= v ? u - v : v - u);
+}
+
 /* return a non-zero value if the received prefix is inconsitent with ours */
 static int
 prefix_check(struct nd_opt_prefix_info *pinfo,
@@ -1288,7 +1294,7 @@ prefix_check(struct nd_opt_prefix_info *
preferred_time += now.tv_sec;
 
if (!pfx->pfx_timer && rai->rai_clockskew &&
-   abs(preferred_time - pfx->pfx_pltimeexpire) > 
rai->rai_clockskew) {
+   udiff(preferred_time, pfx->pfx_pltimeexpire) > 
rai->rai_clockskew) {
syslog(LOG_INFO,
"<%s> preferred lifetime for %s/%d"
" (decr. in real time) inconsistent on %s:"
@@ -1321,7 +1327,7 @@ prefix_check(struct nd_opt_prefix_info *
valid_time += now.tv_sec;
 
if (!pfx->pfx_timer && rai->rai_clockskew &&
-   abs(valid_time - pfx->pfx_vltimeexpire) > 
rai->rai_clockskew) {
+   udiff(valid_time, pfx->pfx_vltimeexpire) > 
rai->rai_clockskew) {
syslog(LOG_INFO,
"<%s> valid lifetime for %s/%d"
" (decr. in real time) inconsistent on %s:"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r274900 - head/usr.sbin/bsnmpd/modules/snmp_hostres

2014-11-22 Thread Dimitry Andric
Author: dim
Date: Sat Nov 22 23:50:18 2014
New Revision: 274900
URL: https://svnweb.freebsd.org/changeset/base/274900

Log:
  Fix the following -Werror warnings from clang 3.5.0, while building
  bsnmpd's snmp_hostres module:
  
  usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute 
value function 'abs' given an argument of type 'const long' but has parameter 
of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
  str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
^
  usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use 
function 'labs' instead
  str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
^~~
labs
  usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute 
value function 'abs' given an argument of type 'const long' but has parameter 
of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
  str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
  ^
  usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use 
function 'labs' instead
  str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
  ^~~
  labs
  
  Since tm::tm_gmtoff is a long, use labs(3) instead.
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.cSat Nov 22 
23:28:41 2014(r274899)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.cSat Nov 22 
23:50:18 2014(r274900)
@@ -201,8 +201,8 @@ make_date_time(u_char *str, const struct
else
str[8] = '+';
 
-   str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
-   str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
+   str[9] = (u_char)(labs(tm->tm_gmtoff) / 3600);
+   str[10] = (u_char)((labs(tm->tm_gmtoff) % 3600) / 60);
 
return (11);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


<    5   6   7   8   9   10   11   12   13   14   >