Bug 1401230 - Apply compiler-rt patch to avoid crashes on shutdown when unloading shared libraries. r=glandium
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Wed, 20 Sep 2017 22:52:15 +0200
changeset 383826 3e2e2396769027d52fba619101b82a561e90c356
parent 383825 843b90c486643459c1dd90d0f074c7d8f1c97286
child 383827 57f68296c350469d73d788eb3695a898947b4acb
child 383844 03d936e8aec24281b8f85ea733d91098939351ef
push id32602
push userkwierso@gmail.com
push dateFri, 29 Sep 2017 21:47:40 +0000
treeherdermozilla-central@57f68296c350 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1401230
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1401230 - Apply compiler-rt patch to avoid crashes on shutdown when unloading shared libraries. r=glandium
build/build-clang/clang-4-linux64.json
build/build-clang/hide-gcda-profiling-symbols.patch
taskcluster/ci/build/linux.yml
--- a/build/build-clang/clang-4-linux64.json
+++ b/build/build-clang/clang-4-linux64.json
@@ -10,11 +10,12 @@
     "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_401/final",
     "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_401/final",
     "python_path": "/usr/bin/python2.7",
     "gcc_dir": "/builds/worker/workspace/build/src/gcc",
     "cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
     "cxx": "/builds/worker/workspace/build/src/gcc/bin/g++",
     "as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
     "patches": [
-      "llvm-debug-frame.patch"
+      "llvm-debug-frame.patch",
+      "hide-gcda-profiling-symbols.patch"
     ]
 }
new file mode 100644
--- /dev/null
+++ b/build/build-clang/hide-gcda-profiling-symbols.patch
@@ -0,0 +1,108 @@
+diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c
+index 138af6ec4..f0c05075a 100644
+--- a/compiler-rt/lib/profile/GCDAProfiling.c
++++ b/compiler-rt/lib/profile/GCDAProfiling.c
+@@ -231,6 +231,7 @@ static void unmap_file() {
+  * profiling enabled will emit to a different file. Only one file may be
+  * started at a time.
+  */
++COMPILER_RT_VISIBILITY
+ void llvm_gcda_start_file(const char *orig_filename, const char version[4],
+                           uint32_t checksum) {
+   const char *mode = "r+b";
+@@ -298,6 +299,7 @@ void llvm_gcda_start_file(const char *orig_filename, const char version[4],
+ /* Given an array of pointers to counters (counters), increment the n-th one,
+  * where we're also given a pointer to n (predecessor).
+  */
++COMPILER_RT_VISIBILITY
+ void llvm_gcda_increment_indirect_counter(uint32_t *predecessor,
+                                           uint64_t **counters) {
+   uint64_t *counter;
+@@ -320,6 +322,7 @@ void llvm_gcda_increment_indirect_counter(uint32_t *predecessor,
+ #endif
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_gcda_emit_function(uint32_t ident, const char *function_name,
+                              uint32_t func_checksum, uint8_t use_extra_checksum,
+                              uint32_t cfg_checksum) {
+@@ -346,6 +349,7 @@ void llvm_gcda_emit_function(uint32_t ident, const char *function_name,
+     write_string(function_name);
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) {
+   uint32_t i;
+   uint64_t *old_ctrs = NULL;
+@@ -397,6 +401,7 @@ void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) {
+ #endif
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_gcda_summary_info() {
+   const uint32_t obj_summary_len = 9; /* Length for gcov compatibility. */
+   uint32_t i;
+@@ -450,6 +455,7 @@ void llvm_gcda_summary_info() {
+ #endif
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_gcda_end_file() {
+   /* Write out EOF record. */
+   if (output_file) {
+@@ -474,6 +480,7 @@ void llvm_gcda_end_file() {
+ #endif
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_register_writeout_function(writeout_fn fn) {
+   struct writeout_fn_node *new_node = malloc(sizeof(struct writeout_fn_node));
+   new_node->fn = fn;
+@@ -487,6 +494,7 @@ void llvm_register_writeout_function(writeout_fn fn) {
+   }
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_writeout_files(void) {
+   struct writeout_fn_node *curr = writeout_fn_head;
+ 
+@@ -496,6 +504,7 @@ void llvm_writeout_files(void) {
+   }
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_delete_writeout_function_list(void) {
+   while (writeout_fn_head) {
+     struct writeout_fn_node *node = writeout_fn_head;
+@@ -506,6 +515,7 @@ void llvm_delete_writeout_function_list(void) {
+   writeout_fn_head = writeout_fn_tail = NULL;
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_register_flush_function(flush_fn fn) {
+   struct flush_fn_node *new_node = malloc(sizeof(struct flush_fn_node));
+   new_node->fn = fn;
+@@ -519,6 +529,7 @@ void llvm_register_flush_function(flush_fn fn) {
+   }
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void __gcov_flush() {
+   struct flush_fn_node *curr = flush_fn_head;
+ 
+@@ -528,6 +539,7 @@ void __gcov_flush() {
+   }
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_delete_flush_function_list(void) {
+   while (flush_fn_head) {
+     struct flush_fn_node *node = flush_fn_head;
+@@ -538,6 +550,7 @@ void llvm_delete_flush_function_list(void) {
+   flush_fn_head = flush_fn_tail = NULL;
+ }
+ 
++COMPILER_RT_VISIBILITY
+ void llvm_gcov_init(writeout_fn wfn, flush_fn ffn) {
+   static int atexit_ran = 0;
+ 
--- a/taskcluster/ci/build/linux.yml
+++ b/taskcluster/ci/build/linux.yml
@@ -616,17 +616,17 @@ linux64-ccov/opt:
             - builds/releng_base_linux_64_builds.py
             - balrog/production.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: code-coverage
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
-        - linux64-clang
+        - linux64-clang-4
         - linux64-rust
         - linux64-gcc
 
 linux64-add-on-devel/opt:
     description: "Linux64 add-on-devel"
     index:
         product: firefox
         job-name: linux64-add-on-devel