Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native_posix build on Debian #38903

Merged
merged 1 commit into from
Oct 5, 2021
Merged

Commits on Oct 5, 2021

  1. build: Fix native_posix build on GNU GCC

    Update -fno-pie to only be added when relevant. This fixes native_posix
    builds on Debian hosts.
    
    * Debian and other Linux distributions have ld with --warn-textrel as
    default.
    * The option generates a warning when linking on x86.
    * The warning make scripts/twister fail because we treat all warnings
    as error.
    * The warning is issued when no PIE objects are linked against PIE
    library.
    * PIE (Position Independent Executable) or not can be seen with the
    following command.
    * When you want to generate non PIE, link with `-no-pie.`
    
    Non PIE
    
      $ readelf -l build/zephyr/zephyr.elf | grep 'Elf file type is'
      Elf file type is EXEC (Executable file)
    
    PIE
    
      $ readelf -l /lib/x86_64-linux-gnu/libc.so.6 | \
      grep 'Elf file type is'
      Elf file type is DYN (Shared object file)
    
    Issue zephyrproject-rtos#35244
    
    Signed-off-by: Yuval Peress <peress@google.com>
    yperess committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    f03a7a2 View commit details
    Browse the repository at this point in the history