#38851 closed defect (invalid)
git-core @1.8.2.1 does not link - missing libiconv depencies
Reported by: | thebrenthaines@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.3 |
Keywords: | Cc: | ryandesign (Ryan Carsten Schmidt), ci42 | |
Port: | git-core |
Description
git-core fails to link due to missing libiconv depencies.
instructions:
libiconv @1.14 is installed...
I'm on Mac OSX 10.8.3 using XCode 4.6.2 (4H1003)
sudo port clean git-core sudo port clean libiconv sudo port install libiconv sudo port install git-core
Does not work. I will attach the build log for the last command.
Attachments (1)
Change History (10)
Changed 12 years ago by thebrenthaines@…
comment:1 Changed 12 years ago by larryv (Lawrence Velázquez)
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation) :info:build make: *** [git-fast-import] Error 1 :info:build Undefined symbols for architecture x86_64: :info:build "_libiconv", referenced from: :info:build _reencode_string_iconv in libgit.a(utf8.o) :info:build _precompose_utf8_readdir in libgit.a(precompose_utf8.o) :info:build "_libiconv_close", referenced from: :info:build _reencode_string in libgit.a(utf8.o) :info:build _precompose_argv in libgit.a(precompose_utf8.o) :info:build _precompose_utf8_closedir in libgit.a(precompose_utf8.o) :info:build "_libiconv_open", referenced from: :info:build _reencode_string in libgit.a(utf8.o) :info:build _precompose_argv in libgit.a(precompose_utf8.o) :info:build _precompose_utf8_opendir in libgit.a(precompose_utf8.o) :info:build ld: symbol(s) not found for architecture x86_64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
What architectures is your libiconv
installed for?
% port -v installed libiconv
comment:2 Changed 12 years ago by thebrenthaines@…
Looks like 64bit x86...
MacBook-Bro:cloudcar brenthaines$ port -v installed libiconv The following ports are currently installed: libiconv @1.14_0 (active) platform='darwin 12' archs='x86_64' MacBook-Bro:cloudcar brenthaines$
comment:3 Changed 12 years ago by larryv (Lawrence Velázquez)
Cc: | ryandesign@… ciserlohn@… added |
---|
comment:4 Changed 12 years ago by ci42
What's the output of:
$ file /opt/local/lib/libiconv.dylib
and
$ nm -arch x86_64 -g /opt/local/lib/libiconv.2.dylib
?
comment:5 follow-up: 6 Changed 12 years ago by thebrenthaines@…
MacBook-Bro:Shufflin brenthaines$ file /opt/local/lib/libiconv.2.dylib /opt/local/lib/libiconv.2.dylib: Mach-O 64-bit x86_64 dynamically linked shared library MacBook-Bro:Shufflin brenthaines$ nm -arch x86_64 -g /opt/local/lib/libiconv.2.dylib U ___error U ___mb_cur_max U ___stack_chk_fail U ___stack_chk_guard 00000000000f90c0 D __libiconv_version U _abort U _free 0000000000003000 T _iconv_canonicalize 0000000000002760 T _libiconv 0000000000002790 T _libiconv_close 0000000000001350 T _libiconv_open 00000000000027a0 T _libiconv_open_into 00000000000178c0 T _libiconv_set_relocation_prefix 0000000000002cc0 T _libiconvctl 0000000000002dd0 T _libiconvlist U _malloc U _mbrtowc U _memcmp U _memcpy U _nl_langinfo U _qsort U _strcmp U _strcpy U _strlen U _strncmp U _wcrtomb U dyld_stub_binder MacBook-Bro:Shufflin brenthaines$
comment:6 Changed 12 years ago by ci42
Replying to thebrenthaines@…:
MacBook-Bro:Shufflin brenthaines$ file /opt/local/lib/libiconv.2.dylib /opt/local/lib/libiconv.2.dylib: Mach-O 64-bit x86_64 dynamically linked shared libraryMacBook-Bro:Shufflin brenthaines$ nm -arch x86_64 -g /opt/local/lib/libiconv.2.dylib
(...)
0000000000002760 T _libiconv 0000000000002790 T _libiconv_close 0000000000001350 T _libiconv_open
(...)
Contrary to the error message libiconv provides the symbols for the correct architecture.
Do you have another libiconv installed on your machine, which clang/ld tries to link against?
What's the output of:
$ ls -lha /opt/local/lib/libiconv*
I disabled parallel building in r105411 in case it is timing issue.
Please try again
$ sudo port selfupdate $ sudo port clean git-core $ sudo port install git-core
and report the result.
comment:7 Changed 12 years ago by thebrenthaines@…
Nailed it...
MacBook-Bro:Shufflin brenthaines$ ls -lha /opt/local/lib/libiconv* -rw-r--r-- 1 root admin 1.0M Nov 17 17:21 /opt/local/lib/libiconv.2.dylib -rw-r--r-- 1 root admin 1.1M Nov 17 17:21 /opt/local/lib/libiconv.a lrwxr-xr-x 1 root admin 23B Mar 5 20:02 /opt/local/lib/libiconv.dylib -> /usr/lib/libiconv.dylib -rw-r--r-- 1 root admin 914B Nov 17 17:21 /opt/local/lib/libiconv.la
The link finally resolves to:
file /usr/lib/libiconv.2.dylib /usr/lib/libiconv.2.dylib: Mach-O universal binary with 2 architectures: [i386: Mach-O i386 dynamically linked shared library] [x86_64]
This version does not have the correct symbols and removing the symbolic link fixed the build issue. Thanks.
comment:8 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → invalid |
---|---|
Status: | new → closed |
How did you manage to replace the MacPorts file /opt/local/lib/libiconv.dylib with a symlink to a system library? That should never be.
You can get /opt/local/lib/libiconv.dylib back the way it should be (a symlink to the MacPorts library) by deactivating and re-activating the libiconv port:
sudo port -f deact libiconv sudo port act libiconv
Or you can re-create the symlink manually.
comment:9 Changed 12 years ago by thebrenthaines@…
Not sure how it happened. I suspect that something else I installed from source may have done it, but I don't know. Thanks for the help.
main log for building git-core on my macbook pro