keymanapp / keymanapp/keyman

bug(core): Getting a warning when linking statically with libkeymancore

Open
#10,882 6 comments 0 reactions 1 assignee Claimed by @ermshiperete View on GitHub
bug core/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

On Linux, running the script below which builds an app with static linking results in a warning:

```
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libicuuc.a(putil.ao): in function `uprv_dl_open_70':
(.text+0x1936): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
```

We should fix the warning (which probably requires static linking to ICU for the static libkeymancore library), or not ship the static version of libkeymancore (and remove the dependency on `libicu-dev` from `linux/debian/control` and the `requires.private` line from the `keyman_core.pc` file).

```bash
cat < keymantest.c
#include

int main(int argc, char *argv[]) {
km_core_option_item opts[] = {KM_CORE_OPTIONS_END};
km_core_keyboard *kb = NULL;
km_core_state *state = NULL;
km_core_keyboard_load(NULL, &kb);
km_core_state_create(kb, opts, &state);
km_core_actions const *a = km_core_state_get_actions(state);
}
EOF

# shellcheck disable=SC2046 disable=SC2312
g++ keymantest.c -static $(pkg-config --cflags --libs keyman_core) \
$(pkg-config --cflags --libs icu-uc) $(pkg-config --cflags --libs icu-i18n)
```

This should also be added as an autopkgtest to `linux/debian/tests/test-build`.

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.