Skip to content

macOS now uses SecRandomCopyBytes for us - #721

Closed
RalfJung wants to merge 1 commit into
rust-lang:masterfrom
RalfJung:rustup
Closed

macOS now uses SecRandomCopyBytes for us#721
RalfJung wants to merge 1 commit into
rust-lang:masterfrom
RalfJung:rustup

Conversation

@RalfJung

@RalfJung RalfJung commented May 2, 2019

Copy link
Copy Markdown
Member

This builds on top of rust-lang/rust#60156.

Fixes #686

@RalfJung

RalfJung commented May 2, 2019

Copy link
Copy Markdown
Member Author

Uh, dang. Maybe that was not such a good idea:

  = note: Undefined symbols for architecture x86_64:
            "_SecRandomCopyBytes", referenced from:
                std::sys::unix::rand::hashmap_random_keys::hbdc7ddba9ddf117d in std.std.8sfdv10m-cgu.6.rcgu.o
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

@ebarnard had the same problem with rust-lang/rust#59879, I wonder if we can apply their solution conditionally. They added cargo:rustc-link-lib=framework=Security to the build script output; can that depend on features?

@oli-obk

oli-obk commented May 2, 2019

Copy link
Copy Markdown
Contributor

can that depend on features?

You should be able to use CARGO_CFG_<cfg> according to the docs https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

@RalfJung

RalfJung commented May 2, 2019

Copy link
Copy Markdown
Member Author

This is not a "configuration option" of libstd though, it's a --cfg miri passed via RUSTFLAGS.

@RalfJung RalfJung closed this May 4, 2019
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.

Implement libstd HashMap seeding on OS X

2 participants