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 macos-11 #167

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Fix macos-11 #167

merged 1 commit into from
Apr 12, 2022

Commits on Apr 12, 2022

  1. Fix linking Rust targets on Macos 11

    For Rust targets, Rust will invoke the linker and add (among others) the
     -lSystem flag. This works fine for the default linker, but if we use a
      custom linker (e.g. g++, or even /usr/bin/ld), then we must provide
      that path to the System library.
    
    Adding -L<path> to RUSTFLAGS works fine for regular libraries, but fails
     for build-scripts (See rust-lang/cargo#4423 )
    because there is no way to set RUSTFLAGS for build scripts when
    cross-compiling. This is mostly an issue because we always specify the
    target, even when building for host, but that is already sufficient for
    the RUSTFLAGS to not apply to the build-script-build.
    
    Target specific RUSTFLAGS (i.e CARGO_TARGET_<triple>_RUSTFLAGS also
    don't seem to affect buildscripts.
    
    Setting LIBRARY_PATH=<path> applies to normal targets and build-scripts
    too, and seems to fix the issue.
    
    My previous fix probably only fixed the case where a rust library gets
    linked into a foreign library or executable.
    jschwe committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    b7cc53c View commit details
    Browse the repository at this point in the history