solidsnack
solidsnack

Reputation: 1679

Adding codegen flags to a Cargo build

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:

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

Answers (1)

Vladimir Matveev
Vladimir Matveev

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

Related Questions