Skip to content

[Ruby] Stop stripping exported symbols - #31151

Open
peterzhu2118 wants to merge 1 commit into
grpc:masterfrom
peterzhu2118:stop-stripping-exported
Open

[Ruby] Stop stripping exported symbols#31151
peterzhu2118 wants to merge 1 commit into
grpc:masterfrom
peterzhu2118:stop-stripping-exported

Conversation

@peterzhu2118

Copy link
Copy Markdown
Contributor

This commit stops stripping exported symbols in the compiled binary. This will ensure that functions like Init_grpc and ruby_abi_version are not removed from the generated binary.

Fixes #30976.

This commit stops stripping exported symbols in the compiled binary.
This will ensure that functions like `Init_grpc` and `ruby_abi_version`
are not removed from the generated binary.

Fixes grpc#30976.
@zephleggett

Copy link
Copy Markdown

Thanks - this lets grpc compile under Ruby 2.7.4 [tested]

@johnnyshields

Copy link
Copy Markdown
Contributor

@apolcyn can we please make this a priority to merge and release? It's blocking Mac M1 users from installing latest GRPC on Ruby with this error:

linking shared-object grpc/grpc_c.bundle
Undefined symbols for architecture arm64:
  "_ruby_abi_version", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [grpc_c.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/drineliu/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/grpc-1.50.0 for inspection.
Results logged to /Users/drineliu/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/extensions/arm64-darwin-22/3.1.0/grpc-1.50.0/gem_make.out

@zephleggett

Copy link
Copy Markdown

@johnnyshields A work around is that you may run

bundle config build.grpc --with-ldflags="-Wl,-undefined,dynamic_lookup"

before bundle install

This should allow the gem to build on Apple Silicon/XCode 14

@johnnyshields

Copy link
Copy Markdown
Contributor

@apolcyn any update on this?

@apolcyn

apolcyn commented Dec 22, 2022

Copy link
Copy Markdown
Contributor

Thanks for the PR @johnnyshields and sorry for the review delay.

Thinking about this more, I'm actually favoring a slightly different approach - I opened #31970 - PLMK if you have any thoughts about that.

@stale

stale Bot commented Jun 18, 2023

Copy link
Copy Markdown

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@johnnyshields

Copy link
Copy Markdown
Contributor

@peterzhu2118 @apolcyn I assume this can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undefined symbol _ruby_abi_version regression with Xcode 13 -> 14

4 participants