On Macintosh, to allow some symbols to go unlinked, it is necessary to pass -C link-args='-Wl,-undefined,dynamic_lookup'
to the Rust compiler. One needs to do this when building Postgres plugins, because some of the Postgres intrinsics are only compiled into the Postgres server, and not available for linking from shared libs.
At present, the project's process is as follows:
- Build is run with
cargo build -v
. - Failing call to
rustc
is copied and-C link-args='-Wl,-undefined,dynamic_lookup'
added to it. - Success!
This seems like a hard sell for automation. What options are available for adding codegen flags to Rust builds through cargo
?