oxidize-rb / rb-sys

Easily build Ruby native extensions in Rust
https://oxidize-rb.github.io/rb-sys/
Apache License 2.0
222 stars 34 forks source link

windows eh-frame-header option #139

Open dsisnero opened 1 year ago

dsisnero commented 1 year ago

trying bundle gem --ext=rust hello_rust example on windows after ridk enable to get environment

bundle exec rake compile gives me the following error = note: c:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unrecognized option '--eh-frame-hdr' c:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: use the --help option for usage information collect2.exe: error: ld returned 1 exit status

Googling this error and arriving at https://github.com/avr-rust/blink/issues/23

For anyone else encountering this: The solution is to add "eh-frame-header": false to the target-json file.

ianks commented 1 year ago

Thanks for the report. Which ruby version are you using?

dsisnero commented 1 year ago

F:\windows\scoop\apps\alacritty\current>gem env RubyGems Environment:

On Tue, Jan 31, 2023 at 5:10 PM Ian Ker-Seymer @.***> wrote:

Thanks for the report. Which ruby version are you using?

— Reply to this email directly, view it on GitHub https://github.com/oxidize-rb/rb-sys/issues/139#issuecomment-1411247616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABQRLTXNYEX6WYA2RBKLDWVGSWHANCNFSM6AAAAAAUM4AAVU . You are receiving this because you authored the thread.Message ID: @.***>

dsisnero commented 1 year ago

Any other info you need on this?

ianks commented 1 year ago

Last couple of things:

  1. Can you post the full error output of rake compile?
  2. Also, the output of ruby -rrbconfig -e 'pp RbConfig::CONFIG'?

Also, question for @MSP-Greg, is x64-mingw-ucrt a valid platform for Ruby 3.2? I know it is for 3.1, but does the added support for mswin / msvc make this obsolete?

MSP-Greg commented 1 year ago

x64-mingw-ucrt a valid platform for Ruby 3.2?

Yes, it's the only platform that's widely available.

does the added support for mswin / msvc make this obsolete?

At present, no. It probably won't be replaced by mswin in the immediate future, as there are at least a few popular extension gems that won't compile on mswin.

dsisnero commented 1 year ago

bundle exec rake compile 2>&1

pp RbConfig::CONFIG

This is after I ran 'ridk enable`

ianks commented 9 months ago

I’m not sure how to fix this issue. Are you still having it?