-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Support 16 KB page sizes on Android - libsentrysupplemental #3723
Conversation
…s and Sentry.Native.targets
@supervacuus it looks like when you made the change to support this in sentry-native, it was only enabled for shared libs: if(SENTRY_BUILD_SHARED_LIBS)
target_link_libraries(sentry PRIVATE
"$<$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:Android>>:-Wl,--build-id=sha1,--version-script=${PROJECT_SOURCE_DIR}/src/exports.map>")
# Support 16KB page sizes
target_link_libraries(sentry PRIVATE
"$<$<PLATFORM_ID:Android>:-Wl,-z,max-page-size=16384>"
)
endif() Where the comment for SENTRY_BUILD_SHARED_LIBS is: option(SENTRY_BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" ${BUILD_SHARED_LIBS}) The sentry-dotnet/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets Lines 30 to 34 in 830ba36
Could that explain why we're getting alignment warnings from the sentry-native libraries we're linking in the sentry-dotnet repo? Full disclosure: I know virtually nothing about native development... I vaguely remember studying C and C++ about 30 years ago 😛 |
I don't think what you're seeing is related to the version of The changes here, together with a release of tracking issue: getsentry/sentry-java#3657 |
We only do this for Native AOT on desktop afaik (do we also do this on mobile @vaind ?)
One of those |
Absolutely, that is why I wrote:
|
Thanks @supervacuus,
Ah, OK that makes sense.
Just tested with 7.17.0-alpha.1 and I can confirm that this resolves the alignment warnings 👍🏻 |
Sentry.Native subproject here is just desktop. I'm not aware of what the mobile side is doing in sentry-java but as @jamescrosswell have just noticed, there's a PR in sentry-java to fix this issue which would come in due time and I don't think we need to do anything in the dotnet repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
We need both. This PR fixes the "suplemental" lib which is just an example crash we bundle. So we can merge this, and independently bump Android once that PR is merged, and the all the warnings should be gone |
Resolves #3633
Summary
When targeting
net9.0-android
we get build warnings fromXamarin.Android.Common.Debugging.targets
when it tries to build the apk:This link contained in the warning explains.
Solution
sentry-dotnet repo
This PR addresses the warnings for
libsentrysupplemental.so
, the source for which is in this repository. The most relevant parts of the PR are:sentry-dotnet/lib/sentrysupplemental/CMakeLists.txt
Lines 6 to 7 in 8669e4c
Rebuilding with those changes results in changes to the so files, which we have checked in to this repo (presumably because they change very infrequently).
And to test this (since it only presents for us when targeting
net9.0-android
) we bumped the target frameworks forsamples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj
fromnet8.0
tonet9.0
.sentry-jave repo
The other shared libraries are part of the sentry-native repository that we get transitively through sentry-java when targeting
net9.0-android
.Tracking issue: