Skip to content

Remove executable bits from generated shared libs - #73686

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
am11:feature/nativeaot/build-integration
Aug 12, 2022
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
am11:feature/nativeaot/build-integration

Conversation

@am11

@am11 am11 commented Aug 10, 2022

Copy link
Copy Markdown
Member

In the llvm-toolchain installation on debian, there is no executable bit set for shared libraries. This PR adapts that convention in NativeAOT and strips the executable bits from the generated shared libs.

--- before
+++ after

$ dotnet7 publish -o dist --use-current-runtime -c Release -p:PublishAot=true
$ readelf -e dist/nativelib1.so  | grep Entry
-  Entry point address:               0xcac60
+  Entry point address:               0x0
$ stat -c %a dist/nativelib1.so
- 775
+ 644

@am11
am11 requested a review from MichalStrehovsky as a code owner August 10, 2022 11:04
@ghost ghost added area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member labels Aug 10, 2022
@am11

am11 commented Aug 10, 2022

Copy link
Copy Markdown
Member Author

osx-x64 failure is unrelated gc issue - #73668.

@am11

am11 commented Aug 12, 2022

Copy link
Copy Markdown
Member Author

@MichalStrehovsky, @jkotas PTAL. It reduces the default permissions of shared object on Linux. This convention is used throughout the llvm-toolchain.

@MichalStrehovsky MichalStrehovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find when clang is doing this, but I guess if the output looks the same, LGTM. Thanks!

@MichalStrehovsky
MichalStrehovsky merged commit 2e4824a into dotnet:main Aug 12, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants