Summary: | compiling llvm-9999 with USE=clang results in failure with libcompiler_rt.a: No such file or directory | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mark <mark.morschhaeuser> |
Component: | [OLD] Development | Assignee: | Bernard Cafarelli <voyageur> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ansla80, bug, daniel, darkbasic, klaus818, mgorny, mike, ormaaj, robink, wielkiegie |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=456322 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build log
environment file build.log.gz Example of working ebuild llvm-9999 ebuild using cmake ebuild with cmake options llvm-9999 ebuild using cmake with ffi (but no lib32 .so's) llvm-9999 ebuild using cmake with ffi and lib32 .so's llvm-9999 ebuild using cmake with ffi, lib32 .so's and correct output of llvm-config --libdir llvm-9999 ebuild using cmake additionally with LLVM_ENABLE_RTTI=1 |
Description
Mark
2015-02-22 10:09:21 UTC
Created attachment 397192 [details]
build log
Created attachment 397194 [details]
environment file
(In reply to mark from comment #1) > Created attachment 397192 [details] > build log Your build.log in build.log.gz is already gzip compressed.So it is double compressed. The same for your environment file. joerg@bastellinux ~ $ gunzip -v /tmp/build.log.gz /tmp/build.log.gz: 2.5% -- replaced with /tmp/build.log joerg@bastellinux ~ $ file /tmp/build.log /tmp/build.log: gzip compressed data, was "build.log", last modified: Sun Feb 22 11:07:38 2015, from Unix joerg@bastellinux ~ $ cd /tmp/ joerg@bastellinux /tmp $ mv build.log build.log.gz joerg@bastellinux /tmp $ gunzip -v /tmp/build.log.gz /tmp/build.log.gz: 96.7% -- replaced with /tmp/build.log joerg@bastellinux /tmp $ file /tmp/build.log /tmp/build.log: UTF-8 Unicode text, with very long lines, with escape sequences Created attachment 397292 [details]
build.log.gz
Same here since a few weeks.
~ # emerge --info Portage 2.2.17 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.9.2, glibc-2.19-r1, 3.19.0-rc5drm-next-3.20 x86_64) ================================================================= System uname: Linux-3.19.0-rc5drm-next-3.20-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2 KiB Mem: 16317184 total, 5232700 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Sun, 22 Feb 2015 17:00:01 +0000 sh bash 4.2_p53 ld ld di GNU (Gentoo 2.24 p1.4) 2.24 app-shells/bash: 4.2_p53::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.20.1-r4::gentoo dev-lang/python: 2.7.9-r1::gentoo, 3.3.5-r1::gentoo, 3.4.1::gentoo dev-util/cmake: 2.8.12.2-r1::gentoo dev-util/pkgconfig: 0.28-r1::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.13.11::gentoo sys-apps/sandbox: 2.6-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69::gentoo sys-devel/automake: 1.11.6-r1::gentoo, 1.13.4::gentoo sys-devel/binutils: 2.24-r3::gentoo sys-devel/gcc: 4.9.2::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.4::gentoo sys-devel/make: 4.0-r1::gentoo sys-kernel/linux-headers: 3.16::gentoo (virtual/os-headers) sys-libs/glibc: 2.19-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 wine-d3dstream location: /var/lib/layman/wine-d3dstream masters: gentoo priority: 0 x11 location: /var/lib/layman/x11 masters: gentoo priority: 1 kde location: /var/lib/layman/kde masters: gentoo priority: 2 mrueg location: /var/lib/layman/mrueg masters: gentoo priority: 3 multimedia location: /var/lib/layman/multimedia masters: gentoo priority: 4 steam-overlay location: /var/lib/layman/steam masters: gentoo priority: 5 wine location: /var/lib/layman/wine masters: gentoo priority: 6 wine-nine location: /var/lib/layman/wine-nine masters: gentoo priority: 7 qt location: /var/lib/layman/qt masters: gentoo priority: 8 ixit location: /var/lib/layman/ixit masters: gentoo priority: 9 games-overlay location: /var/lib/layman/games-overlay masters: gentoo priority: 10 java location: /var/lib/layman/java masters: gentoo priority: 11 darkbasic location: /usr/local/portage masters: gentoo priority: 12 Installed sets: @kde-frameworks-live, @kde-plasma-live ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x PUEL google-chrome skype-4.0.0.7-copyright googleearth Intel-SDP Google-TOS AdobeAIRSDK Oracle-BCLA-JavaSE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=core-avx-i -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb /var/lib/unifi/data/system.properties" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=core-avx-i -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/" LANG="it_IT.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" 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" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth bluray branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm graphite gtk iconv ipv6 jpeg kde kipi lcms ldap libnotify lm_sensors mad mmx mng modules mp3 mp4 mpeg mtp multilib ncurses nepomuk nls nptl ogg opencl opengl openmax openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qt3support qt4 qt5 readline sdl semantic-desktop session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis wxwidgets x264 x265 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" 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" 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 arm" QEMU_USER_TARGETS="arm" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel i965 radeon radeonsi" 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, USE_PYTHON (In reply to darkbasic from comment #4) > Created attachment 397292 [details] > build.log.gz > > Same here since a few weeks. Why are both your attachments double compressed? What software do you use for the double gzipping? (Could we please keep the focus on LLVM instead of whatever might have happened to the logs?) [OT]Simply "gzip build.log".[/OT] Same here. Seems that a cp command tries to copy to a non-existing directory. # emerge --info Portage 2.2.17 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.8.4, glibc-2.20-r2, 3.17.8-gentoo-r1-bigos x86_64) ================================================================= System uname: Linux-3.17.8-gentoo-r1-bigos-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2 KiB Mem: 16281448 total, 700088 free KiB Swap: 16776188 total, 16750964 free Timestamp of repository gentoo: Sun, 22 Feb 2015 19:15:01 +0000 sh bash 4.3_p33-r1 ld GNU ld (Gentoo 2.25 p1.0) 2.25 distcc 3.2rc1 x86_64-pc-linux-gnu [disabled] app-shells/bash: 4.3_p33-r1::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.20.2::gentoo dev-lang/python: 2.7.9-r2::gentoo, 3.3.5-r1::gentoo, 3.4.1::gentoo dev-util/cmake: 3.1.0::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.13.11::gentoo sys-apps/sandbox: 2.6-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69::gentoo sys-devel/automake: 1.11.6::gentoo, 1.14.1::gentoo, 1.15::gentoo sys-devel/binutils: 2.25::gentoo sys-devel/gcc: 4.8.4::gentoo, 4.9.2::gentoo sys-devel/gcc-config: 1.8::gentoo sys-devel/libtool: 2.4.6::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 3.19::gentoo (virtual/os-headers) sys-libs/glibc: 2.20-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.pl.gentoo.org/gentoo-portage priority: -1000 BigosLocalOverlay location: /usr/local/portage masters: gentoo priority: 0 dotnet location: /var/lib/layman/dotnet masters: gentoo priority: 50 ixit location: /var/lib/layman/ixit masters: gentoo priority: 50 kde location: /var/lib/layman/kde masters: gentoo priority: 50 steam-overlay location: /var/lib/layman/steam masters: gentoo priority: 50 x11 location: /var/lib/layman/x11 masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native -fno-stack-protector" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=native -fno-stack-protector" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--jobs=8 --load-average=9.0" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs candy cgroup clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.mirror.pw.edu.pl/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j10 --load-average=10.0" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" 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" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi aes alsa amd64 avx berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdbm gif glamor gpm gstreamer gtk iconv ipv6 jpeg kde kipi lcms ldap libnotify mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl nsplugin ogg okteta opencl opengl openmp pam pango pcre pdf phonon plasma png policykit popcnt ppds pulseaudio qt3support qt4 readline sdl semantic-desktop session spell sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vdpau vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" 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" 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 sse4 sse4_1 sse4_2 avx aes popcnt" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="pl" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="radeon radeonsi intel i965" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON It starts to get annoying, is there no workaround? Seems to be related to ABI_X86="32", I only have "64" and -9999 emerges fine I was able to build llvm-9999 by disabling clang runtime on abi_x86_32 build. I had to modify llvm-9999.ebuild. Something like this in set_makeargs(): if [ $(get_libdir) = "lib32" ]; then MAKEARGS+=( CLANG_NO_RUNTIME=1 ) fi (I am not an expert on ebuilds, but this does work) I'm not sure how does it affect my system, but since it's only for 32-bit clang (and, IIUC, not clang -m32) I think it might be a safe workaround. At least mesa[abi_x86_32,opencl,...] built successfully after that. (I had to fix llvm-3.2-nodoctargz.patch first, as I said in #543536) Please can you attach your ebuild (In reply to Bigos from comment #12) > I was able to build llvm-9999 by disabling clang runtime on abi_x86_32 > build. I had to modify llvm-9999.ebuild. Something like this in > set_makeargs(): > > if [ $(get_libdir) = "lib32" ]; then I had to use the whip operator ('=~') since I think the return value of $(get_libdir) is an absolute (or relative from current directory) path. > MAKEARGS+=( > CLANG_NO_RUNTIME=1 > ) > fi > > (I am not an expert on ebuilds, but this does work) > > I'm not sure how does it affect my system, but since it's only for 32-bit > clang (and, IIUC, not clang -m32) I think it might be a safe workaround. At > least mesa[abi_x86_32,opencl,...] built successfully after that. > > (I had to fix llvm-3.2-nodoctargz.patch first, as I said in #543536) You probably want somethink like if ! multilib_is_native_abi; then (In reply to Mike Lothian from comment #15) > You probably want somethink like > > if ! multilib_is_native_abi; then Thanks! I'm still completely clueless about the new multilib eclasses, so having something that spits out a nice boolean is appreciated. I think I already tried multilib_is_native_abi to no effect. Maybe I did something wrong? Please can you attach the ebuild that you've got working to the bug - I've not managed to get you fix working on my machine Created attachment 401140 [details]
Example of working ebuild
Here is my ebuild. It's from before #543536 was fixed, so you first have to change:
epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
to
epatch "${FILESDIR}"/${PN}-3.7-nodoctargz.patch
Also, it seems to disable clang runtime also in 64-bit version (I am not sure why), since I cannot build with clang using sanitizers anymore (there are no sanitizer libraries present in "equery files llvm").
Maybe just unconditionally add CLANG_NO_RUNTIME=1 to MAKEARGS and you will be done? Should fix the build, without sanitizer libraries though.
Same here with ABI_X86="32". Upstream bug: https://llvm.org/bugs/show_bug.cgi?id=23063 And probably also: https://llvm.org/bugs/show_bug.cgi?id=22661 Apparently they suggest using cmake instead of autotools for building, but that might have its own problems. Created attachment 402252 [details] llvm-9999 ebuild using cmake First: this ebuild does *NOT* yet work ! Well, I tried my luck with an ebuild using cmake - and got surprisingly far. I don't have much of an idea about writing ebuilds or how to use cmake correctly, so it might be quite wrong. But I think it get farther than the autotools ebuild, and maybe someone finds it useful. You'll need to add the patch "add_libffi_cmake_module.patch" by Alexandre Demers from Comment 4 at https://llvm.org/bugs/show_bug.cgi?id=23063#c4 to the files directory (I didn't verify if it's really necessary). As far as I can tell it fails after compiling both architectures (amd64 and x86) upon trying to install with: install: cannot stat ‘utils/vim/*.vim’: No such file or directory !!! doins: utils/vim/*.vim does not exist * ERROR: sys-devel/llvm-9999::local failed (install phase): * doins failed [...] * QA Notice: file does not exist: * * doins: utils/vim/*.vim does not exist this actually builds if doins utils/vim/*.vim is commented out. The vim files are not needed anyway unless you need syntax highlighting in vim (https://github.com/llvm-mirror/llvm/tree/master/utils/vim). But after emerging llvm with this ebuild there was a problem with compiling mesa, which uses llvm. This is a snippet of the configure log: configure:24905: checking for i686-pc-linux-gnu-llvm-config configure:24923: found /usr/bin/i686-pc-linux-gnu-llvm-config configure:24935: result: /usr/bin/i686-pc-linux-gnu-llvm-config configure:25012: x86_64-pc-linux-gnu-gcc -m32 -o conftest -march=haswell -O2 -pipe -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -Wl,-O1 -Wl,--as-needed conftest.c >&5 configure:25012: $? = 0 configure:25012: ./conftest configure:25012: $? = 0 configure:25016: x86_64-pc-linux-gnu-gcc -m32 -o conftest -march=haswell -O2 -pipe -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -Wl,-O1 -Wl,--as-needed conftest.c >&5 configure:25016: $? = 0 configure:25016: ./conftest configure:25016: $? = 0 configure:25604: checking for RADEON configure:25689: result: yes configure:25401: checking for RADEON configure:25486: result: yes configure:25498: checking for RADEON configure:25583: result: yes configure:25929: error: Could not find llvm shared libraries: Please make sure you have built llvm with the --enable-shared option and that your llvm libraries are installed in /usr/ If you have installed your llvm libraries to a different directory you can use the --with-llvm-prefix= configure flag to specify this directory. NOTE: Mesa is attempting to use llvm shared libraries by default. If you do not want to build with llvm shared libraries and instead want to use llvm static libraries then add --disable-llvm-shared-libs to your configure invocation and rebuild. Could be another problem though. (In reply to mark from comment #22) > this actually builds if doins utils/vim/*.vim is commented out. > The vim files are not needed anyway unless you need syntax highlighting in > vim (https://github.com/llvm-mirror/llvm/tree/master/utils/vim). > > But after emerging llvm with this ebuild there was a problem with compiling > mesa, which uses llvm. This is a snippet of the configure log: Yes, the ebuild I posted earlier is actually pretty broken, it doesn't respect useflags or other requirements at all, but just uses the defaults. I learned today that the configuration has to be done quite differently if using cmake (compared to autotools). The difficult thing will be to translate the autotools configuration options (--enable-xyz) into cmake options (-DLLVM_XYZ=?). There is some documentation in the llvm-source in the docs directory and looking into some kde ebuilds might help, since they also use cmake. Maybe I'll try to improve the cmake ebuild in the coming days, not sure I'll find the time though. Created attachment 402894 [details] ebuild with cmake options I used the ebuild from above and replaced the configure stuff with cmake options (see http://llvm.org/docs/CMake.html, https://devmanual.gentoo.org/eclass-reference/cmake-utils.eclass/). The ebuild creates a working llvm+clang (I compiled a small C program with it and it worked) but there are still some problems: - there are not flags for everything (like gold and ncurses); someone who knows about all this should evaluate the options. Then the IUSE line should be changed. - somehow the libffi patch does not work anymore, so I commented libffi out, but we probably want it back - Instead of /usr/bin/clang I still remained with /usr/bin/clang-3.7, it should be figured out how to get rid of that. - mesa now has another problem during the configure phase: checking for i686-pc-linux-gnu-llvm-config... /usr/bin/i686-pc-linux-gnu-llvm-config /usr/bin/i686-pc-linux-gnu-llvm-config: error while loading shared libraries: libLLVMSupport.so.3.7: wrong ELF class: ELFCLASS64 [this message was repeated 7 times] /mnt/ramdisk/portage/media-libs/mesa-9999/work/mesa-9999/configure: line 25034: test: : integer expression expected configure: error: LLVM 3.5.0 or newer is required for opencl This could have something to do with LLVM_TARGETS_TO_BUILD or LLVM_TARGET_ARCH, but actually I have no clue how to fix this and if this has to do with the R600 target for my radeon card or not. Created attachment 403284 [details]
llvm-9999 ebuild using cmake with ffi (but no lib32 .so's)
Thanks, mark. I think I got FFI working in my ebuild. See the part with -DFFI_INCLUDE_DIR and -DFFI_LIBRARY_DIR.
I took some snippets from your ebuild, mark, cause they seemed nicer (the debug stuff and tc-is-static-only). But I also run into the same problem you discovered.
I think the cause is that the 32-bit shared libraries (.so) aren't copied to /usr/lib32 - although they're built (I can see them appearing in /var/tmp/portage/sys-devel during the 32bit build).
In the ebuild I attached with this post, there are also some things I copied from Michal's ebuild, but I'm not sure if they do anything. It's probably an evil Frankenstein of an ebuild right now :-)
Anyone got an idea why the .so's are not copied to lib32 and how to fix that ?
Created attachment 403292 [details]
llvm-9999 ebuild using cmake with ffi and lib32 .so's
With some fiddling and reading the documentation links posted by mark, I got the .so's installed now - the magic option is -DLLVM_LIBDIR_SUFFIX=32.
Unfortunately mesa-9999 still doesn't want to build, it doesn't find the libraries. Apparently the mesa ebuild uses --with-clang-libdir=/usr/lib even with 32-bit builds - I tried changing that to --with-clang-libdir="${EPREFIX}/usr/lib32" and adding --with-llvm-prefix="${EPREFIX}/usr/lib32" in the mesa ebuild, but then it still fails (apparently it can't determine LLVM's version: "configure: error: LLVM 3.4.2 or newer is required for radeonsi").
So I think the llvm-ebuild is probably better now (the results, not the ebuild itself ;-) ), but either there is still something wrong with llvm or the mesa ebuild needs to be fixed.
I think the problem might be caused by "llvm-config --libdir" returning just "/usr/" instead of "/usr/lib*" for both, 32bit and 64bit variants. By the way, probably it'd be better to use Michal's ebuild as the base for a new cmake ebuild - but I unfortunately couldn't get it working as good as the variant based on the automake ebuild. Created attachment 403506 [details]
llvm-9999 ebuild using cmake with ffi, lib32 .so's and correct output of llvm-config --libdir
It seems my suspicion was correct - with correct output by "llvm-config --libdir", mesa successfully gets through the configuration phase. The attached ebuild has that output fixed. The solution was to also set LLVM_LIBDIR, not just LLVM_LIBDIR_SUFFIX (I'm not sure if the llvm people really want it that way). Those CMake-Variables (-D-stuff in the ebuild's mycmakeargs) is used in the "BuildVariables.inc.in" file by the way.
Unfortunately mesa still doesn't build successfully, upon linking (I think) pipe_radeonsi.so it encounters some undefined references. I have a slight hope that this might be a temporary failure due to mesa not yet being able to handle the newest llvm - the next few days will probably show that. This is the output from the mesa build:
../../../../src/gallium/auxiliary/.libs/libgallium.a(lp_bld_misc.o):(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x8): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'
../../../../src/gallium/auxiliary/.libs/libgallium.a(lp_bld_misc.o):(.data.rel.ro._ZTI26DelegatingJITMemoryManager[_ZTI26DelegatingJITMemoryManager]+0x8): undefined reference to `typeinfo for llvm::RTDyldMemoryManager'
collect2: error: ld returned 1 exit status
Makefile:942: recipe for target 'pipe_swrast.la' failed
make[3]: *** [pipe_swrast.la] Error 1
make[3]: *** Waiting for unfinished jobs....
../../../../src/gallium/auxiliary/.libs/libgallium.a(lp_bld_misc.o):(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x8): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'
../../../../src/gallium/auxiliary/.libs/libgallium.a(lp_bld_misc.o):(.data.rel.ro._ZTI26DelegatingJITMemoryManager[_ZTI26DelegatingJITMemoryManager]+0x8): undefined reference to `typeinfo for llvm::RTDyldMemoryManager'
collect2: error: ld returned 1 exit status
Makefile:939: recipe for target 'pipe_radeonsi.la' failed
make[3]: *** [pipe_radeonsi.la] Error 1
make[3]: Leaving directory '/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999-abi_x86_32.x86/src/gallium/targets/pipe-loader'
Makefile:580: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999-abi_x86_32.x86/src/gallium'
Makefile:678: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999-abi_x86_32.x86/src'
Makefile:618: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
Created attachment 403634 [details] llvm-9999 ebuild using cmake additionally with LLVM_ENABLE_RTTI=1 Well, it has not been a temporary failure - mesa actually needs something called rtti built into llvm (see [0]). Adding -DLLVM_ENABLE_RTTI=1 to the ebuild worked and now mesa builds successfully :-) Yay. If you try this and still get build-errors, it might be some commits in llvm that broke the build (there were some today and last sunday at least). But the ebuild is still quite a mess, I think, and what mark said in comment #24 still holds true: someone with experience in ebuilds should clean it up, check for more options required by other packages, clean up use flags, and throw out superfluous stuff (which there is probably from the automake times). Also basing it on Michals ebuilds from the other bug (#456322) might still be a good idea. [0] https://bugs.freedesktop.org/show_bug.cgi?id=90032 (In reply to Konstantin M from comment #29) > Created attachment 403634 [details] > llvm-9999 ebuild using cmake additionally with LLVM_ENABLE_RTTI=1 that ebuild misses a change I made in my ebuild, thus fails to build on my system: The target list must be semicolon separated, not comma separated and the targets must be case matching (R600 instead of r600). The cpp target is not known to llvm anymore. This fixes it: 307,308c307,308 < targets='host,cpp' < use video_cards_radeon && targets+=',r600' --- > targets='host' > use video_cards_radeon && targets+=';R600' 551c551,604 llvm, clang and mesa build now. My suggestion in cleaning up the ebuild is to discard everything that we don't need, like gold, ncurses, libedit. (In reply to mark from comment #30) > (In reply to Konstantin M from comment #29) > > Created attachment 403634 [details] > > llvm-9999 ebuild using cmake additionally with LLVM_ENABLE_RTTI=1 > > that ebuild misses a change I made in my ebuild, thus fails to build on my > system: > The target list must be semicolon separated, not comma separated and the > targets must be case matching (R600 instead of r600). The cpp target is not > known to llvm anymore. > > This fixes it: > > 307,308c307,308 > < targets='host,cpp' > < use video_cards_radeon && targets+=',r600' > --- > > targets='host' > > use video_cards_radeon && targets+=';R600' > 551c551,604 > > llvm, clang and mesa build now. > > My suggestion in cleaning up the ebuild is to discard everything that we > don't need, like gold, ncurses, libedit. Hi Mark & Konstantin- With both your modification to Konstantin's last ebuild and Konstantin's (most recent) ebuild unmodified, llvm fails to merge with: /usr/lib32/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local': /var/tmp/portage/sys-libs/glibc-2.21/work/glibc-2.21/debug/stack_chk_fail_local.c:45: undefined reference to `__stack_chk_fail' collect2: error: ld returned 1 exit status make[2]: *** [lib32/libLLVMMipsDisassembler.so.3.7.0svn] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-devel/llvm-9999-r1/work/llvm-9999-abi_x86_32.x86' make[1]: *** [lib/Target/Mips/Disassembler/CMakeFiles/LLVMMipsDisassembler.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... I've tried both GCC 5.1.0 and 4.9.2 (could try 4.8.4 but am guessing it would result in the same error). Is this a GCC issue, a GLIBC issue, or a bug in (or hit by) LLVM? Both the build log and my emerge --info are below. -Robin K. Build log: http://rgcs.creosotehill.org/gentoo/logs/build/sys-devel/llvm-9999-r1/2015052701/build.log.xz http://rgcs.creosotehill.org/gentoo/logs/build/sys-devel/llvm-9999-r1/2015052701/build.log.gz Portage info (from emerge --info): http://rgcs.creosotehill.org/gentoo/emergeinfo/emily/emerge_info_2015052701.txt I confirm it doesn't compile :( n/m, fixed by upgrading to binutils 2.25 cmake-based llvm-9999 is now in tree :) (see mgorny's work in #456322) Don't hesitate to open new bugreports if you hit problems with it It installs a wrong symlink to clang: ~ # ls -l /usr/bin/clang lrwxrwxrwx 1 root root 25 13 giu 03.24 /usr/bin/clang -> x86_64-pc-linux-gnu-clang ~ # ls -l /usr/bin/x86_64-pc-linux-gnu-clang lrwxrwxrwx 1 root root 30 13 giu 03.24 /usr/bin/x86_64-pc-linux-gnu-clang -> x86_64-pc-linux-gnu-clang-9999 ~ # ls -l /usr/bin/x86_64-pc-linux-gnu-clang-9999 lrwxrwxrwx 1 root root 29 13 giu 03.24 /usr/bin/x86_64-pc-linux-gnu-clang-9999 -> x86_64-pc-linux-gnu-clang-3.7 ~ # ls -l /usr/bin/x86_64-pc-linux-gnu-clang-3.7 ls: impossibile accedere a /usr/bin/x86_64-pc-linux-gnu-clang-3.7: File o directory non esistente Sorry, I was building the wrong ebuild: the symlink is fine. Anyway llvm renamed the R600 target to AMDGPU, so you should fix it: see http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d35eef326e49cc8da50879d30a1c5088d4775e1 and https://github.com/llvm-mirror/llvm/commit/953c6814730951ad9a286d7991e9c8c481433d45 Updated. |