Mesa (staging/20.1): prevent multiply defined symbols

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 29 11:33:14 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 41e7c47e6838242ccaf6ade50e09c3b7a6ef860f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=41e7c47e6838242ccaf6ade50e09c3b7a6ef860f

Author: Daryl W. Grunau <dwg at lanl.gov>
Date:   Thu Jul 23 15:39:07 2020 -0600

prevent multiply defined symbols

Without this patch applied gcc at 10.1.0 fails to compile with the following
error (note mesa at 18.3.6 but the latest release also posseses this problem):

  ld: ../../../../src/gallium/auxiliary/.libs/libgallium.a(u_debug_symbol.o):/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/galli um/auxiliary/util/u_debug_symbol.c:273: multiple definition of `symbols_hash'; ../../../../src/gallium/auxiliary/.libs/libgallium.a(u_debug_stack.o):/tmp/spa ck/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/gallium/auxiliary/util/u_debug_stack.c:49: first defined here
  collect2: error: ld returned 1 exit status
  make[4]: *** [libGL.la] Error 1
  make[4]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/gallium/targets/libgl-xlib'
  make[3]: *** [all-recursive] Error 1
  make[3]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/gallium'
  make[2]: *** [all-recursive] Error 1
  make[2]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src'
  make: *** [all-recursive] Error 1

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3298
Cc: mesa-stable
Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6053>
(cherry picked from commit a400c2ff2265dfabb1ed7b59c8b24aa38d0557d1)

---

 .pick_status.json                           | 2 +-
 src/gallium/auxiliary/util/u_debug_stack.c  | 2 +-
 src/gallium/auxiliary/util/u_debug_symbol.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 4bf75d74d5c..c698a250759 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -58,7 +58,7 @@
         "description": "prevent multiply defined symbols",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/auxiliary/util/u_debug_stack.c b/src/gallium/auxiliary/util/u_debug_stack.c
index 44581e0a3fb..ca4d2b313b4 100644
--- a/src/gallium/auxiliary/util/u_debug_stack.c
+++ b/src/gallium/auxiliary/util/u_debug_stack.c
@@ -46,7 +46,7 @@
 #include "os/os_thread.h"
 #include "u_hash_table.h"
 
-struct hash_table* symbols_hash;
+static struct hash_table* symbols_hash;
 static mtx_t symbols_mutex = _MTX_INITIALIZER_NP;
 
 /* TODO with some refactoring we might be able to re-use debug_symbol_name_cached()
diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c
index 334803d008e..aa5916e89ad 100644
--- a/src/gallium/auxiliary/util/u_debug_symbol.c
+++ b/src/gallium/auxiliary/util/u_debug_symbol.c
@@ -270,7 +270,7 @@ debug_symbol_print(const void *addr)
    debug_printf("\t%s\n", buf);
 }
 
-struct hash_table* symbols_hash;
+static struct hash_table* symbols_hash;
 static mtx_t symbols_mutex = _MTX_INITIALIZER_NP;
 
 const char*



More information about the mesa-commit mailing list