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

fix: Add a linker script to enforce exported symbols #363

Merged
merged 4 commits into from
Feb 13, 2023

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented Aug 26, 2020

Trying to implement the suggestion from https://github.com/getsentry/sentry-android/issues/509

CC @eakoli and @blinkov since you added that CMake setting.

I’m thinking if we should maybe expose the breakpad and crashpad symbols? Maybe users might expect to be able to call out to crashpad if they link to sentry built with the crashpad backend.

@Swatinem Swatinem requested a review from a team August 26, 2020 10:18
CMakeLists.txt Outdated
# FIXME: cmake 3.13 introduced target_link_options
target_link_libraries(sentry PUBLIC
"$<$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:Android>>:-Wl,--build-id=sha1,--version-script=${PROJECT_SOURCE_DIR}/src/exports.map>")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the --version-script be a PRIVATE flag instead of PULBIC and only enabled if SENTRY_SHARED_LIBS=ON ?

As you wouldn't want binaries linked to sentry to use that linker script.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 sounds good. Still trying to figure out how all this plays together.

CMakeLists.txt Outdated
else()
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not sure I understand the intent of altering the visibility settings.

@Swatinem Swatinem marked this pull request as draft December 1, 2020 09:04
@flub flub removed the request for review from a team December 1, 2020 09:04
@Swatinem Swatinem closed this Apr 16, 2021
@Swatinem Swatinem reopened this Mar 30, 2022
@supervacuus supervacuus marked this pull request as ready for review January 26, 2023 14:35
@codecov
Copy link

codecov bot commented Feb 4, 2023

Codecov Report

Merging #363 (ede1a1a) into master (d82af0a) will increase coverage by 0.07%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #363      +/-   ##
==========================================
+ Coverage   81.18%   81.25%   +0.07%     
==========================================
  Files          53       53              
  Lines        6947     6947              
  Branches     1112     1112              
==========================================
+ Hits         5640     5645       +5     
+ Misses       1196     1192       -4     
+ Partials      111      110       -1     

@supervacuus
Copy link
Collaborator

@Swatinem, I cannot invite you to a review since you started this. Let me know how you want to handle it. I am fine both ways (new PR or review via comment and I approve), I am happy either way.

@Swatinem
Copy link
Member Author

lgtm, you can approve and merge :-)

@supervacuus supervacuus merged commit 80831d4 into master Feb 13, 2023
@supervacuus supervacuus deleted the fix/exported-symbols branch February 13, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants