File: qboot-Disable-LTO-for-ELF-binary-build-step.patch

package info (click to toggle)
qemu 1%3A10.1.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 416,048 kB
  • sloc: ansic: 4,763,284; pascal: 115,134; python: 105,712; asm: 68,689; sh: 53,146; makefile: 27,519; perl: 18,864; cpp: 11,442; xml: 3,629; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (44 lines) | stat: -rw-r--r-- 1,456 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From e5fe12ebb41f4e24340c8c543231095482b6a9d8 Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Date: Wed, 6 Jul 2022 10:10:55 +0200
Subject: [PATCH] qboot: Disable LTO for ELF binary build step

If LTO is enabled by default qboot fails to link as it exposes
a few issues that break the build:

  ../code16.c: Assembler messages:
  ../code16.c:37: Error: redundant addr32 prefix
  ../code16.c:27: Error: redundant addr32 prefix
  ../code16.c:18: Error: redundant addr32 prefix

Until fixed suppress this behavior by adding -fno-lto to the end
of the linker flags.

Fixes: #31

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>

Forwarded: yes
Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Origin: https://gitlab.com/bonzini/qboot/-/merge_requests/32
Bug: https://gitlab.com/bonzini/qboot/-/issues/31
Last-Update: 2022-07-06
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/roms/qboot/meson.build b/roms/qboot/meson.build
index d060f75..a9792e8 100644
--- a/roms/qboot/meson.build
+++ b/roms/qboot/meson.build
@@ -19,6 +19,7 @@ link_args = ['-nostdlib', '-m32']
 link_args += cc.get_supported_link_arguments('-Wl,--build-id=none')
 link_args += '-Wl,-T' + meson.current_source_dir() / 'flat.lds'
 link_args += cc.get_supported_link_arguments(['-no-pie'])
+link_args += cc.get_supported_link_arguments(['-fno-lto'])
 
 elf = executable(
   'bios.bin.elf',
-- 
2.37.0