google / google/rust_icu

static linking doesn't seem to work

Open
#313 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
140
Forks
34
Avg merge
5h 5m
Merged PRs (30d)
4

Description

Hello, I'm using rust_icu in my code and static linking doesn't seem to work. I did verify dynamic linking (i.e., the default) works.

This is my main.rs
```
use rust_icu::sys::{UErrorCode, versioned_function};

fn main() {
let bytes = vec![1, 2, 3, 4];
let mut signature_length: i32 = 0;
let mut p_error_code: UErrorCode = UErrorCode::U_ZERO_ERROR;
unsafe {
let _result = versioned_function!(ucnv_detectUnicodeSignature)(
bytes.as_ptr() as *const std::os::raw::c_char,
bytes.len() as i32,
&mut signature_length,
&mut p_error_code,
);
}
}
```
This is my Cargo.toml:
```
[package]
name = "testicu"
version = "0.1.0"
edition = "2024"

[dependencies]
rust_icu_sys = { version = "5.0.0", features = ["static"] }
```
When compiling, I got the following error:
```
$ cargo build
Compiling rust_icu_sys v5.0.0
error: overriding linking modifiers from command line is not supported

error: could not compile `rust_icu_sys` (lib) due to 1 previous error
```
Can you please confirm whether this is a bug or if I'm doing something wrong? Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.