Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 317467

Summary: sys-devel/clang-2.6-r3 fails to build with gcc 4.5
Product: Gentoo Linux Reporter: Zeev Tarantov <zeev.tarantov>
Component: [OLD] UnspecifiedAssignee: Bernard Cafarelli <voyageur>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 296658    
Attachments: my patch to the source

Description Zeev Tarantov 2010-04-27 12:47:35 UTC
With sys-devel/gcc-4.5.0 from portage, I've successfully built sys-devel/llvm-2.6-r2 and then clang failed with the following:

CGObjCGNU.cpp: In member function ‘virtual llvm::Function*<unnamed>::CGObjCGNU::ModuleInitFunction()’:
CGObjCGNU.cpp:1173:64: error: cannot call constructor ‘llvm::TargetData::TargetData’ directly
CGObjCGNU.cpp:1173:64: error:   for a function-style cast, remove the redundant ‘::TargetData’
CGObjCGNU.cpp: In member function ‘virtual void<unnamed>::CGObjCGNU::EmitTryOrSynchronizedStmt(clang::CodeGen::CodeGenFunction&, const clang::Stmt&)’:
CGObjCGNU.cpp:1323:64: error: cannot call constructor ‘llvm::TargetData::TargetData’ directly
CGObjCGNU.cpp:1323:64: error:   for a function-style cast, remove the redundant ‘::TargetData’
/bin/rm: cannot remove `/home/system/var_tmp_portage/portage/sys-devel/clang-2.6-r3/work/llvm-2.6/tools/clang/lib/CodeGen/Release-Asserts/CGObjCGNU.d.tmp': No such file or directory
make[3]: *** [/home/system/var_tmp_portage/portage/sys-devel/clang-2.6-r3/work/llvm-2.6/tools/clang/lib/CodeGen/Release-Asserts/CGObjCGNU.o] Error 1
make[3]: Leaving directory `/home/system/var_tmp_portage/portage/sys-devel/clang-2.6-r3/work/llvm-2.6/tools/clang/lib/CodeGen'
make[2]: *** [CodeGen/.makeall] Error 2
make[2]: *** Waiting for unfinished jobs....

The attached patch made it build. I've tested it on my own little project and the resulting clang creates working binaries. Seeing that the offending code is in llvm, I don't know why llvm built but clang didn't. I guess that part of the code is unused when building llvm itself?


Reproducible: Always




Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.5.0, glibc-2.11.1-r0, 2.6.34-rc5 x86_64)
=================================================================
System uname: Linux-2.6.34-rc5-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E6550_@_2.33GHz-with-gentoo-2.0.1
Timestamp of tree: Tue, 27 Apr 2010 10:15:01 +0000
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r1, 3.1.2-r2
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.4.3-r2, 4.5.0
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* SKYPE-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-g -O2 -pipe -march=core2 -momit-leaf-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-g -O2 -pipe -march=core2 -momit-leaf-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages installsources news parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.isoc.org.il/pub/gentoo/ "
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US"
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="/home/system/var_tmp_portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/gcc-porting /var/lib/layman/mozilla /var/lib/layman/java-overlay /var/lib/layman/toolchain /var/lib/layman/kde /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion bidi bluetooth branding bzip2 cairo cdr cli cracklib crypt cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac gif gpm gtk hal iconv ipv6 jpeg lcms libnotify lzma mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pango pch pcre pdf perl png ppds pppd python qt3support qt4 readline reflection sdl session spell spl sqlite3 sse sse2 ssl startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis x264 xcb xcomposite xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" 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 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="stv0680" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" QEMU_SOFTMMU_TARGETS="arm i386 ppc ppc64 sparc x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" SANE_BACKENDS="niash stv680" USERLAND="GNU" VIDEO_CARDS="nv nvidia nouveau" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zeev Tarantov 2010-04-27 12:48:19 UTC
Created attachment 229383 [details, diff]
my patch to the source
Comment 2 Zeev Tarantov 2010-04-27 16:54:03 UTC
The code is obviously in clang, not in llvm: the dir structure is weird because clang is compiled as a subdir of llvm.
This is fixed in version 2.7 that just entered the tree, so another solution is to just upgrade, I guess.
Comment 3 Bernard Cafarelli gentoo-dev 2010-04-27 20:21:29 UTC
Hi, thanks for the report!

Indeed, clang is built in a subtree of llvm (this was supposed to be fixed in 2.7 but...). 
Nice to see 2.7 compiles fine with gcc 4.5, as clang in 2.6 was even more "experimental", I'd consider this bug fixed with 2.7 arrival in tree, unless you had a project requiring 2.6?
Comment 4 Zeev Tarantov 2010-04-27 20:39:53 UTC
From my POV you can close this, but other people might encounter it if for example gcc 4.5 gets stabled before clang 2.7. I think my patch is harmless so I would apply it, but I'm not running this in a production environment.
Comment 5 Bernard Cafarelli gentoo-dev 2010-04-28 08:41:26 UTC
First stable version will probably be 2.7, but patch applied just in case for 2.6 :)

Thanks for the report and patch, fixed with patched 2.6 and 2.7 working fine as-is