Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI only] Use pessimistic long branches on ARM #99119

Closed
wants to merge 1 commit into from

Conversation

filipnavara
Copy link
Member

@filipnavara filipnavara commented Feb 29, 2024

@MichalStrehovsky can you run NativeAOT outer loop with this, please?

Ref: #99079 (comment)

@filipnavara filipnavara added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it area-NativeAOT-coreclr and removed area-crossgen2-coreclr labels Feb 29, 2024
@ghost
Copy link

ghost commented Feb 29, 2024

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

@MichalStrehovsky can you run NativeAOT outer loop with this, please?

Ref: #99079 (comment)

Author: filipnavara
Assignees: -
Labels:

NO-MERGE, NO-REVIEW, area-NativeAOT-coreclr

Milestone: -

@jkotas
Copy link
Member

jkotas commented Feb 29, 2024

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@filipnavara
Copy link
Member Author

Thanks, this uncovered some new failure mode. Unfortunately I left my Raspberry Pi at office so I won't be able to reproduce it immediately.

@filipnavara
Copy link
Member Author

@am11 Do you remember if there's a reason not to use -fPIC for shared libraries in src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets? We already have PositionIndependentExecutable and default to true. Do you think it would make sense to do something like that for shared libraries too, or even enable -fPIC unconditionally?

@jkotas
Copy link
Member

jkotas commented Feb 29, 2024

Should -fPIC be on by default for shared libraries? If it is not, it is certainly fine to enable it.

@filipnavara
Copy link
Member Author

I assumed it is but the CI suggests otherwise (for ARM32, at least). I'll check it on Raspberry Pi tomorrow morning.

@am11
Copy link
Member

am11 commented Feb 29, 2024

-fPIC -fPIE are for compilation and -pie is for linking.

shared libraries and ELF are both executable by default, we set entrypoint to 0x0; something we picked up from how llvm toolchain build on Ubuntu:

<LinkerArg Include="-Wl,-e0x0" Condition="'$(NativeLib)' == 'Shared' and '$(_IsApplePlatform)' != 'true'" />

so the idea that PIE is for executable and PIC is for shared lib is not definitive.

@filipnavara
Copy link
Member Author

filipnavara commented Feb 29, 2024

-fPIC -fPIE are for compilation and -pie is for linking.

Well, the linker in the PR failed with

ld.lld(0,0): error : relocation R_ARM_THM_MOVW_PREL_NC cannot be used against symbol 'memmove'; recompile with -fPIC [/__w/1/s/src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj]
ld.lld(0,0): error : relocation R_ARM_THM_MOVT_PREL cannot be used against symbol 'memmove'; recompile with -fPIC [/__w/1/s/src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj]

I was caught a bit off guard by that because I assumed that (on Linux) shared libraries are always position independent. Both R_ARM_THM_MOVT_PREL and R_ARM_THM_MOVW_PREL_NC are very much position independent.

I guess I am just misinterpreting the error, and undefined symbols that result in dynamic relocations cannot express this.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants