Skip to content
This repository was archived by the owner on Apr 6, 2020. It is now read-only.
This repository was archived by the owner on Apr 6, 2020. It is now read-only.

relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC #110

@p-kraszewski

Description

@p-kraszewski

If compilation gives something like:

  = note: /usr/bin/ld: /storage/Projects/IntermezzOS_bare/target/x86_64-unknown-intermezzos-gnu/release/build/intermezzos-8ccbbf2f886be67d/out/libboot.a(boot.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: final link failed: Nie da się wyświetlić sekcji na wyjściu!
          collect2: error: ld returned 1 exit status

this is due to hardened compiler chain: at least on Hardened-Gentoo and Ubuntu 16.10+.

To fix it, you need to change x86_64-unknown-intermezzos-gnu.json by adding "-no-pie" to "pre-link-args". This will disable hardening for the project.

Hope this helps!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions