[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - nss/makefile.mk nss/nspr-4.8.4-clang.patch openssl/makefile.mk openssl/openssl-0.9.8o-clang.patch

Herbert Dürr hdu at apache.org
Thu Mar 28 17:33:29 PDT 2013


 nss/makefile.mk                    |    2 
 nss/nspr-4.8.4-clang.patch         |  194 +++++++++++++++++++++++++++++++++++++
 openssl/makefile.mk                |    2 
 openssl/openssl-0.9.8o-clang.patch |   11 ++
 4 files changed, 208 insertions(+), 1 deletion(-)

New commits:
commit 0056d3aaa86b3747c11cb8cf5260cc0dac298da3
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Mar 28 15:36:28 2013 +0000

    the %cc clobber is implicit on x86* as it does not have an explicit condition-code register
    
    Using the %cc clobber for this target is rejected by clang. Not even the
    examples in gcc documents on its inline assembler use that cc-clobber.

diff --git a/nss/nspr-4.8.4-clang.patch b/nss/nspr-4.8.4-clang.patch
index 505501e..974ec68 100644
--- a/nss/nspr-4.8.4-clang.patch
+++ b/nss/nspr-4.8.4-clang.patch
@@ -136,3 +136,59 @@
 -/ Magic indicating no need for an executable stack
 +/* Magic indicating no need for an executable stack */
  .section .note.GNU-stack, "", @progbits ; .previous
+--- misc/nss-3.12.6/mozilla/security/nss/lib/freebl/mpi/mp_comba.c	2008-03-09 07:06:27.000000000 +0100
++++ misc/build/nss-3.12.6/mozilla/security/nss/lib/freebl/mpi/mp_comba.c	2013-03-28 17:17:58.895379167 +0100
+@@ -49,7 +49,7 @@
+      "addq  %%rax,%0     \n\t"                            \
+      "adcq  %%rdx,%1     \n\t"                            \
+      "adcq  $0,%2        \n\t"                            \
+-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
++     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx");
+ 
+ 
+ 
+@@ -76,7 +76,7 @@
+      "addq  %%rax,%0     \n\t"                            \
+      "adcq  %%rdx,%1     \n\t"                            \
+      "adcq  $0,%2        \n\t"                            \
+-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","%cc");
++     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx");
+ 
+ #define SQRADD2(i, j)                                     \
+ __asm__ (                                                     \
+@@ -88,7 +88,7 @@
+      "addq  %%rax,%0     \n\t"                            \
+      "adcq  %%rdx,%1     \n\t"                            \
+      "adcq  $0,%2        \n\t"                            \
+-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
++     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx");
+ 
+ #define SQRADDSC(i, j)                                    \
+ __asm__ (                                                     \
+@@ -97,7 +97,7 @@
+      "movq  %%rax,%0     \n\t"                            \
+      "movq  %%rdx,%1     \n\t"                            \
+      "xorq  %2,%2        \n\t"                            \
+-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","%cc");
++     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx");
+ 
+ #define SQRADDAC(i, j)                                                         \
+ __asm__ (                                                     \
+@@ -106,7 +106,7 @@
+      "addq  %%rax,%0     \n\t"                            \
+      "adcq  %%rdx,%1     \n\t"                            \
+      "adcq  $0,%2        \n\t"                            \
+-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
++     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx");
+ 
+ #define SQRADDDB                                                               \
+ __asm__ (                                                     \
+@@ -116,7 +116,7 @@
+      "addq %6,%0         \n\t"                            \
+      "adcq %7,%1         \n\t"                            \
+      "adcq %8,%2         \n\t"                            \
+-     :"=&r"(c0), "=&r"(c1), "=&r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
++     :"=&r"(c0), "=&r"(c1), "=&r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2));
+ 
+ 
+ 
commit ad77bec91c2fbb3387155d4227b6c5ee3c35333e
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Mar 28 15:23:57 2013 +0000

    change comment format in asm source for clang compatibility

diff --git a/nss/makefile.mk b/nss/makefile.mk
index 088ed1a..fd2116c 100644
--- a/nss/makefile.mk
+++ b/nss/makefile.mk
@@ -89,7 +89,7 @@ BUILD_ACTION= $(GNUMAKE) nss_build_all
 #See #i105566# && moz#513024#
 .IF "$(OS)"=="LINUX"
 BUILD_ACTION+=FREEBL_NO_DEPEND=1
-PATCH_FILES+=nss_linux.patch
+PATCH_FILES+=nss_linux.patch nspr-4.8.4-clang.patch
 .ENDIF
 
 .ENDIF			# "$(GUI)"=="UNX"
diff --git a/nss/nspr-4.8.4-clang.patch b/nss/nspr-4.8.4-clang.patch
new file mode 100644
index 0000000..505501e
--- /dev/null
+++ b/nss/nspr-4.8.4-clang.patch
@@ -0,0 +1,138 @@
+--- misc/nss-3.12.6/mozilla/nsprpub/pr/src/md/unix/os_Linux_x86.s	2006-12-11 10:45:30.000000000 +0100
++++ misc/build/nss-3.12.6/mozilla/nsprpub/pr/src/md/unix/os_Linux_x86.s	2013-03-28 17:11:50.919079879 +0100
+@@ -1,4 +1,4 @@
+-/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ / 
+ / ***** BEGIN LICENSE BLOCK *****
+ / Version: MPL 1.1/GPL 2.0/LGPL 2.1
+@@ -40,7 +40,8 @@
+ /
+ / Atomically increment the integer pointed to by 'val' and return
+ / the result of the increment.
+-/
++/ */
++
+     .text
+     .globl _PR_x86_AtomicIncrement
+     .align 4
+@@ -52,11 +53,11 @@
+     incl %eax
+     ret
+ 
+-/ PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val)
++/* PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val)
+ /
+ / Atomically decrement the integer pointed to by 'val' and return
+ / the result of the decrement.
+-/
++/ */
+     .text
+     .globl _PR_x86_AtomicDecrement
+     .align 4
+@@ -68,7 +69,7 @@
+     decl %eax
+     ret
+ 
+-/ PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval)
++/* PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval)
+ /
+ / Atomically set the integer pointed to by 'val' to the new
+ / value 'newval' and return the old value.
+@@ -86,7 +87,7 @@
+ /   cmpxchgl %edx, (%ecx)
+ /   jne retry
+ /   ret
+-/
++/ */
+     .text
+     .globl _PR_x86_AtomicSet
+     .align 4
+@@ -96,11 +97,11 @@
+     xchgl %eax, (%ecx)
+     ret
+ 
+-/ PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val)
++/* PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val)
+ /
+ / Atomically add 'val' to the integer pointed to by 'ptr'
+ / and return the result of the addition.
+-/
++/ */
+     .text
+     .globl _PR_x86_AtomicAdd
+     .align 4
+@@ -113,5 +114,5 @@
+     addl %edx, %eax
+     ret
+ 
+-/ Magic indicating no need for an executable stack
++/* Magic indicating no need for an executable stack */
+ .section .note.GNU-stack, "", @progbits ; .previous
+--- misc/nss-3.12.6/mozilla/nsprpub/pr/src/md/unix/os_Linux_x86_64.s	2006-12-11 10:45:30.000000000 +0100
++++ misc/build/nss-3.12.6/mozilla/nsprpub/pr/src/md/unix/os_Linux_x86_64.s	2013-03-28 17:12:00.215016941 +0100
+@@ -1,4 +1,4 @@
+-/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ / 
+ / ***** BEGIN LICENSE BLOCK *****
+ / Version: MPL 1.1/GPL 2.0/LGPL 2.1
+@@ -40,7 +40,8 @@
+ /
+ / Atomically increment the integer pointed to by 'val' and return
+ / the result of the increment.
+-/
++/ */
++
+     .text
+     .globl _PR_x86_64_AtomicIncrement
+     .align 4
+@@ -51,11 +52,11 @@
+     incl %eax
+     ret
+ 
+-/ PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val)
++/* PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val)
+ /
+ / Atomically decrement the integer pointed to by 'val' and return
+ / the result of the decrement.
+-/
++/ */
+     .text
+     .globl _PR_x86_64_AtomicDecrement
+     .align 4
+@@ -66,11 +67,11 @@
+     decl %eax
+     ret
+ 
+-/ PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval)
++/* PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval)
+ /
+ / Atomically set the integer pointed to by 'val' to the new
+ / value 'newval' and return the old value.
+-/
++/ */
+     .text
+     .globl _PR_x86_64_AtomicSet
+     .align 4
+@@ -79,11 +80,11 @@
+     xchgl %eax, (%rdi)
+     ret
+ 
+-/ PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
++/* PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
+ /
+ / Atomically add 'val' to the integer pointed to by 'ptr'
+ / and return the result of the addition.
+-/
++/ */
+     .text
+     .globl _PR_x86_64_AtomicAdd
+     .align 4
+@@ -94,5 +95,5 @@
+     addl %esi, %eax
+     ret
+ 
+-/ Magic indicating no need for an executable stack
++/* Magic indicating no need for an executable stack */
+ .section .note.GNU-stack, "", @progbits ; .previous
commit 69415c1c8396db0c9ecbd5e5794485b16bcbad5b
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Mar 28 14:35:11 2013 +0000

    fix an inline asm input-output bitwidth mismatch
    
    Clang rightfully rejects it, so we have to use the cast.
    Upstream has a similar fix for its OpenSSL-fips-2_0* tags.

diff --git a/openssl/makefile.mk b/openssl/makefile.mk
index 9981914..ed19ac9 100644
--- a/openssl/makefile.mk
+++ b/openssl/makefile.mk
@@ -159,6 +159,8 @@ OUT2BIN += out/libeay32.dll
     .ENDIF
 .ENDIF
 
+PATCH_FILES += openssl-0.9.8o-clang.patch
+
 #set INCLUDE=D:\sol_temp\n\msvc7net3\PlatformSDK\include;D:\sol_temp\n\msvc7net3\include\ && set path=%path%;D:\sol_temp\r\btw\SRC680\perl\bin &&
 
 # --- Targets ------------------------------------------------------
diff --git a/openssl/openssl-0.9.8o-clang.patch b/openssl/openssl-0.9.8o-clang.patch
new file mode 100644
index 0000000..8c0b21a
--- /dev/null
+++ b/openssl/openssl-0.9.8o-clang.patch
@@ -0,0 +1,11 @@
+--- misc/openssl-0.9.8o/crypto/md32_common.h	2010-03-29 13:23:11.000000000 +0200
++++ misc/build/openssl-0.9.8o/crypto/md32_common.h	2013-03-28 15:47:56.541077176 +0100
+@@ -165,7 +165,7 @@
+ 				asm (			\
+ 				"roll %1,%0"		\
+ 				: "=r"(ret)		\
+-				: "I"(n), "0"(a)	\
++				: "I"(n), "0"((unsigned int)(a)) \
+ 				: "cc");		\
+ 			   ret;				\
+ 			})


More information about the Libreoffice-commits mailing list