From 873775b42431bf27a9ae69633864e5290443c29b Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Thu, 2 Feb 2023 18:02:34 +0200 Subject: [PATCH] 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) --- .../BuildIntegration/Microsoft.NETCore.Native.Unix.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index eb9f33319f02a..aac111f724cc6 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -134,7 +134,8 @@ The .NET Foundation licenses this file to you under the MIT license. - + +