https://bugs.llvm.org/show_bug.cgi?id=48109
Bug ID: 48109
Summary: Clang does not pass `-pie` to the linker when using
`-fPIE`
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Driver
Assignee: unassignedclangb...@nondot.org
Reporter: harley.pater...@postgrad.otago.ac.nz
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk
Clang does not pass the `-pie` argument to the linker implicitly when `-fPIE`
is used.
This is not strictly a bug, but a difference in the default behavior of Clang
and GCC which can cause some programs to be unexpectedly linked as classic
position dependent excutables (`PT_EXEC` for ELFs), rather than a position
independent executable (`PT_DYN` for ELFs)
See LLD bug report [48035](https://bugs.llvm.org/show_bug.cgi?id=48035)for a
detailed discussion.
I suggest modifying Clang's default behavior to match GCC: Implicitly pass
`-pie` when `-fPIE` or `-fpie` is used.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs