Reputation: 1679
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:
cargo build -v
.rustc
is copied and -C link-args='-Wl,-undefined,dynamic_lookup'
added to it.This seems like a hard sell for automation. What options are available for adding codegen flags to Rust builds through cargo
?
Upvotes: 10
Views: 2113
Reputation: 127781
cargo
provides rustc
command which allows one to pass arbitrary compiler flags. The following should do it:
% cargo rustc -- -C link-args='-Wl,-undefined,dynamic_lookup'
Upvotes: 11