ci: Enable LTO for fedora-release job
authorMichel Dänzer <mdaenzer@redhat.com>
Fri, 10 Feb 2023 15:22:38 +0000 (16:22 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Mar 2023 16:08:34 +0000 (16:08 +0000)
Requires -Wno-error=... to be passed to the linking stage.

NOTE: This does not imply that it's safe to enable LTO for Fedora
package builds yet. It just helps prevent moving further away from that
long term goal.

v2:
* Keep passing -Wno-error=array-bounds & -Wno-error=stringop-overread.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>

.gitlab-ci/build/gitlab-ci.yml

index 2b107d1..5f83cfd 100644 (file)
@@ -282,8 +282,13 @@ fedora-release:
     - .use-fedora/x86_build
   variables:
     BUILDTYPE: "release"
-    C_ARGS: >
+    C_LINK_ARGS: >
+      -Wno-error=array-bounds
+      -Wno-error=stringop-overflow
+      -Wno-error=stringop-overread
+    CPP_LINK_ARGS: >
       -Wno-error=array-bounds
+      -Wno-error=stringop-overflow
       -Wno-error=stringop-overread
     DRI_LOADERS: >
       -D glx=dri
@@ -292,6 +297,8 @@ fedora-release:
       -D glvnd=true
       -D platforms=x11,wayland
     EXTRA_OPTION: >
+      --native-file .gitlab-ci/build/meson-native-lto-wrappers.txt
+      -D b_lto=true
       -D osmesa=true
       -D selinux=true
       -D tools=drm-shim,etnaviv,freedreno,glsl,intel,nir,nouveau,lima,panfrost,imagination
@@ -318,7 +325,7 @@ fedora-release:
     UNWIND: "disabled"
     VULKAN_DRIVERS: "amd,broadcom,freedreno,imagination-experimental,intel,intel_hasvk"
   script:
-    - .gitlab-ci/meson/build.sh
+    - PATH=$PATH:$PWD/.gitlab-ci/build .gitlab-ci/meson/build.sh
 
 debian-android:
   extends: