All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix GRUB i386-pc build with Ubuntu gcc
@ 2020-03-24 13:29 Simon Hardy
  2020-03-25 17:28 ` Daniel Kiper
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Hardy @ 2020-03-24 13:29 UTC (permalink / raw)
  To: grub-devel

With recent versions of gcc on Ubuntu a very large lzma_decompress.img file is
output. (e.g. 134479600 bytes instead of 2864.) This causes grub-mkimage to
fail with: "error: Decompressor is too big."

This seems to be caused by a section .note.gnu.property that is placed at an
offset such that objcopy needs to pad the img file with zeros.

This issue is present on:
Ubuntu 19.10 with gcc (Ubuntu 8.3.0-26ubuntu1~19.10) 8.3.0
Ubuntu 19.10 with gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

This issue is not present on:
Ubuntu 19.10 with gcc (Ubuntu 7.5.0-3ubuntu1~19.10) 7.5.0
RHEL 8.0 with gcc 8.3.1 20190507 (Red Hat 8.3.1-4)

The issue can be fixed by removing the section using objcopy as shown in this
patch:

Signed-off-by: Simon Hardy <simon.hardy@itdev.co.uk>
---
 gentpl.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gentpl.py b/gentpl.py
index 387588c05..c86550d4f 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -766,7 +766,7 @@ def image(defn, platform):
 if test x$(TARGET_APPLE_LINKER) = x1; then \
   $(MACHO2IMG) $< $@; \
 else \
-  $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .ARM.exidx $< $@; \
+  $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .note.gnu.property -R .ARM.exidx $< $@; \
 fi
 """)
 
-- 
2.25.0



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

* Re: [PATCH] Fix GRUB i386-pc build with Ubuntu gcc
  2020-03-24 13:29 [PATCH] Fix GRUB i386-pc build with Ubuntu gcc Simon Hardy
@ 2020-03-25 17:28 ` Daniel Kiper
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Kiper @ 2020-03-25 17:28 UTC (permalink / raw)
  To: Simon Hardy; +Cc: grub-devel

On Tue, Mar 24, 2020 at 01:29:12PM +0000, Simon Hardy wrote:
> With recent versions of gcc on Ubuntu a very large lzma_decompress.img file is
> output. (e.g. 134479600 bytes instead of 2864.) This causes grub-mkimage to
> fail with: "error: Decompressor is too big."
>
> This seems to be caused by a section .note.gnu.property that is placed at an
> offset such that objcopy needs to pad the img file with zeros.
>
> This issue is present on:
> Ubuntu 19.10 with gcc (Ubuntu 8.3.0-26ubuntu1~19.10) 8.3.0
> Ubuntu 19.10 with gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
>
> This issue is not present on:
> Ubuntu 19.10 with gcc (Ubuntu 7.5.0-3ubuntu1~19.10) 7.5.0
> RHEL 8.0 with gcc 8.3.1 20190507 (Red Hat 8.3.1-4)
>
> The issue can be fixed by removing the section using objcopy as shown in this
> patch:
>
> Signed-off-by: Simon Hardy <simon.hardy@itdev.co.uk>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


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

end of thread, other threads:[~2020-03-25 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-24 13:29 [PATCH] Fix GRUB i386-pc build with Ubuntu gcc Simon Hardy
2020-03-25 17:28 ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.