Closed
Description
The mac version of c2rust with dynamic instrumentation enabled only requires libiconv at some point in the build, resulting in the following error.
= note: Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_git_fs_path_iconv in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
"_libiconv_open", referenced from:
_git_fs_path_direach in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
_git_fs_path_iconv_init_precompose in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
_git_fs_path_diriter_init in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
"_libiconv_close", referenced from:
_git_fs_path_direach in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
_git_fs_path_iconv_clear in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
_git_fs_path_diriter_free in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
_git_fs_path_dirload in liblibgit2_sys-4e72aab137059590.rlib(fs_path.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This happens on my mac (a Catalina), which has iconv, and won't link libiconv (installed via brew) because it already has iconv which does the same thing.
This post on stackoverflow (https://stackoverflow.com/questions/57734434/libiconv-or-iconv-undefined-symbol-on-mac-osx) has the best description of the problem that I've found.
Because the compilation is handled by cargo, I don't know how to find a list of all the compilation steps to add --with-libiconv-prefix=<dir>
to, or whether this would work.