[PATCH 0/2] intel: hide library symbols by default

Eric Engestrom eric.engestrom at intel.com
Thu Sep 13 20:11:18 UTC 2018


On Thursday, 2018-09-13 12:43:53 -0700, Lucas De Marchi wrote:
> On 9/13/18 1:03 AM, Eric Engestrom wrote:
> > On Wednesday, 2018-09-12 14:05:34 -0700, Lucas De Marchi wrote:
> > > Rely on -fvisibility=hidden to hide the symbols. This only applies to
> > > drm_intel.so sice there's no point in extending this if it receives a
> > > nack for some reason. For the same reason, only done on meson as well.
> > > 
> > > drm_private can also be removed from other symbols. If this passes a
> > > smoke test I'll add a patch on v2 doing so.
> > 
> > Series is
> > Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
> > 
> > but yeah, without that 3rd patch to remove drm_private it isn't all that
> > useful :P
> 
> It actually is. It already closes the door for leaking internal symbols. the
> drm_internal becomes a nop to be removed. I will include it in v2.

Ha, you're right, my bad :)
You could land it as it then, and remove drm_private in a follow up patch.

> 
> > 
> > Do you plan on converting the rest of libdrm if/when this gets accepted?
> > It looks like you already got all the scripts ready to go ;)
> 
> I will take a look on including them for v2 already. I just wish I
> remembered how to use coccinelle for source code transformation like this.
> The commands above work ok, but there's some manual work to adapt for things
> like "int\nfoo() { }" vs "int foo() { }".

Thanks!

> 
> Lucas De Marchi
> 
> > 
> > > 
> > >  From git log archeology and mention in another thread we used to pass
> > > -fvisibility=hidden, but reverted to the contrary due to bug in obscure
> > > toolchain some years ago (see 0f8da82500ec542e269092c0718479e25eaff5f6).
> > > I think it's time to revisit that decision: we have plenty of other
> > > projects doing that nowadays without problem.
> > > 
> > > Lucas De Marchi (2):
> > >    intel: annotate public functions
> > >    meson: intel: make symbols hidden by default
> > > 
> > >   intel/intel_bufmgr.c      | 64 +++++++++++++++++-----------------
> > >   intel/intel_bufmgr_fake.c | 10 +++---
> > >   intel/intel_bufmgr_gem.c  | 73 +++++++++++++++++++--------------------
> > >   intel/intel_decode.c      | 14 ++++----
> > >   intel/meson.build         |  4 ++-
> > >   libdrm_macros.h           |  2 ++
> > >   6 files changed, 85 insertions(+), 82 deletions(-)
> > > 
> > > -- 
> > > 2.17.1
> > > 


More information about the dri-devel mailing list