rusticl: specify which symbols to export
authorKarol Herbst <git@karolherbst.de>
Wed, 21 Jun 2023 19:34:43 +0000 (21:34 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 22 Jun 2023 11:51:21 +0000 (11:51 +0000)
Drops release binary size from 31MB to 29MB

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23778>

src/gallium/targets/rusticl/meson.build
src/gallium/targets/rusticl/rusticl.sym [new file with mode: 0644]

index 4a0149f..36ae0fe 100644 (file)
 
 opencl_version = '1'
 
+rusticl_ld_args = []
+rusticl_ld_depends = []
+
+if with_ld_version_script
+  rusticl_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'rusticl.sym')]
+  rusticl_ld_depends += files('rusticl.sym')
+endif
+
 librusticl = shared_library(
   'RusticlOpenCL',
   'target.c',
@@ -54,7 +62,9 @@ librusticl = shared_library(
   link_args : [
     ld_args_build_id,
     ld_args_gc_sections,
+    rusticl_ld_args,
   ],
+  link_depends : rusticl_ld_depends,
   version : '@0@.0.0'.format(opencl_version),
   install : true,
 )
diff --git a/src/gallium/targets/rusticl/rusticl.sym b/src/gallium/targets/rusticl/rusticl.sym
new file mode 100644 (file)
index 0000000..b582398
--- /dev/null
@@ -0,0 +1,8 @@
+{
+       global:
+               clGetPlatformInfo;
+               clGetExtensionFunctionAddress;
+               clIcdGetPlatformIDsKHR;
+       local:
+               *;
+};