-fvisibility flags in VisualGDB

Sysprogs forums Forums VisualGDB -fvisibility flags in VisualGDB

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7361
    RussellKramer
    Participant

    I need to create a shared library .so and keep everything except a selected list of functions hidden. I think I should be able to make everything hidden by default by adding  -fvisibility=hidden  -fvisibility-inlines-hidden to my CFLAGS in the Makefile Settings, then putting __attribute__((visibility(“default”))) in front of the functions I want to be visible.  Adding the visibility arguments to the CFlags has no effect on the results I get from running nm on the .so I compile. Everything stays at default visibility.

     

    I’ve also tried manually adding __attribute__((visibility(“hidden”))) to every function I don’t want included in the .so but this doesn’t have any effect either.

    • This topic was modified 8 years, 5 months ago by RussellKramer.
    #7368
    support
    Keymaster

    Please try adding the -fvisibility options to COMMONFLAGS, not CFLAGS.

    #7369
    RussellKramer
    Participant

    That got it to hide the unwanted functions coming from my own code, but running nm on my shared library is still listing memcpy, memmove, and other stdlib functions. Is there any way to hide these as well?

    #7371
    support
    Keymaster
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.