Created attachment 402076 [details] build.log Hi, I'd like to compile llvm on armv7 board running gentoo uclibc-hardened profile, however, it fails with the error below: /var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src-.default/Release/lib/libLLVMAnalysis.a(ConstantFolding.o): In function `ConstantFoldBinaryFP(double (*)(double, double), double, double, llvm::Type*)': ConstantFolding.cpp:(.text._ZL20ConstantFoldBinaryFPPFdddEddPN4llvm4TypeE+0x4c): undefined reference to `feclearexcept' ConstantFolding.cpp:(.text._ZL20ConstantFoldBinaryFPPFdddEddPN4llvm4TypeE+0xa0): undefined reference to `feclearexcept' /var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src-.default/Release/lib/libLLVMAnalysis.a(ConstantFolding.o): In function `ConstantFoldFP(double (*)(double), double, llvm::Type*)': ConstantFolding.cpp:(.text._ZL14ConstantFoldFPPFddEdPN4llvm4TypeE+0x48): undefined reference to `feclearexcept' ConstantFolding.cpp:(.text._ZL14ConstantFoldFPPFddEdPN4llvm4TypeE+0x98): undefined reference to `feclearexcept' collect2: error: ld returned 1 exit status /var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src/Makefile.rules:1199: recipe for target '/var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src-.default/Release/lib/libLLVM-3.6.so' failed make[1]: *** [/var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src-.default/Release/lib/libLLVM-3.6.so] Error 1 make[1]: Leaving directory '/var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src-.default/tools/llvm-shlib' /var/tmp/portage/sys-devel/llvm-3.6.0/work/llvm-3.6.0.src/Makefile.rules:873: recipe for target 'all' failed make: *** [all] Error 1 This is a native compilation, no cross-compiling. Would that be some uclibc limitation? Attached is build.log file. Please find the emerge --info below: Portage 2.2.14 (python 2.7.9-final-0, hardened/linux/uclibc/arm/armv7a, gcc-4.8.3, uclibc-0.9.33.2-r14, 3.18.7-v7+ armv7l) ================================================================= System uname: Linux-3.18.7-v7+-armv7l-with-gentoo-2.2 KiB Mem: 998096 total, 591664 free KiB Swap: 15374332 total, 15373388 free Timestamp of tree: Sat, 25 Apr 2015 00:45:01 +0000 ld GNU ld (Gentoo 2.24 p1.4) 2.24 app-shells/bash: 4.2_p53 dev-lang/perl: 5.20.1-r4 dev-lang/python: 2.7.9-r1, 3.3.5-r1 dev-util/cmake: 2.8.12.2-r1 dev-util/pkgconfig: 0.28-r1 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.13.11 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.69 sys-devel/automake: 1.13.4 sys-devel/binutils: 2.24-r3 sys-devel/gcc: 4.8.3 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.4 sys-devel/make: 4.1-r1 sys-kernel/linux-headers: 3.18 (virtual/os-headers) sys-libs/uclibc: 0.9.33.2-r14 Repositories: gentoo ACCEPT_KEYWORDS="arm" ACCEPT_LICENSE="* -@EULA" CBUILD="armv7a-hardfloat-linux-uclibceabi" CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" CHOST="armv7a-hardfloat-linux-uclibceabi" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5" 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" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" USE="arm bindist cli cracklib crypt cxx dri fortran hardened iconv ipv6 modules ncurses nptl openmp pax_kernel pcre pic python readline session ssl tcpd uclibc unicode xattr zlib" 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" ELIBC="uclibc" 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" 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="dummy fbdev v4l" 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, SYNC, USE_PYTHON Any help will be appreciated. Thanks, R.
(In reply to Radoslaw Madej (radegand) from comment #0) > ConstantFolding.cpp:(.text. > _ZL20ConstantFoldBinaryFPPFdddEddPN4llvm4TypeE+0x4c): undefined reference to > `feclearexcept' A quick read of the uclibc code shows that feclearexcept has only been implemented for powerpc and i386. Its not there for the others. Run `readelf -sW /lib/libm.so.0 | grep feclearexcept` to convince yourself. On i386 you get # readelf -sW /lib/libm.so.0 | grep feclearexcept 57: 00001efd 71 FUNC GLOBAL DEFAULT 7 feclearexcept while on amd64 you get nothing. You should also get nothing for arm. BTW, bug #446080 may also be at play, but that was for llvm-3.2 and may now be absolete. However, it shouldn't be too hard to implement feclearexcept() since its just some asm to clear floating poing exceptions. If we implement it, then we should implement all its friends prototyped in fenv.h.
*** Bug 578196 has been marked as a duplicate of this bug. ***
Reassigning to uclibc maintainers. Feel free to CC us back when you need us to do anything wrt LLVM.
sys-devel/llvm-3.6.0 is not in the tree since a long time. Closing here as discussed with Anthony. Please reopen, if the bug still exists with current packages and add recent logs.