Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom-prefix feature flag #125

Merged
merged 2 commits into from
Jul 26, 2024
Merged

add custom-prefix feature flag #125

merged 2 commits into from
Jul 26, 2024

Conversation

folkertdev
Copy link
Collaborator

fixes #124

Add a custom prefix to all exported symbols.

The value of the `LIBZ_RS_SYS_PREFIX` is used as a prefix for all exported symbols. For example:

```
> LIBZ_RS_SYS_PREFIX=MY_CUSTOM_PREFIX cargo build -p libz-rs-sys --features=custom-prefix
   Compiling libz-rs-sys v0.2.1 (/home/folkertdev/rust/zlib-rs/libz-rs-sys)
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.21s
> objdump -tT target/debug/liblibz_rs_sys.so | grep uncompress
0000000000081028 l     O .got0000000000000000              _ZN7zlib_rs7inflate10uncompress17he7d985e55c58a189E
000000000002c570 l     F .text00000000000001ef              _ZN7zlib_rs7inflate10uncompress17he7d985e55c58a189E
0000000000024330 g     F .text000000000000008e              MY_CUSTOM_PREFIXuncompress
0000000000024330 g    DF .text000000000000008e  Base        MY_CUSTOM_PREFIXuncompress
```
@folkertdev folkertdev changed the title mark all exposed functions as #[no_mangle] add custom-prefix feature flag Jul 22, 2024
@folkertdev folkertdev requested a review from rnijveld July 25, 2024 12:32
@rnijveld
Copy link
Collaborator

Looks good to me!

@rnijveld rnijveld merged commit 5c3d66e into main Jul 26, 2024
13 checks passed
@rnijveld rnijveld deleted the no-mangle-api branch July 26, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libz-rs-sys functions are missing #[no_mangle]
2 participants