GNOME Bugzilla – Bug 766188
Error building pkg-config: Undefined symbols for architecture x86_64: "_iconv"
Last modified: 2016-10-31 14:21:32 UTC
I am trying to build gstreamer from sources on Mac OS X 10.11.4, using Xcode 7.3.0. The build process fails with pig-config, with the following error: libtool: link: clang -I./glib -I./glib/glib -I./glib/glib -Wall -g -O2 -arch x86_64 -m64 -Wno-error=format-nonliteral -I/Library/Frameworks/GStreamer.framework/Versions/1.0/include -mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall -g -O2 -arch x86_64 -m64 -Wno-error=format-nonliteral -I/Library/Frameworks/GStreamer.framework/Versions/1.0/include -mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -headerpad_max_install_names -Wl,-headerpad_max_install_names -Wno-error=unused-command-line-argument -arch x86_64 -m64 -Wl,-arch -Wl,x86_64 -mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -headerpad_max_install_names -Wl,-headerpad_max_install_names -Wno-error=unused-command-line-argument -arch x86_64 -m64 -Wl,-arch -Wl,x86_64 -mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -o pkg-config pkg.o parse.o main.o -L/project/software/library/gstreamer/sdk/cerbero/build/build-tools/lib ./glib/glib/.libs/libglib-2.0.a -liconv -framework Foundation -framework Carbon Undefined symbols for architecture x86_64: "_iconv", referenced from: _g_iconv in libglib-2.0.a(gconvert.o) _g_convert_with_iconv in libglib-2.0.a(gconvert.o) _open_converter in libglib-2.0.a(gconvert.o) _g_convert_with_fallback in libglib-2.0.a(gconvert.o) (maybe you meant: _g_iconv_close, _g_iconv , _g_iconv_open , _g_convert_with_iconv ) "_iconv_close", referenced from: _g_iconv_close in libglib-2.0.a(gconvert.o) _close_converter in libglib-2.0.a(gconvert.o) _iconv_cache_bucket_expire in libglib-2.0.a(gconvert.o) (maybe you meant: _g_iconv_close) "_iconv_open", referenced from: _g_iconv_open in libglib-2.0.a(gconvert.o) (maybe you meant: _g_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]: *** [pkg-config] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Running command 'make -j8' ***** Error running 'bootstrap' command: Recipe 'pkg-config' failed at the build step 'compile'
I found out the reason for the error. There were a couple of environment variables set in my .profile related to MacPorts that somehow cause a conflict. I disabled my .profile file and was able to compile and bootstrap the gstreamer.
What environment variables was that? Perhaps cerbero needs to unset them for its own build?
I think it was this one: export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig I will need to reconfirm by re-running the bootstrap process, once I finish rebuilding gstreamer-1.0.
The following steps allowed me to build gstreamer-1.0 on Mac OS X 10.11.4 using Xcode-7.3.0 : 01. Completely disable MacPorts by temporarily renaming .profile to .profile_bak 02. Install CMake-3.5.3 binary from cmake.org. Set the path to cmake PATH="/Applications/CMake.app/Contents/bin":"$PATH" make is required for some packages like the vpx encoder. 03. Clone cerbero, and work from the master branch. git clone git://anongit.freedesktop.org/gstreamer/sdk/cerbero sdk/cerbero cd sdk/cerbero git checkout master 04. Edit config/osx-x86-64.cbc to have the following entries: from cerbero.config import Architecture target_arch=Architecture.X86_64 prefix='/Library/Frameworks/GStreamer.framework/Versions/1.0' recipes_commits = { 'gstreamer-1.0' : '1.8.1', 'gstreamer-1.0-static' : '1.8.1', 'gst-plugins-base-1.0' : '1.8.1', 'gst-plugins-base-1.0-static' : '1.8.1', 'gst-plugins-good-1.0' : '1.8.1', 'gst-plugins-good-1.0-static' : '1.8.1', 'gst-plugins-bad-1.0' : '1.8.1', 'gst-plugins-bad-1.0-static' : '1.8.1', 'gst-plugins-ugly-1.0' : '1.8.1', 'gst-plugins-ugly-1.0-static' : '1.8.1', 'gst-libav-1.0' : '1.8.1', 'gst-libav-1.0-static' : '1.8.1', 'gnonlin-1.0' : '1.8.1', 'gnonlin-1.0-static' : '1.8.1', 'gst-editing-services-1.0' : '1.8.1', 'gst-rtsp-server-1.0' : '1.8.1', } I had some trouble building the Universal build earlier, so I did't both to try and reproduce the issue, since it doesn't make sense to build for the i386 architecture anymore on Mac OS X 10.11.4 using Xcode 7.3.0 05. Create a file ~/.cerbero/cerbero.cbc with the following contents: import os from cerbero.config import Platform, Architecture, Distro packages_prefix = 'gstreamer-sdk' packager = 'GStreamer SDK packagers <packages@gstreamer.com>' prefix = '/Library/Frameworks/GStreamer.framework/Versions/1.0' git_root = "git://anongit.freedesktop.org/gstreamer-sdk" # Uncomment to allow parallel builds allow_parallel_build = True # Uncomment this to allow cross-building for another architecture # target_arch = Architecture.X86_64 06. Use the following commands to build gstreamer-1.0 ./cerbero-uninstalled bootstrap ./cerbero-uninstalled -c config/osx-x86-64.cbc package gstreamer-1.0
I couldn't get past building 83/88 gst-rtsp-server-1.0-static [(83/88) gst-rtsp-server-1.0-static -> configure ] -----> copying /project/software/library/gstreamer/sdk/cerbero/data/autotools/config.guess to /project/software/library/gstreamer/sdk/cerbero/build/sources/darwin_x86_64/gst-rtsp-server-1.0-static-1.9/config.guess -----> copying /project/software/library/gstreamer/sdk/cerbero/data/autotools/config.sub to /project/software/library/gstreamer/sdk/cerbero/build/sources/darwin_x86_64/gst-rtsp-server-1.0-static-1.9/config.sub configure: Requested 'gstreamer-1.0 >= 1.9.0.1' but version of GStreamer is 1.8.1 configure: error: no gstreamer-1.0 >= 1.9.0.1 (GStreamer) found Running command 'sh ./autogen.sh --noconfigure && ./configure --prefix /Library/Frameworks/GStreamer.framework/Versions/1.0 --libdir /Library/Frameworks/GStreamer.framework/Versions/1.0/lib --enable-introspection=no --disable-examples --enable-static-plugins --disable-shared --enable-static --disable-gtk-doc --disable-gtk-doc --disable-examples --enable-static --disable-maintainer-mode --disable-silent-rules --enable-introspection --build=x86_64-apple-darwin12' Recipe 'gst-rtsp-server-1.0-static' failed at the build step 'configure' How can I fix this? I am using cerbero master branch, and explicitly set config/osx-x86-64.cbc to build the version 1.8.1 commits. I added 'gst-rtsp-server-static-1.0' : '1.8.1', to the list but it still attempts to pick up v1.9.0.1. In fact, all the gst-* packages that were downloaded into build/sources/darwin_x86_64 have a *-1.9 suffix. What is the reason for this?
This looks more like a support question after making random changes to the recipe files, so this conversation should perhaps be moved to the gstreamer-devel mailing list instead?
Perhaps try to wipe everything and start from scratch, or force a rebuild of gstreamer gst-plugins-base etc.
I performed a full clean and rebuild, but same results, with or without modifications to the recipe configuration, to pin the commits to 1.8.1. I am working off cerbero master branch. I noticed that if I try to build off 1.8.1 branch, it starts to build in my home folder. The master branch supports building in the current repository folder under a build directory. (I prefer not to install stuff to my home folder). As I understood, cerbero is a build management system, and should be able to handle build of 1.8.1 from the master branch, if I pin the recipes to a specific release. Any suggestions as to how to fix this issue?
I tried with cerbero 1.8 branch, and a fresh build (which puts stuff in my home folder), but it fails at the bootstrap level. Running command 'rm -rf /Users/elvis/cerbero/sources/build-tools/orc-tool-0.4.25' [(12/18) orc-tool -> fetch ] fatal: remote origin already exists. Fetching origin fatal: ambiguous argument '0.4.25': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: The cerbero build system is broken on Mac OS X. It should be able to handle commit tags properly and reproduce a build. I've spent two days and its a bit frustrating when a build system and its meta data is unreliable.
Using the cerbero 1.8.1 tag allow me to complete the build for Mac OS X 10.11.4 using Xcode 7.3.0. The cerebro master branch and the cerebro 1.8 branch currently do not build successfully on Mac OS X 10.11.4 and Xcode 7.3.0.
There's no real difference between 1.8 branch and 1.8.1 tag unfortunately... so if the former fails and the latter works, you most likely run into some weird problem related to the build. It might work if you retry