Suggestions for librsvg's COMPILING.md



Hi,

In librsvg's COMPILING.md, there are two inconsistencies around cross-compiling.

  * The option --target=TRIPLE is passed to cargo, not --host.
  * RUST_TARGET_PATH should be set for make, not configure.

An alternative to writing a target JSON file could be to override
CARGO_TARGET_ARGS and RUST_TARGET_SUBDIR (if RUST_LIB used the
variable) when a compatible builtin target is available.  For example:

    ./configure --host=x86_64-redhat-linux-gnu ...
    make CARGO_TARGET_ARGS=--target=x86_64-unknown-linux-gnu ...

Is that worth maybe adding a --with-rust-target option to configure
that defaults to $host when cross-compiling?  (I didn't think of that
for the cross-compiling patch since I was only building for a new
target with no builtin support.)

As a side note, here is one way to generate a JSON spec from a similar
builtin target.  It may not be helpful including this in documentation
since it uses unstable options, so I'm just throwing it out there.

    RUSTC_BOOTSTRAP=1 rustc -Z unstable-options \
        --print=target-spec-json \
        --target=x86_64-unknown-linux-gnu |
    sed -e /is-builtin/d -e s/unknown/redhat/g \
        > "${RUST_TARGET_PATH%%:*}/x86_64-redhat-linux-gnu.json"

Thanks.

David


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]