Hi!

The merge.sh script seems to remove lines 2 and 3 regardless of what they
contain.  If they contain the The LLVM Compiler Infrastructure
comment, we do want that, but a couple of files (mostly *.S) don't contain
that.

The following patch ought to fix that.
Bootstrapped/regtested on x86_64-linux, i686-linux and s390x-linux, 
bootstrap/regtest
pending on powerpc64{,le}-linux and aarch64-linux, ok for trunk if that
succeeds?

2017-01-23  Jakub Jelinek  <ja...@redhat.com>

        PR sanitizer/79168
        * merge.sh (change_comment_headers): Don't remove 2nd and 3rd line
        if the 3rd line doesn't contain 'The LLVM Compiler Infrastructure'
        text.
        * sanitizer_common/sanitizer_linux_mips64.S: Regenerated.
        * sanitizer_common/sanitizer_linux_x86_64.S: Likewise.
        * tsan/tsan_ppc_regs.h: Likewise.
        * tsan/tsan_rtl_aarch64.S: Likewise.
        * tsan/tsan_rtl_mips64.S: Likewise.
        * tsan/tsan_rtl_ppc64.S: Likewise.

--- libsanitizer/merge.sh.jj    2016-11-09 15:22:50.000000000 +0100
+++ libsanitizer/merge.sh       2017-01-23 12:42:40.540304087 +0100
@@ -22,6 +22,7 @@ list_files() {
 
 change_comment_headers() {
   for f in $(list_files $1); do
+    sed -n 3p $1/$f | grep -q 'The LLVM Compiler Infrastructure' || continue
     changed=$(awk 'NR != 2 && NR != 3' < $1/$f)
     echo "$changed" > $1/$f
   done
--- libsanitizer/sanitizer_common/sanitizer_linux_mips64.S.jj   2016-11-09 
15:22:41.933353597 +0100
+++ libsanitizer/sanitizer_common/sanitizer_linux_mips64.S      2017-01-23 
12:51:34.356268220 +0100
@@ -1,4 +1,6 @@
 // This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+
 // Avoid being marked as needing an executable stack:
 #if defined(__linux__) && defined(__ELF__)
 .section .note.GNU-stack,"",%progbits
--- libsanitizer/sanitizer_common/sanitizer_linux_x86_64.S.jj   2016-11-09 
15:22:41.958353280 +0100
+++ libsanitizer/sanitizer_common/sanitizer_linux_x86_64.S      2017-01-23 
12:51:34.356268220 +0100
@@ -1,4 +1,6 @@
 // This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+
 // Avoid being marked as needing an executable stack:
 #if defined(__linux__) && defined(__ELF__)
 .section .note.GNU-stack,"",%progbits
--- libsanitizer/tsan/tsan_ppc_regs.h.jj        2016-11-09 15:22:49.044263524 
+0100
+++ libsanitizer/tsan/tsan_ppc_regs.h   2017-01-23 12:51:34.357268207 +0100
@@ -1,4 +1,6 @@
 #define r0 0
+#define r1 1
+#define r2 2
 #define r3 3
 #define r4 4
 #define r5 5
--- libsanitizer/tsan/tsan_rtl_aarch64.S.jj     2016-11-09 15:22:49.015263892 
+0100
+++ libsanitizer/tsan/tsan_rtl_aarch64.S        2017-01-23 12:51:34.357268207 
+0100
@@ -1,4 +1,6 @@
 #include "sanitizer_common/sanitizer_asm.h"
+
+.section .bss
 .type  __tsan_pointer_chk_guard, %object
 .size  __tsan_pointer_chk_guard, 8
 __tsan_pointer_chk_guard:
--- libsanitizer/tsan/tsan_interceptors.h.jj    2016-11-09 15:22:49.065263258 
+0100
+++ libsanitizer/tsan/tsan_interceptors.h       2017-01-23 12:51:34.357268207 
+0100
@@ -1,4 +1,6 @@
 #ifndef TSAN_INTERCEPTORS_H
+#define TSAN_INTERCEPTORS_H
+
 #include "sanitizer_common/sanitizer_stacktrace.h"
 #include "tsan_rtl.h"
 
--- libsanitizer/tsan/tsan_rtl_mips64.S.jj      2016-11-09 15:22:49.064263271 
+0100
+++ libsanitizer/tsan/tsan_rtl_mips64.S 2017-01-23 12:51:34.357268207 +0100
@@ -1,4 +1,6 @@
 .section .text
+.set noreorder
+
 .hidden __tsan_setjmp
 .comm _ZN14__interception11real_setjmpE,8,8
 .globl setjmp
--- libsanitizer/tsan/tsan_rtl_ppc64.S.jj       2016-11-09 15:22:49.028263727 
+0100
+++ libsanitizer/tsan/tsan_rtl_ppc64.S  2017-01-23 12:51:34.358268194 +0100
@@ -1,4 +1,6 @@
 #include "tsan_ppc_regs.h"
+
+        .section .text
         .hidden __tsan_setjmp
         .globl _setjmp
         .type _setjmp, @function

        Jakub

Reply via email to