Pass -pie and -no-pie to the linker (#81533)
authorAdeel Mujahid <3840695+am11@users.noreply.github.com>
Thu, 2 Feb 2023 16:02:34 +0000 (18:02 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Feb 2023 16:02:34 +0000 (08:02 -0800)
commit873775b42431bf27a9ae69633864e5290443c29b
tree0204b90c301d95b917234803cefd15b67bfbb282
parente2a706e206ba620bffa94cc1c4959cfb82cb3638
Pass -pie and -no-pie to the linker (#81533)

* Pass -pie and -no-pie to the linker

When `PositionIndependentExecutable` is `false`, we need to pass
`-no-pie` to the linker. Otherwise, we need to pass `-pie` to the
linker with `-Wl` because we are not compiling the code at this stage
(only linking the objects).

* Add -pie for non-pie .o (in CentOS 7)
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets