X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=meson.build;h=5d7b31123044c0e203297d2337b72892edcda582;hb=1c6eca23fdd8bc112c70914100601d0e382a8154;hp=faa267978bf248ef16ec66c1106ea9ed44eb15f3;hpb=e00adef34a5ce485e2c9216a268ca05e89a5fc98;p=mesa.git diff --git a/meson.build b/meson.build index faa267978bf..5d7b3112304 100644 --- a/meson.build +++ b/meson.build @@ -1355,7 +1355,7 @@ dep_libdrm_intel = null_dep _drm_amdgpu_ver = '2.4.100' _drm_radeon_ver = '2.4.71' -_drm_nouveau_ver = '2.4.66' +_drm_nouveau_ver = '2.4.102' _drm_intel_ver = '2.4.75' _drm_ver = '2.4.81' @@ -1757,6 +1757,19 @@ else dep_lmsensors = null_dep endif +# If the compiler supports it, put function and data symbols in their +# own sections and GC the sections after linking. This lets drivers +# drop shared code unused by that specific driver (particularly +# relevant for Vulkan drivers). +if cc.has_link_argument('-Wl,--gc-sections') + add_project_arguments('-Wl,--gc-sections', language : ['c', 'cpp']) + foreach a: ['-ffunction-sections', '-fdata-sections'] + if cc.has_argument(a) + add_project_arguments(a, language : ['c', 'cpp']) + endif + endforeach +endif + foreach a : pre_args add_project_arguments(a, language : ['c', 'cpp']) endforeach