Skip to content
Snippets Groups Projects
  • Simon Hardy's avatar
    6643507c
    build: Fix GRUB i386-pc build with Ubuntu gcc · 6643507c
    Simon Hardy authored
    
    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: default avatarSimon Hardy <simon.hardy@itdev.co.uk>
    Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
    6643507c
    History
    build: Fix GRUB i386-pc build with Ubuntu gcc
    Simon Hardy authored
    
    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: default avatarSimon Hardy <simon.hardy@itdev.co.uk>
    Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>