[Mesa-dev] [PATCH 30/37] dri: use correct shebang for gen-symbol-redefs.py

Andreas Boll andreas.boll.dev at gmail.com
Fri Feb 24 12:52:02 UTC 2017


2017-02-23 18:13 GMT+01:00 Emil Velikov <emil.l.velikov at gmail.com>:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> This is a python2 script and the generic "python" may point to python3.
>
> Cc: Andreas Boll <andreas.boll.dev at gmail.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> We really want to prune/rename all the conflicting entrypoints.
>
> In the radeon/r200 case we could even:
>  - fold the common code to a simple place
>  - drop the symlinks
>  - get smaller binary size and 'compatibilty' with SVN
>  - purge the script
>  - ...
>  - profit
>
> Andreas, any interest in tackling this ? It will drop a couple of
> extend-diff-ignore cases in the Debian packaging :-P

Ok, no promises but I can look into this if no one beats me to it.

I could start with renaming the conflicting symbols in i915.
Which prefix do you prefer? Currently they're prefixed with old_.

@Eric:
What's your opinion on this topic after more than 3 years?

To refresh your memory here's the corresponding commit message:

commit 6665b71b22c265a318ff76178cc27732512791a8
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Sep 27 14:22:59 2013 -0700

    i915: Build the driver into the shared mesa_dri_drivers.so.

    i915 has symbols for formerly-shared code that conflict with i965, so we
    define them away using gen-symbol-redefs.py.  Options considered:

    - This option.  Downsides: The symbols in profiling and debugging don't
      match the source.  The symbol list may change in the future and we won't
      notice without manually running the tool again.

    - Use objcopy --localize-hidden to automatically demote our symbols to
      locals.  This didn't work on i965 due to c++ weak symbols (which can't
      be localized), but could work on i915.  We could do it on i915 only, but
      it does produce libtool warnings at link time due to libtool not knowing
      if the resulting .o file is safe to link (stupid libtool).  Plus you end
      up with different symbols of the same name, which is confusing for
      debugging too.  On the other hand, no future symbol conflicts long term.

    - Write our own libelf tool that handles c++ weak symbols like we want and
      apply it to all drivers.  All the downsides of above, but applies
      uniformly across drivers.

    - Edit the files to just rename all the i915 or i965 symbols that
      conflict.  There are on the order of 100 that have a prefix we used to
      share, so it would take a bit of typing.  Fewest downsides, but still
      can have conflicts long term.

    Ultimately, this is the least invasive change at the moment, and we can
    see if the "more symbol conflicts appear later" thing is a real concern or
    not.


Thanks,
Andreas


More information about the mesa-dev mailing list