Make PIC/PIE levels compatible for LTO (Soong).
The build system currently uses -fPIC for position independent libraries, and -fpie for position independent executables. However, these levels are incompatible and conflict when an executable includes a static lib with the -fPIC flag - such as when building with LTO. This CL changes the flag for executables to the compatible -fPIE instead, which is equivalent for all architectures except PowerPC. Bug: 30227045 Test: ENABLE_CFI=true m -j40 checkbuild # builds and boots Change-Id: I95b585b553bc00bc1d4f52f4271c5e30e1007d9b
This commit is contained in:
parent
3e231fd8bd
commit
e87b768200
1 changed files with 1 additions and 1 deletions
|
@ -214,7 +214,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
|
|||
// all code is position independent, and then those warnings get promoted to
|
||||
// errors.
|
||||
if !ctx.Windows() {
|
||||
flags.CFlags = append(flags.CFlags, "-fpie")
|
||||
flags.CFlags = append(flags.CFlags, "-fPIE")
|
||||
}
|
||||
|
||||
if ctx.toolchain().Bionic() {
|
||||
|
|
Loading…
Reference in a new issue