Menu

#226 clang: error: linker command failed with exit code 1 (use -v to see invocation)

open
nobody
None
5
2017-09-09
2017-08-30
Benjamin
No

I am running Mac OS X 10.11.6 on a Macbook Air.

When I am compiling libticonv, I am getting an error, which reads:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Discussion

  • Lionel Debroux

    Lionel Debroux - 2017-08-30

    Having a more complete terminal output from that error would be useful ;)

    But - which version of libticonv are you building, and how are you building it ? There's an issue with the version corresponding to TILP II 1.18, fixed in Git. It's supposed to work now, as Adriweb performed tests for ticket #225 from MacOS X.

     
  • Benjamin

    Benjamin - 2017-08-30

    I was trying to build 1.1.5 associated with TILP II 1.15. Would building it from git most likely work?

     
  • Benjamin

    Benjamin - 2017-08-30

    The full terminal output from running the install script is below:

    Modern MacOS X versions don't like programs installing to /usr, using /usr/local instead
    Modifying PKG_CONFIG_PATH on MacOS X
    Will use PREFIX=/usr/local
    Will use SRCDIR=/Users/USERNAME/lpg
    Will use PATH=/usr/local/opt/llvm/bin:/Users/USERNAME/anaconda/bin:/Users/USERNAME/Library/Haskell/bin:/Users/USERNAME/torch/install/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/git/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin
    Will use LD_LIBRARY_PATH=
    Will use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
    Will use LIBDIR=/usr/local/lib
    Will use CC=gcc
    Will use CXX=g++
    -e Before proceeding further, make sure that you're ready to go (look inside the install script):
    -e 1) configured PREFIX and SRCDIR the way you wish
    -e    (as well as CC and CXX if you're into using non-GCC compilers when the distro defaults to GCC);
    -e 2) configured PKG_CONFIG_PATH if necessary
    -e 3) purged any installed distro packages for libticonv, libtifiles, libticables, libticalcs, gfm, tilp.
    -e 4) installed the build dependencies listed in the script. For instance:
    Debian 8:
    -e     apt-get install build-essential git autoconf automake autopoint libtool libtool-bin libglib2.0-dev zlib1g-dev libusb-1.0-0-dev libgtk2.0-dev libglade2-dev gettext bison flex groff texinfo xdg-utils libarchive-dev intltool
    
    Fedora 23:
    -e     dnf install git gcc gcc-c++ make pkgconfig autoconf automake libtool glib2-devel zlib-devel libusb1-devel gtk2-devel libglade2-devel gettext bison flex groff texinfo xdg-utils libarchive-devel intltool xz
    
    CentOS 7:
    -e     yum install git gcc gcc-c++ make pkgconfig autoconf automake libtool glib2-devel zlib-devel libusb1-devel gtk2-devel libglade2-devel gettext bison flex groff texinfo xdg-utils libarchive-devel intltool xz
    
    OpenSUSE 42.1:
    -e     zypper install git gcc gcc-c++ make pkg-config autoconf automake libtool glib2-devel zlib-devel libusb-1_0-devel gtk2-devel libglade2-devel gettext-tools bison flex groff texinfo xdg-utils libarchive-devel intltool xz
    
    Alpine 3.3:
    -e     apk add git gcc g++ make pkgconfig autoconf automake libtool glib-dev zlib-dev libusb-dev gtk+-dev libglade-dev gettext-dev bison flex groff texinfo xdg-utils libarchive-dev intltool xz
    
    Arch Linux 2015.06.01 + upgrades:
    -e     pacman -S git gcc make pkgconfig autoconf automake libtool glib2 zlib libusb gtk2 libglade gettext bison flex groff texinfo xdg-utils libarchive intltool xz
    
    MacOS X:
    -e     brew install gettext libarchive autoconf automake libtool glib lzlib libusb gtk+ libglade sdl bison flex texinfo intltool
    -e     brew link --force libarchive gettext (you can use 'brew unlink' later).
    -e Otherwise, either the build will fail, or the system may not use the just-built version (e.g. if you didn't purge the distro packages) !
    -e ENTER to proceed, CTRL + C to abort.
    
    Creating output folder if necessary
    Performing a quick rough sanity check on compilers
    Hello World !
    CC=gcc exists and is not totally broken
    Hello World !
    CXX=g++ exists and is not totally broken
    Checking whether /usr/local can be written to
    === Downloading tilibs ===
    Updating tilibs
    Already up-to-date.
    === Downloading tilp_and_gfm ===
    Updating tilp_and_gfm
    Already up-to-date.
    === libticonv ===
    Configuring tilibs/libticonv
    autoreconf: Entering directory `.'
    autoreconf: configure.ac: not using Gettext
    autoreconf: running: aclocal --force -I m4
    autoreconf: configure.ac: tracing
    autoreconf: running: glibtoolize --copy --force
    /usr/local/bin/glibtoolize: line 406: /usr/local/Library/ENV/4.3/sed: No such file or directory
    /usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
    /usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
    /usr/local/bin/glibtoolize: line 3601: /usr/local/Library/ENV/4.3/sed: No such file or directory
    /usr/local/bin/glibtoolize: line 3845: /usr/local/Library/ENV/4.3/sed: No such file or directory
    /usr/local/bin/glibtoolize: line 861: /usr/local/Library/ENV/4.3/sed: No such file or directory
    : putting auxiliary files in '.'.
    : copying file './ltmain.sh'
    /usr/local/bin/glibtoolize: line 3771: /usr/local/Library/ENV/4.3/sed: No such file or directory
    autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force
    autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoheader --force
    autoreconf: running: automake --add-missing --copy --force-missing
    configure.ac:45: installing './compile'
    configure.ac:24: installing './missing'
    src/Makefile.am: installing './depcomp'
    autoreconf: Leaving directory `.'
    configure: WARNING: unrecognized options: --enable-iconv
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... ./install-sh -c -d
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking build system type... x86_64-apple-darwin15.6.0
    checking host system type... x86_64-apple-darwin15.6.0
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for fgrep... /usr/bin/grep -F
    checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 196608
    checking how to convert x86_64-apple-darwin15.6.0 file names to x86_64-apple-darwin15.6.0 format... func_convert_file_noop
    checking how to convert x86_64-apple-darwin15.6.0 file names to toolchain format... func_convert_file_noop
    checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... dlltool
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... no
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    checking for mt... no
    checking if : is a manifest tool... no
    checking for dsymutil... dsymutil
    checking for nmedit... nmedit
    checking for lipo... lipo
    checking for otool... otool
    checking for otool64... no
    checking for -single_module linker flag... yes
    checking for -exported_symbols_list linker flag... yes
    checking for -force_load linker flag... yes
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... yes
    checking for gcc option to produce PIC... -fno-common -DPIC
    checking if gcc PIC flag -fno-common -DPIC works... yes
    checking if gcc static flag -static works... no
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin15.6.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking whether gcc understands -c and -o together... (cached) yes
    checking dependency style of gcc... (cached) gcc3
    checking whether make sets $(MAKE)... (cached) yes
    checking whether ln -s works... yes
    checking for library containing strerror... none required
    checking for gawk... (cached) awk
    checking for tfdocgen... no
    checking for windres... no
    checking for pkg-config... /usr/local/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for GLIB... yes
    checking for ANSI C header files... (cached) yes
    checking for inttypes.h... (cached) yes
    checking for stdint.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for an ANSI C-conforming const... yes
    checking for C/C++ restrict keyword... __restrict
    checking for size_t... yes
    checking whether struct tm is in sys/time.h or time.h... time.h
    checking whether gcc needs -traditional... no
    checking whether lstat correctly handles trailing slash... no
    checking whether stat accepts an empty string... no
    checking for memset... yes
    checking for strcasecmp... yes
    checking for strchr... yes
    checking for strdup... yes
    checking for strrchr... yes
    checking whether gcc accepts -fvisibility... -fvisibility=hidden
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating build/mingw/Makefile
    config.status: creating docs/Makefile
    config.status: creating src/Makefile
    config.status: creating tests/Makefile
    config.status: creating ticonv.pc
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    config.status: executing libtool commands
    configure: WARNING: unrecognized options: --enable-iconv
    Now, you can type 'make' and 'make install'.
    Building tilibs/libticonv
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
    Making all in build/mingw
    make[2]: Nothing to be done for `all'.
    Making all in src
    /bin/sh ../libtool  --tag=CC   --mode=link gcc -Wall -g -O2 -D__LINUX__ -fvisibility=hidden -no-undefined -version-info 9:4:0   -o libticonv.la -rpath /usr/local/lib libticonv_la-ticonv.lo libticonv_la-charset.lo libticonv_la-tokens.lo libticonv_la-filename.lo libticonv_la-type2str.lo libticonv_la-iconv.lo -L/usr/local/Cellar/glib/2.52.3/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation  
    libtool: link: gcc -dynamiclib  -o .libs/libticonv.9.dylib  .libs/libticonv_la-ticonv.o .libs/libticonv_la-charset.o .libs/libticonv_la-tokens.o .libs/libticonv_la-filename.o .libs/libticonv_la-type2str.o .libs/libticonv_la-iconv.o   -L/usr/local/Cellar/glib/2.52.3/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl  -g -O2 -Wl,-framework -Wl,CoreFoundation   -install_name  /usr/local/lib/libticonv.9.dylib -compatibility_version 10 -current_version 10.4 -Wl,-single_module
    Undefined symbols for architecture x86_64:
      "_iconv", referenced from:
          _ticonv_iconv in libticonv_la-iconv.o
         (maybe you meant: _ticonv_iconv_close, _ticonv_iconv_open , _ticonv_iconv )
      "_iconv_close", referenced from:
          _ticonv_iconv_close in libticonv_la-iconv.o
         (maybe you meant: _ticonv_iconv_close)
      "_iconv_open", referenced from:
          _ticonv_iconv_open in libticonv_la-iconv.o
         (maybe you meant: _ticonv_iconv_open)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [libticonv.la] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    

    This is equivalent to the results I have gotten when building by hand.

     
  • Lionel Debroux

    Lionel Debroux - 2017-08-31

    Actually, Adriweb had to patch libticonv for it to build on MacOS X as well, and both of us forgot about it...

    Try applying his fix https://usercontent.irccloud-cdn.com/file/ArsFNPV7/0001-libticonv-Fix-build-on-macOS.patch , using patch -p1. It should definitely work. When you have tested it, I can push it to master :)

     
  • Benjamin

    Benjamin - 2017-09-01

    I ran the patch and I still was getting the same error.

     
  • Adrien Bertrand

    Adrien Bertrand - 2017-09-04

    Weird, the patch has been specifically designed to solve tha tissue, and works as expected for me :(
    When you applied the patch, how did you re-build libticonv? IIRC, you can just go into the libticonv folder (in trunk/src I believe) and do autoreconf -vif && ./configure && make -j4.
    Lionel may have more info about this... Eventually the patch should be merged so the install script would be working fine on its own, though.

     
  • Benjamin

    Benjamin - 2017-09-09

    I ran the same process and it didn't work for me, maybe once it merges I can try
    it again and see if it runs any better.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.