[Mesa-dev] [PATCH 06/16] targets/dri: use a single version script to restict exported symbols

Emil Velikov emil.l.velikov at gmail.com
Sat Apr 5 02:44:51 PDT 2014


On 05/04/14 10:33, Christian König wrote:
> Am 05.04.2014 11:16, schrieb Maarten Lankhorst:
>> op 05-04-14 03:46, Emil Velikov schreef:
>>> Rather than having multiple (almost) identical version scripts use
>>> a single one.
>>>
>>> Cc: Maarten Lankhorst <maarten.lankhorst at canonical.com>
>>> Cc: Christian König <christian.koenig at amd.com>
>>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>>> ---
>>>   src/gallium/Automake.inc                         | 6 ++----
>>>   src/gallium/state_trackers/dri/dri.link          | 5 -----
>>>   src/gallium/targets/dri-nouveau/Makefile.am      | 1 -
>>>   src/gallium/targets/dri-nouveau/nouveau_dri.link | 6 ------
>>>   src/gallium/targets/dri.sym                      | 8 ++++++++
>>>   src/gallium/targets/r300/dri/Makefile.am         | 1 -
>>>   src/gallium/targets/r300/dri/radeon.link         | 6 ------
>>>   src/gallium/targets/r600/dri/Makefile.am         | 1 -
>>>   src/gallium/targets/radeonsi/dri/Makefile.am     | 1 -
>>>   9 files changed, 10 insertions(+), 25 deletions(-)
>>>   delete mode 100644 src/gallium/state_trackers/dri/dri.link
>>>   delete mode 100644 src/gallium/targets/dri-nouveau/nouveau_dri.link
>>>   create mode 100644 src/gallium/targets/dri.sym
>>>   delete mode 100644 src/gallium/targets/r300/dri/radeon.link
>>>
>>> diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
>>> index 18f914e..a70ab6c 100644
>>> --- a/src/gallium/Automake.inc
>>> +++ b/src/gallium/Automake.inc
>>> @@ -51,14 +51,12 @@ GALLIUM_VIDEO_CFLAGS = \
>>>       $(VISIBILITY_CFLAGS)
>>>     -DRI_VERSION_SCRIPT ?=
>>> $(top_srcdir)/src/gallium/state_trackers/dri/dri.link
>>> -
>>>   GALLIUM_DRI_LINKER_FLAGS = \
>>>       -shared \
>>>       -module \
>>>       -avoid-version \
>>> -    $(GC_SECTIONS) \
>>> -    -Wl,--version-script=$(DRI_VERSION_SCRIPT)
>>> + -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym \
>>> +    $(GC_SECTIONS)
>>>     GALLIUM_VDPAU_LINKER_FLAGS = \
>>>       -shared \
>>> diff --git a/src/gallium/state_trackers/dri/dri.link
>>> b/src/gallium/state_trackers/dri/dri.link
>>> deleted file mode 100644
>>> index 163902e..0000000
>>> --- a/src/gallium/state_trackers/dri/dri.link
>>> +++ /dev/null
>>> @@ -1,5 +0,0 @@
>>> -VERSION {
>>> -    global:
>>> -        __driDriverExtensions;
>>> -    local: *;
>>> -};
>>> diff --git a/src/gallium/targets/dri-nouveau/Makefile.am
>>> b/src/gallium/targets/dri-nouveau/Makefile.am
>>> index 6c749bc..a479040 100644
>>> --- a/src/gallium/targets/dri-nouveau/Makefile.am
>>> +++ b/src/gallium/targets/dri-nouveau/Makefile.am
>>> @@ -20,7 +20,6 @@
>>>   # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>>   # DEALINGS IN THE SOFTWARE.
>>>   -DRI_VERSION_SCRIPT = $(srcdir)/nouveau_dri.link
>>>   include $(top_srcdir)/src/gallium/Automake.inc
>>>     AM_CFLAGS = \
>>> diff --git a/src/gallium/targets/dri-nouveau/nouveau_dri.link
>>> b/src/gallium/targets/dri-nouveau/nouveau_dri.link
>>> deleted file mode 100644
>>> index 16015aa..0000000
>>> --- a/src/gallium/targets/dri-nouveau/nouveau_dri.link
>>> +++ /dev/null
>>> @@ -1,6 +0,0 @@
>>> -VERSION {
>>> -    global:
>>> -        __driDriverExtensions;
>>> -        nouveau_drm_screen_create;
>>> -    local: *;
>>> -};
>>> diff --git a/src/gallium/targets/dri.sym b/src/gallium/targets/dri.sym
>>> new file mode 100644
>>> index 0000000..c99aa09
>>> --- /dev/null
>>> +++ b/src/gallium/targets/dri.sym
>>> @@ -0,0 +1,8 @@
>>> +{
>>> +    global:
>>> +        __driDriverExtensions;
>>> +        nouveau_drm_screen_create;
>>> +        radeon_drm_winsys_create;
>>> +    local:
>>> +        *;
>>> +};
>>> diff --git a/src/gallium/targets/r300/dri/Makefile.am
>>> b/src/gallium/targets/r300/dri/Makefile.am
>>> index 2650544..c780fd9 100644
>>> --- a/src/gallium/targets/r300/dri/Makefile.am
>>> +++ b/src/gallium/targets/r300/dri/Makefile.am
>>> @@ -20,7 +20,6 @@
>>>   # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>>   # DEALINGS IN THE SOFTWARE.
>>>   -DRI_VERSION_SCRIPT = $(srcdir)/radeon.link
>>>   include $(top_srcdir)/src/gallium/Automake.inc
>>>     AM_CFLAGS = \
>>> diff --git a/src/gallium/targets/r300/dri/radeon.link
>>> b/src/gallium/targets/r300/dri/radeon.link
>>> deleted file mode 100644
>>> index 618058b..0000000
>>> --- a/src/gallium/targets/r300/dri/radeon.link
>>> +++ /dev/null
>>> @@ -1,6 +0,0 @@
>>> -VERSION {
>>> -    global:
>>> -        __driDriverExtensions;
>>> -        radeon_drm_winsys_create;
>>> -    local: *;
>>> -};
>>> diff --git a/src/gallium/targets/r600/dri/Makefile.am
>>> b/src/gallium/targets/r600/dri/Makefile.am
>>> index 697abac..e13275e 100644
>>> --- a/src/gallium/targets/r600/dri/Makefile.am
>>> +++ b/src/gallium/targets/r600/dri/Makefile.am
>>> @@ -20,7 +20,6 @@
>>>   # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>>   # DEALINGS IN THE SOFTWARE.
>>>   -DRI_VERSION_SCRIPT = $(srcdir)/../../r300/dri/radeon.link
>>>   include $(top_srcdir)/src/gallium/Automake.inc
>>>     AM_CFLAGS = \
>>> diff --git a/src/gallium/targets/radeonsi/dri/Makefile.am
>>> b/src/gallium/targets/radeonsi/dri/Makefile.am
>>> index 4f36297..c9910dd 100644
>>> --- a/src/gallium/targets/radeonsi/dri/Makefile.am
>>> +++ b/src/gallium/targets/radeonsi/dri/Makefile.am
>>> @@ -20,7 +20,6 @@
>>>   # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>>   # DEALINGS IN THE SOFTWARE.
>>>   -DRI_VERSION_SCRIPT = $(srcdir)/../../r300/dri/radeon.link
>>>   include $(top_srcdir)/src/gallium/Automake.inc
>>>     AM_CFLAGS = \
>> Nack, they're not identical.
> 
> Yeah, but Emil add all necessary symbols to a single file.
> 
> That should work as well, it's just not spitted up so well between targets.
> 
Precisely.
There is zero change in the overall behaviour(resulting libraries) and it's
virtually impossible for nouveau_dri.so to have a radeon symbol and vice-versa.

Main idea here was
 - keep all the symbol management into a easy to find location
 - (in the long term) change a single line and use the script for
gallium_mesadiver_dri.so

-Emil

> Christian.



More information about the mesa-dev mailing list