Re: [Jack-Devel] [Fwd: Re: [Guitarix-developer] jack session crash]
Am Freitag, den 04.11.2011, 18:35 -0400 schrieb Paul Davis:
> in reality, there is no support on Linux for what is described in the
> JACK header files. it just so happens that building with -fPIC happens
> to work, but more as a side-effect than anything intentional. __weak__
> is designed as way to refer to symbols used by one library but
> obtained from another, not symbols used by an executable and obtained
> from a library. __weak_import__ on gcc-osx does what we actually want.
>
> this is very confusing situation that will take some time to sort out.
> -fPIC is a potential solution, and apparently has some potential
> benefits because it allows the run time linker more freedom to
> optimize memory layout. but i don't think that it should be *the*
> solution.
A workaround for the situation, witch suite our needs much better was
mention in the first post of this thread.
andreas wrote :
> To solve the problem for guitarix, I had to make some ugly
> constructions:
>
> - the functions must never be used directly (or you will get
> a PLT entry so that dlsym() will only reflect the state
> while
> building the executable)
>
> - define typedefs for the function pointers that must be kept
> in sync with the definitions of the functions in the jack
> header
>
> - define global variables that are initialized with the
> function
> addresses via dlsym().
>
> Example:
>
> typedef char *(*jack_client_get_uuid_type)(jack_client_t *);
>
> jack_client_get_uuid_type jack_client_get_uuid_fp =
> reinterpret_cast<jack_client_get_uuid_type>(
> dlsym(RTLD_DEFAULT, "jack_client_get_uuid"));
>
but I really don't understand why we didn't just add the functionality
to the lib. (like Stéphane has done it for jack2)
greets
hermann
1320470430.23460_0.ltw:2,a <1320470384.2219.21.camel at box>