emerge fails with the following error Undefined symbols for architecture x86_64: "_LSOpenCFURLRef", referenced from: cmGlobalXCodeGenerator::Open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) in libCMakeLib.a(cmGlobalXCodeGenerator.cxx.o) ld: symbol(s) not found for architecture x86_64 Reproducible: Always Steps to Reproduce: 1. update to last portage tree 2. emerge cmake Actual Results: /Users/askarbektassov/Gentoo/usr/lib/llvm/6/bin/x86_64-apple-darwin17-clang++ -march=native -O2 -pipe -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs CMakeFiles/ctest.dir/ctest.cxx.o -o ../bin/ctest libCTestLib.a libCMakeLib.a kwsys/libcmsys.a /Users/askarbektassov/Gentoo/usr/lib/libexpat.dylib /Users/askarbektassov/Gentoo/usr/lib/libz.dylib /Users/askarbektassov/Gentoo/usr/lib/libarchive.dylib ../Utilities/cmcompress/libcmcompress.a ../Utilities/cmjsoncpp/libcmjsoncpp.a /Users/askarbektassov/Gentoo/usr/lib/libuv.dylib /Users/askarbektassov/Gentoo/usr/lib/librhash.dylib -framework CoreFoundation /Users/askarbektassov/Gentoo/usr/lib/libcurl.dylib Undefined symbols for architecture x86_64: "_LSOpenCFURLRef", referenced from: cmGlobalXCodeGenerator::Open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) in libCMakeLib.a(cmGlobalXCodeGenerator.cxx.o) ld: symbol(s) not found for architecture x86_64 clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) emerge --info !!! No gcc found. You probably need to 'source /etc/profile' !!! to update the environment of this terminal and possibly !!! other terminals also. Portage 2.3.18-prefix (python 3.5.4-final-0, prefix/darwin/macos/10.13/x64, [unavailable], unavailable, 17.4.0 x86_64) ================================================================= System uname: Darwin-17.4.0-x86_64-i386-64bit Timestamp of repository gentoo_prefix: Sun, 01 Apr 2018 11:56:29 +0000 sh bash 4.3_p48-r1 app-shells/bash: 4.3_p48-r1::gentoo_prefix dev-lang/perl: 5.26.1-r2::gentoo_prefix dev-lang/python: 2.7.14::gentoo_prefix, 3.5.4::gentoo_prefix dev-util/cmake: 3.10.3::gentoo_prefix dev-util/pkgconfig: 0.29.2::gentoo_prefix sys-devel/autoconf: 2.69-r4::gentoo_prefix sys-devel/automake: 1.15.1-r2::gentoo_prefix, 1.16.1-r1::gentoo_prefix sys-devel/libtool: 2.4.6-r5::gentoo_prefix sys-devel/make: 4.2.1-r3::gentoo_prefix Repositories: gentoo_prefix location: /Users/askarbektassov/Gentoo/usr/portage sync-type: rsync sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix priority: -1000 sync-rsync-extra-opts: local location: /Users/askarbektassov/Gentoo/usr/local/portage masters: gentoo_prefix ACCEPT_KEYWORDS="~x64-macos" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-apple-darwin17" CC="x86_64-apple-darwin17-clang" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-apple-darwin17" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/terminfo" CXX="x86_64-apple-darwin17-clang++" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/Users/askarbektassov/Gentoo/usr/portage/distfiles" FCFLAGS="" FEATURES="assume-digests binpkg-logs case-insensitive-fs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync multilib-strict news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LDFLAGS="-Wl,-dead_strip_dylibs" MAKEOPTS="-j5" PKGDIR="/Users/askarbektassov/Gentoo/usr/portage/packages" PORTAGE_CONFIGROOT="/Users/askarbektassov/Gentoo/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/Users/askarbektassov/Gentoo/var/tmp" USE="aqua coreaudio cxx ipv6 modules ncurses nls objc objc++ prefix prefix-guest readline ssl unicode x64-macos zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby24" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
@kde: is applying this change acceptible to you? Thanks @@ -123,6 +124,12 @@ cmake_src_test() { src_prepare() { cmake-utils_src_prepare + # disable Xcode hooks, bug #652134 + if [[ ${CHOST} == *-darwin* ]] ; then + sed -i -e 's/__APPLE__/__DISABLED_APPLE__/' \ + Source/cmGlobalXCodeGenerator.cxx || die + fi + # Add gcc libs to the default link paths sed -i \ -e "s|@GENTOO_PORTAGE_GCCLIBDIR@|${EPREFIX}/usr/${CHOST}/lib/|g" \
I confirm clang compiles well now. Thanks Fabian.
(In reply to Askar Bektassov from comment #2) > I confirm clang compiles well now. Thanks Fabian. Sorry i meant cmake
@kde team: please approve the fix from comment #1, this is broken on macOS systems, cmake is necessary for Clang, the main compiler on macOS. Thanks!
The problem still exists on dev-util/cmake-3.11.1, although the issue can be promptly solved with the fix proposed by Fabian.
(In reply to Fabian Groffen from comment #4) > @kde team: please approve the fix from comment #1, this is broken on macOS > systems, cmake is necessary for Clang, the main compiler on macOS. Thanks! Sure, feel free to push your fix.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72555480840ef0b506dceb74b92c7405fb225faf commit 72555480840ef0b506dceb74b92c7405fb225faf Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2018-04-25 17:03:44 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2018-04-25 17:03:44 +0000 dev-util/cmake: fix compilation on Darwin, bug #652134 Closes: https://bugs.gentoo.org/652134 Package-Manager: Portage-2.3.24, Repoman-2.3.6 dev-util/cmake/cmake-3.11.0.ebuild | 9 ++++++++- dev-util/cmake/cmake-3.11.1.ebuild | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-)
Is the workaround still needed in more recent CMake versions?
(In reply to Rolf Eike Beer from comment #8) > Is the workaround still needed in more recent CMake versions? https://github.com/Kitware/CMake/blob/master/Source/cmGlobalXCodeGenerator.cxx#L40 Yes.