Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] lib/meson.build: allow build IGT with link time optimization
@ 2025-01-09 16:26 Andrzej Hajda
  2025-01-09 17:05 ` Kamil Konieczny
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Andrzej Hajda @ 2025-01-09 16:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Janusz Krzysztofik, Kamil Konieczny, Andrzej Hajda

Some distributions use -flto gcc flag to build IGT. With this flag
enabled variables declared with section attribute do not appear in
correct section in .o files. Since iga64 assembly helper script relies
on it we need to use -ffat-lto-objects in case of files containing
iga64 assembly. According to documentation this option is effective
only in case lto is in use, so it should not affect non-lto builds.

Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/165
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
This patch 'fixes' building IGT with link-time-optimization. I am not
sure it is or should be supported by IGT, but build scripts can be
modified to allow it for testing.
Grepping internet shows at least Gentoo and Arch Linux builds IGT with
LTO, so I guess it is working for them.
---
Changes in v2:
 - added Closes tag
- Link to v1: https://lore.kernel.org/r/20241216-fix-lto-v1-1-1280b17dc70f@intel.com
---
 lib/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/meson.build b/lib/meson.build
index 1704ed1e1c17..9fffdd3c6218 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -240,7 +240,7 @@ foreach f: lib_sources
 	    '-DIGT_DATADIR="@0@"'.format(join_paths(prefix, datadir)),
 	    '-DIGT_SRCDIR="@0@"'.format(srcdir),
 	    '-DIGT_LOG_DOMAIN="@0@"'.format(f.split('.')[0]),
-	])
+	] + (iga64_assembly_sources.contains(f) ? [ '-ffat-lto-objects' ] : []))
 
     lib_intermediates += lib
     if iga64_assembly_sources.contains(f)

---
base-commit: ee7a3ac616f55f6ed1b959ff951237099bda86d8
change-id: 20241216-fix-lto-8d3bc1488c6a

Best regards,
-- 
Andrzej Hajda <andrzej.hajda@intel.com>


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-01-14 14:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 16:26 [PATCH v2] lib/meson.build: allow build IGT with link time optimization Andrzej Hajda
2025-01-09 17:05 ` Kamil Konieczny
2025-01-09 17:29 ` Lucas De Marchi
2025-01-10  7:58   ` Hajda, Andrzej
2025-01-10 15:49     ` Lucas De Marchi
2025-01-09 17:31 ` ✓ i915.CI.BAT: success for lib/meson.build: allow build IGT with link time optimization (rev2) Patchwork
2025-01-09 18:00 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-12  2:39 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-14 14:31   ` Kamil Konieczny
2025-01-12 21:32 ` ✗ i915.CI.Full: " Patchwork
2025-01-14 14:32   ` Kamil Konieczny
2025-01-14 14:42 ` [PATCH v2] lib/meson.build: allow build IGT with link time optimization Kamil Konieczny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox