Skip to content

Commit

Permalink
NativeAot: Allow disabling -pie flag (dotnet#64580)
Browse files Browse the repository at this point in the history
Adds a msbuild property `PositionIndependentExecutable` to the -pie
flag.

While good by default for security reasons they might make binary
incompatible with certain tools.
  • Loading branch information
StephanDollberg authored Feb 1, 2022
1 parent 463e279 commit 58db8db
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Include="-dynamiclib" Condition="'$(TargetOS)' == 'OSX' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="-shared" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == 'Shared'" />
<!-- binskim warning BA3001 PIE disabled on executable -->
<LinkerArg Include="-pie" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == ''" />
<LinkerArg Include="-pie" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == '' and '$(PositionIndependentExecutable)' != 'false'" />
<!-- binskim warning BA3010 The GNU_RELRO segment is missing -->
<LinkerArg Include="-Wl,-z,relro" Condition="'$(TargetOS)' != 'OSX'" />
<!-- binskim warning BA3011 The BIND_NOW flag is missing -->
Expand Down

0 comments on commit 58db8db

Please sign in to comment.