Skip to content

Conversation

@peterzhu2118
Copy link
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

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

@johnnyshields
Copy link
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

@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
Contributor

@apolcyn any update on this?

@apolcyn
Copy link
Contributor

apolcyn commented Dec 22, 2022

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
Copy link

stale bot commented Jun 18, 2023

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
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