Am Samstag, 26. September 2015, 04:47:19 schrieb Sedat Dilek: > On Sat, Sep 26, 2015 at 1:59 AM, Sedat Dilek <sedat.di...@gmail.com> wrote: > > Hi, > > > > unfortunately, we still have no cool upstream fix for > > -fvisibility=hidden compiler flag handling. > > There is still no visibility-attribute "hidden" available or defined. > > > > I see people again fell over this issue [2]. > > > > I have one concern... > > > > GCC uses "default" visibility-attribute (defined as PUBLIC) when > > compiler-flag "-fvisibility=hidden" is used. > > But CLANG needs in some cases "hidden" visibility-attribute. > > > > [ src/util/macros.h ] > > > > /** > > > > * PUBLIC/USED macros > > * > > * If we build the library with gcc's -fvisibility=hidden flag, we'll > > * use the PUBLIC macro to mark functions that are to be exported. > > * > > * We also need to define a USED attribute, so the optimizer doesn't > > * inline a static function that we later use in an alias. - ajax > > */ > > > > #ifndef PUBLIC > > # if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) > > # define PUBLIC __attribute__((visibility("default"))) > > # define USED __attribute__((used)) > > # elif defined(_MSC_VER) > > # define PUBLIC __declspec(dllexport) > > # define USED > > # else > > # define PUBLIC > > # define USED > > # endif > > #endif > > > > #ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY > > #define HIDDEN __attribute__((visibility("hidden"))) > > #else > > #define HIDDEN > > #endif > > > > [ src/util/macros.h ] > > > > Alan pointed to a solution like in [4] ("Use clang's __has_attribute > > to check for attribute support") > > > > So, what can people do to help to nail this down? > > > > I have attached a refreshed version of Marc's and added the TDS > > snippet from [2] to 0002 patch. > > ( Patches have no changelog and are against mesa v10.6.8. ) > > > > Hope this helps! > > > > Regards, > > - Sedat - > > > > [1] > > https://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg76122.html > > [2] http://patchwork.freedesktop.org/patch/49494/ > > [3] > > https://developer.apple.com/library/mac/documentation/DeveloperTools/Conc > > eptual/CppRuntimeEnv/Articles/SymbolVisibility.html [4] > > http://cgit.freedesktop.org/xorg/proto/x11proto/commit/?id=ffd4a13042d24c > > b5c > So, I played a bit more and the result is a v3 of both patches with > some simplification etc. > > Emil asked in another thread to check with --enable-asm and > --{en|dis}able-shared-glapi, but disabling for the latter was not > suitable for my setup (disabling OpenGL resulted in a conflict with > dri-drivers etc.). > > Brian asked if this works with GCC v4.9 - yes.
As expressed before, using hidden attribute only hides some hack on how to find the head of the dispatch entry table afaict. I just replaced it with shared_dispatch_stub_0() and this works for shared- glapi case, but not without shared-api (the first function is named differently). IMHO, a better fix would be to mark the head of the dispatch table for all cases and use this mark instead of the asm hack. Marc
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev