Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
	 Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	 Andrzej Hajda <andrzej.hajda@intel.com>
Subject: [PATCH] lib/meson.build: allow build IGT with link time optimization
Date: Mon, 16 Dec 2024 15:38:38 +0100	[thread overview]
Message-ID: <20241216-fix-lto-v1-1-1280b17dc70f@intel.com> (raw)

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.

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.
---
 lib/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/meson.build b/lib/meson.build
index beaf43dffc5b..5a2fd9bf310c 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -239,7 +239,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: 48a70f6795e6d68b9fae275261ae3b09d3401fe1
change-id: 20241216-fix-lto-8d3bc1488c6a

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


             reply	other threads:[~2024-12-16 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 14:38 Andrzej Hajda [this message]
2024-12-16 21:08 ` ✓ i915.CI.BAT: success for lib/meson.build: allow build IGT with link time optimization Patchwork
2024-12-16 22:59 ` ✗ Xe.CI.BAT: failure " Patchwork
2024-12-17 12:09   ` â " Hajda, Andrzej
2024-12-17  2:01 ` ✗ Xe.CI.Full: " Patchwork
2024-12-17  5:14 ` ✗ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241216-fix-lto-v1-1-1280b17dc70f@intel.com \
    --to=andrzej.hajda@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox