[Mesa-dev] [PATCH] Fix visibility of u_thread functions

Brian Paul brian.e.paul at gmail.com
Mon Jan 23 17:41:02 PST 2012


On Mon, Jan 23, 2012 at 12:48 PM, Matt Turner <mattst88 at gmail.com> wrote:
> -fvisibility=hidden was preventing them from being exported, which
> combined with shared-glapi was causing undefined symbol errors at
> runtime.
> ---
> Brian: there might be more functions that should be exported. Let
> me know (or let me know what to test to find them) and I'll clean
> them up too.
>
>  src/mapi/mapi/u_thread.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/src/mapi/mapi/u_thread.c b/src/mapi/mapi/u_thread.c
> index 7b52ca9..393ae48 100644
> --- a/src/mapi/mapi/u_thread.c
> +++ b/src/mapi/mapi/u_thread.c
> @@ -62,14 +62,14 @@
>  */
>  #ifdef PTHREADS
>
> -unsigned long
> +PUBLIC unsigned long
>  u_thread_self(void)
>  {
>    return (unsigned long) pthread_self();
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_init(struct u_tsd *tsd)
>  {
>    if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
> @@ -80,7 +80,7 @@ u_tsd_init(struct u_tsd *tsd)
>  }
>
>
> -void *
> +PUBLIC void *
>  u_tsd_get(struct u_tsd *tsd)
>  {
>    if (tsd->initMagic != (int) INIT_MAGIC) {
> @@ -90,7 +90,7 @@ u_tsd_get(struct u_tsd *tsd)
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_set(struct u_tsd *tsd, void *ptr)
>  {
>    if (tsd->initMagic != (int) INIT_MAGIC) {
> @@ -113,14 +113,14 @@ u_tsd_set(struct u_tsd *tsd, void *ptr)
>  */
>  #ifdef WIN32
>
> -unsigned long
> +PUBLIC unsigned long
>  u_thread_self(void)
>  {
>    return GetCurrentThreadId();
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_init(struct u_tsd *tsd)
>  {
>    tsd->key = TlsAlloc();
> @@ -132,7 +132,7 @@ u_tsd_init(struct u_tsd *tsd)
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_destroy(struct u_tsd *tsd)
>  {
>    if (tsd->initMagic != INIT_MAGIC) {
> @@ -143,7 +143,7 @@ u_tsd_destroy(struct u_tsd *tsd)
>  }
>
>
> -void *
> +PUBLIC void *
>  u_tsd_get(struct u_tsd *tsd)
>  {
>    if (tsd->initMagic != INIT_MAGIC) {
> @@ -153,7 +153,7 @@ u_tsd_get(struct u_tsd *tsd)
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_set(struct u_tsd *tsd, void *ptr)
>  {
>    /* the following code assumes that the struct u_tsd has been initialized
> @@ -177,21 +177,21 @@ u_tsd_set(struct u_tsd *tsd, void *ptr)
>  * no-op functions
>  */
>
> -unsigned long
> +PUBLIC unsigned long
>  u_thread_self(void)
>  {
>    return 0;
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_init(struct u_tsd *tsd)
>  {
>    (void) tsd;
>  }
>
>
> -void *
> +PUBLIC void *
>  u_tsd_get(struct u_tsd *tsd)
>  {
>    (void) tsd;
> @@ -199,7 +199,7 @@ u_tsd_get(struct u_tsd *tsd)
>  }
>
>
> -void
> +PUBLIC void
>  u_tsd_set(struct u_tsd *tsd, void *ptr)
>  {
>    (void) tsd;
> --
> 1.7.3.4
>

This looks good, and it's fine if you commit it, but I've still got
build problems:

./configure --enable-xlib-glx --disable-dri --enable-debug
[...]
make
[...]
ar: creating libglapi.a
linker.cpp: In function ‘gl_shader* link_intrastage_shaders(void*,
gl_context*, gl_shader_program*, gl_shader**, unsigned int)’:
linker.cpp:1008: warning: ‘link_intrastage_shaders(void*, gl_context*,
gl_shader_program*, gl_shader**, unsigned int)::array_sizing_visitor’
declared with greater visibility than the type of its field
‘link_intrastage_shaders(void*, gl_context*, gl_shader_program*,
gl_shader**, unsigned int)::array_sizing_visitor::<anonymous>’
linker.cpp:1008: warning: ‘link_intrastage_shaders(void*, gl_context*,
gl_shader_program*, gl_shader**, unsigned int)::array_sizing_visitor’
declared with greater visibility than its base
‘ir_hierarchical_visitor’
ar: creating libglsl.a
ar: creating libmesa.a
ar: creating libmesagallium.a
/usr/bin/ld: cannot find -lglapi
collect2: ld returned 1 exit status
mv: cannot stat `libGL.so.1.5.08000': No such file or directory
ar: creating libegl_glx.a
ar: creating libgallium.a
ar: creating libgalahad.a
ar: creating libidentity.a
ar: creating libllvmpipe.a
ar: creating libnoop.a
ar: creating libr300.a
r600_asm.c: In function ‘is_alu_trans_unit_inst’:
r600_asm.c:505: warning: control reaches end of non-void function
r600_asm.c: In function ‘is_alu_vec_unit_inst’:
r600_asm.c:488: warning: control reaches end of non-void function
r600_pipe.c: In function ‘r600_get_shader_param’:
r600_pipe.c:459: warning: unused variable ‘rscreen’
ar: creating libr600.a
ar: creating librbug.a
sp_state_derived.c: In function ‘softpipe_get_vertex_info’:
sp_state_derived.c:91: warning: ‘interp’ may be used uninitialized in
this function
ar: creating libsoftpipe.a
ar: creating libsvga.a
ar: creating libtrace.a
ar: creating libxlib.a
ar: creating libws_null.a
ar: creating libwsw.a
ar: creating libws_xlib.a
Makefile:115: depend: No such file or directory
/usr/bin/ld: cannot find -lglapi
collect2: ld returned 1 exit status
mv: cannot stat `libGL.so.1.5.08000': No such file or directory

-Brian


More information about the mesa-dev mailing list