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

build error: ld: error: undefined symbol: locale_charset (if configure detects locale_charset) #25

Open
jhgit opened this issue Nov 29, 2022 · 2 comments · May be fixed by #27
Open

build error: ld: error: undefined symbol: locale_charset (if configure detects locale_charset) #25

jhgit opened this issue Nov 29, 2022 · 2 comments · May be fixed by #27

Comments

@jhgit
Copy link

jhgit commented Nov 29, 2022

configure && make
.
.
checking for locale_charset in -liconv... yes
.
.
libtool: link: cc -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -o .libs/trietool trietool.o  -L/usr/local/lib ../datrie/.libs/libdatrie.so -Wl,-rpath -Wl,/usr/local/lib
ld: error: undefined symbol: locale_charset
>>> referenced by trietool.c
>>>               trietool.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [trietool] Error code 1

make[6]: stopped in /wrkdirs/usr/ports/devel/libdatrie/work/libdatrie-0.2.13/tools

Noticed on FreeBSD 12 with the libiconv package installed (in /usr/local).

The link command is missing -liconv

@jhgit
Copy link
Author

jhgit commented Nov 29, 2022

FYI, this started happening recently because libiconv-1.17 (released 2022) exports the locale_charset symbol whereas in libiconv-1.16 (released 2019) the symbol was NOT exported. So when building with libiconv-1.16 libdatrie's configure did not detect locale_charset.

@jhgit
Copy link
Author

jhgit commented Nov 30, 2022

Here is a patch for configure that sets ICONV_LIBS=-liconv if configure detects that it wants to use libiconv based on the presence of locale_charset (in addition to the case where configure decides it wants to use libiconv for iconv_open). This was build tested with and without libiconv.

libdatrie.patch-configure.ac.txt

jhgit added a commit to jhgit/libdatrie that referenced this issue Mar 22, 2023
This allows the presence of locale_charset to indicate that -liconv is to be used.
Before libiconv-1.17, the locale_charset symbol was not exported (and
so locale_charset was not detected).

Fixes tlwg#25
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 a pull request may close this issue.

1 participant