Created attachment 267375 [details] path for which, that fixed compiling with clang Tried to build which with clang, but got the following error: DEPDIR=.deps depmode=none /bin/sh ../depcomp \ /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -O2 -pipe -c shell.c Unknown depmode none make[2]: *** [shell.o] Error 1 make[2]: *** Waiting for unfinished jobs.... Unknown depmode none make[2]: *** [tilde.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-apps/which-2.20/work/which-2.20/tilde' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/sys-apps/which-2.20/work/which-2.20' make: *** [all] Error 2 This is because depcomp script contains preprocessor call with gcc-specific flags. Here is the patch, that fixes problem.
emerge -1 which Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) sys-apps/which-2.20 * which-2.20.tar.gz RMD160 SHA1 SHA256 size ;-) ... [ ok ] * Package: sys-apps/which-2.20 * Repository: gentoo * Maintainer: base-system@gentoo.org * USE: amd64 elibc_glibc kernel_linux multilib userland_GNU * FEATURES: sandbox splitdebug >>> Unpacking source... >>> Unpacking which-2.20.tar.gz to /var/tmp/portage/sys-apps/which-2.20/work >>> Source unpacked in /var/tmp/portage/sys-apps/which-2.20/work >>> Compiling source in /var/tmp/portage/sys-apps/which-2.20/work/which-2.20 ... ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 configure: loading site script /usr/share/config.site configure: loading site script /usr/share/crossdev/include/site/linux checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for x86_64-pc-linux-gnu-gcc... /usr/bin/clang checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /usr/bin/clang accepts -g... yes checking for /usr/bin/clang option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of /usr/bin/clang... none checking for a BSD-compatible install... /usr/bin/install -c checking how to run the C preprocessor... /usr/bin/clang -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -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 minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking for xmalloc in libiberty.a... no checking for ANSI C header files... (cached) yes checking for unistd.h... (cached) yes checking for string.h... (cached) yes checking libiberty.h usability... yes checking libiberty.h presence... yes checking for libiberty.h... yes checking whether stat file-mode macros are broken... no checking for an ANSI C-conforming const... yes checking for size_t... yes checking for uid_t in sys/types.h... yes checking type of array argument to getgroups... gid_t checking for strchr... yes checking for memcpy... yes checking for getopt_long... yes checking for getcwd... yes checking for getwd... yes checking for ar... ar checking for x86_64-pc-linux-gnu-ranlib... x86_64-pc-linux-gnu-ranlib checking for stdlib.h... (cached) yes checking for memory.h... (cached) yes checking for pwd.h... (cached) yes checking for strings.h... (cached) yes checking for getpwent... yes checking for getpwnam... yes checking for getpwuid... yes checking whether programs are able to redeclare getpw functions... yes configure: creating ./config.status config.status: creating Makefile config.status: creating maintMakefile config.status: creating tilde/Makefile config.status: creating config.h config.status: executing depfiles commands make -j3 make all-recursive make[1]: Entering directory `/var/tmp/portage/sys-apps/which-2.20/work/which-2.20' Making all in tilde make[2]: Entering directory `/var/tmp/portage/sys-apps/which-2.20/work/which-2.20/tilde' source='tilde.c' object='tilde.o' libtool=no \ DEPDIR=.deps depmode=none /bin/sh ../depcomp \ /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -O2 -pipe -c tilde.c source='shell.c' object='shell.o' libtool=no \ DEPDIR=.deps depmode=none /bin/sh ../depcomp \ /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -O2 -pipe -c shell.c Unknown depmode none make[2]: *** [shell.o] Error 1 make[2]: *** Waiting for unfinished jobs.... Unknown depmode none make[2]: *** [tilde.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-apps/which-2.20/work/which-2.20/tilde' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/sys-apps/which-2.20/work/which-2.20' make: *** [all] Error 2 emake failed * ERROR: sys-apps/which-2.20 failed (compile phase): * emake failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2166: Called _eapi0_src_compile * ebuild.sh, line 625: Called _eapi2_src_compile * ebuild.sh, line 665: Called die * The specific snippet of code: * emake || die "emake failed" * * If you need support, post the output of 'emerge --info =sys-apps/which-2.20', * the complete build log and the output of 'emerge -pqv =sys-apps/which-2.20'. * The complete build log is located at '/var/tmp/portage/sys-apps/which-2.20/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-apps/which-2.20/temp/environment'. * S: '/var/tmp/portage/sys-apps/which-2.20/work/which-2.20' >>> Failed to emerge sys-apps/which-2.20, Log file: >>> '/var/tmp/portage/sys-apps/which-2.20/temp/build.log' * Messages for package sys-apps/which-2.20: * ERROR: sys-apps/which-2.20 failed (compile phase): * emake failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2166: Called _eapi0_src_compile * ebuild.sh, line 625: Called _eapi2_src_compile * ebuild.sh, line 665: Called die * The specific snippet of code: * emake || die "emake failed" * * If you need support, post the output of 'emerge --info =sys-apps/which-2.20', * the complete build log and the output of 'emerge -pqv =sys-apps/which-2.20'. * The complete build log is located at '/var/tmp/portage/sys-apps/which-2.20/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-apps/which-2.20/temp/environment'. * S: '/var/tmp/portage/sys-apps/which-2.20/work/which-2.20'
emerge --info Portage 2.1.9.44 (default/linux/amd64/10.0/desktop, gcc-4.5.2, glibc-2.13-r2, 2.6.38+ x86_64) ================================================================= System uname: Linux-2.6.38+-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7300_@_2.00GHz-with-gentoo-2.0.2 Timestamp of tree: Sat, 26 Mar 2011 12:30:01 +0000 app-shells/bash: 4.2_p8 dev-java/java-config: 1.3.7-r1, 2.1.11-r3 dev-lang/python: 2.6.6-r1, 2.7.1-r1, 3.1.3-r1 dev-util/cmake: 2.8.4 sys-apps/baselayout: 2.0.2 sys-apps/openrc: 0.8.0 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.5, 1.7.9-r1, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.21 sys-devel/gcc: 4.1.1-r3::<unknown repository>, 4.3.4, 4.4.5, 4.5.2, 4.6.0_pre9999::toolchain sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 virtual/os-headers: 2.6.38 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1 PUEL dlj-1.1 AdobeFlash-10 skype-eula LOKI-EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/distfiles" FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="C" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="ru en" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/toolchain" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acpi alsa amd64 apache2 berkdb bluetooth branding bzip2 cairo cdr cli consolekit crypt cxx dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gdu gif gpm gtk iconv intel jpeg lcms ldap libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses nls nptl nptlonly ogg opengl openmp pango pcre pdf png policykit ppds pppd python qt3support qt4 readline sdl session spell sqlite sse sse2 sse3 ssl startup-notification svg synaptics sysfs tcpd tiff truetype udev unicode usb vorbis x264 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel vesa" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
bug in clang
Indeed, the upstream bugreport is here: http://llvm.org/bugs/show_bug.cgi?id=8312 Thanks for the report! I've added your log and link to this bug upstream, if someone decides to pick it up there