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

Specify -z notext on linux-musl-x86 and riscv64 #83682

Merged
merged 5 commits into from
Apr 25, 2023

Conversation

am11
Copy link
Member

@am11 am11 commented Mar 20, 2023

'text': Report an error if DT_TEXTREL is set, i.e., if the position-independent or shared object has dynamic relocations in read-only sections. Don’t report an error if ‘notext’ or ‘textoff’.

Starting from binutils' ld 2.35 and lld-15 on linux/x86, if there are text relocations the warning is issued by default.

Ref: #83509 (comment)
cc @ayakael

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Mar 20, 2023
@ghost
Copy link

ghost commented Mar 20, 2023

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

-z text does not allow text relocations. -z notext allows text relocations.

Starting from binutils' ld 2.35 and lld-15 on linux/x86, if there are text relocations the warning is issued by default.

Ref: #83509 (comment)

Author: am11
Assignees: -
Labels:

area-Infrastructure-coreclr, community-contribution

Milestone: -

@am11 am11 requested a review from janvorli March 20, 2023 17:42
@am11
Copy link
Member Author

am11 commented Mar 20, 2023

@ayakael, now we have a docker image:

$ docker run -v$(pwd):/runtime -e ROOTFS_DIR=/crossrootfs/x86 --rm \
    mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-x86-alpine \
    /runtime/build.sh clr+host+libs -a x86 -cross

Requires three patches: #83464, #83672 and #83682.

@ayakael
Copy link
Contributor

ayakael commented Mar 20, 2023

@ayakael, now we have a docker image:

$ docker run -v$(pwd):/runtime -e ROOTFS_DIR=/crossrootfs/x86 --rm \
    mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-x86-alpine \
    /runtime/build.sh clr+host+libs -a x86 -cross

Requires three patches: #83464, #83672 and #83682.

Very nice! Many thanks for upstreaming these.

@ayakael
Copy link
Contributor

ayakael commented Mar 20, 2023

We may have to extend the condition to include CLR_CMAKE_TARGET_ARCH_RISCV64

I'm testing #82294, and encountering similar error that -z notext should fix: https://lab.ilot.io/ayakael/dotnet-stage0/-/jobs/1488

I've tried extending the condition, but the error still persists when linking libcoreclr.so. artifacts/obj/coreclr/linux.riscv64.Release/dlls/mscoree/coreclr/CMakeFiles/coreclr.dir/link.txt includes the relevant linker arg.

src/coreclr/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

Merge conflict with #84148 needs to be resolved by adding same flag under CLR_CMAKE_TARGET_ALPINE_LINUX. Also note that I saw the warnings with lld 12. Otherwise LGTM. Thanks!

@am11 am11 changed the title Specify -z notext on linux-musl-x86 Specify -z notext on linux-musl-x86 and riscv64 Apr 24, 2023
@am11 am11 requested a review from jkotas April 24, 2023 16:16
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@clamp03
Copy link
Member

clamp03 commented Apr 25, 2023

noti to #84834

@ghost ghost locked as resolved and limited conversation to collaborators May 25, 2023
@am11 am11 deleted the feature/build/linux-musl-x86 branch July 11, 2024 12:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-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.

5 participants