Skip to content
Snippets Groups Projects
  • Petr Štetiar's avatar
    4b716572
    scripts: bundle-libraries.sh: fix broken SDK compiler · 4b716572
    Petr Štetiar authored
    Recent versions (> 5.33) of `file` report liblto_plugin.so as
    executable:
    
     $ file liblto_plugin.so
     liblto_plugin.so.0.0.0: ELF 64-bit LSB pie executable ...
    
    Which then leads to improper packaging of the plugin, resulting in the
    broken compiler:
    
     configure: checking whether the C compiler works
     mips-openwrt-linux-musl/bin/ld: liblto_plugin.so: error loading plugin: liblto_plugin.so: invalid ELF header
    
    As the LTO compiler plugin library is incorrectly packaged as SDK
    executable:
    
     $ head -1 ~/staging_dir/toolchain...libexec/gcc/.../liblto_plugin.so
     #!/usr/bin/env bash
    
    Fix this by filtering out shared libraries from the patching.
    
    Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1296868
    
    
    Acked-by: default avatarJo-Philipp Wich <jo@mein.io>
    Signed-off-by: default avatarPetr Štetiar <ynezz@true.cz>
    4b716572
    History
    scripts: bundle-libraries.sh: fix broken SDK compiler
    Petr Štetiar authored
    Recent versions (> 5.33) of `file` report liblto_plugin.so as
    executable:
    
     $ file liblto_plugin.so
     liblto_plugin.so.0.0.0: ELF 64-bit LSB pie executable ...
    
    Which then leads to improper packaging of the plugin, resulting in the
    broken compiler:
    
     configure: checking whether the C compiler works
     mips-openwrt-linux-musl/bin/ld: liblto_plugin.so: error loading plugin: liblto_plugin.so: invalid ELF header
    
    As the LTO compiler plugin library is incorrectly packaged as SDK
    executable:
    
     $ head -1 ~/staging_dir/toolchain...libexec/gcc/.../liblto_plugin.so
     #!/usr/bin/env bash
    
    Fix this by filtering out shared libraries from the patching.
    
    Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1296868
    
    
    Acked-by: default avatarJo-Philipp Wich <jo@mein.io>
    Signed-off-by: default avatarPetr Štetiar <ynezz@true.cz>