From aca82fdad57f36ef0c567d8aeabaa780a7170865 Mon Sep 17 00:00:00 2001 From: Michael Saunders Date: Wed, 17 Jul 2024 15:38:58 -0700 Subject: [PATCH] Hide zstd library symbols The ktx library required libzstd symbols for interal work but was not hiding them. This caused symbol conflicts with the dynamic loader if other shared libraries loaded the system's libzstd.so.1 library. --- src/ktx/libktx/{zstd.h => ktx_zstd.h} | 2 +- src/ktx/libktx/{zstd_errors.h => ktx_zstd_errors.h} | 2 +- src/ktx/libktx/texture2.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/ktx/libktx/{zstd.h => ktx_zstd.h} (99%) rename src/ktx/libktx/{zstd_errors.h => ktx_zstd_errors.h} (99%) diff --git a/src/ktx/libktx/zstd.h b/src/ktx/libktx/ktx_zstd.h similarity index 99% rename from src/ktx/libktx/zstd.h rename to src/ktx/libktx/ktx_zstd.h index 6da84e2..614d037 100644 --- a/src/ktx/libktx/zstd.h +++ b/src/ktx/libktx/ktx_zstd.h @@ -22,7 +22,7 @@ extern "C" { /* ===== ZSTDLIB_API : control library symbols visibility ===== */ #ifndef ZSTDLIB_VISIBILITY # if defined(__GNUC__) && (__GNUC__ >= 4) -# define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("default"))) +# define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("hidden"))) # else # define ZSTDLIB_VISIBILITY # endif diff --git a/src/ktx/libktx/zstd_errors.h b/src/ktx/libktx/ktx_zstd_errors.h similarity index 99% rename from src/ktx/libktx/zstd_errors.h rename to src/ktx/libktx/ktx_zstd_errors.h index 2383094..285cb74 100644 --- a/src/ktx/libktx/zstd_errors.h +++ b/src/ktx/libktx/ktx_zstd_errors.h @@ -22,7 +22,7 @@ extern "C" { /* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */ #ifndef ZSTDERRORLIB_VISIBILITY # if defined(__GNUC__) && (__GNUC__ >= 4) -# define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default"))) +# define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("hidden"))) # else # define ZSTDERRORLIB_VISIBILITY # endif diff --git a/src/ktx/libktx/texture2.c b/src/ktx/libktx/texture2.c index f21b3d1..a207710 100644 --- a/src/ktx/libktx/texture2.c +++ b/src/ktx/libktx/texture2.c @@ -22,8 +22,8 @@ #include #include -#include "zstd.h" -#include "zstd_errors.h" +#include "ktx_zstd.h" +#include "ktx_zstd_errors.h" #include #include "dfdutils/dfd.h"