Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 650506 - sys-devel/llvm-6.0.0 on arm64 - CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler "/usr/bin/aarch64-unknown-linux-gnu-gcc" is not able to compile a simple test program.
Summary: sys-devel/llvm-6.0.0 on arm64 - CMake Error at /usr/share/cmake/Modules/CMake...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
: 651514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-14 18:57 UTC by Roy Bamford
Modified: 2018-03-25 23:58 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Bamford gentoo-dev 2018-03-14 18:57:21 UTC
sys-devel/llvm-6.0.0 no longer builds on ~arm64. 
emerge says 
[ebuild   R    ] sys-devel/llvm-6.0.0:6::gentoo  USE="libffi ncurses xml -debug (-doc) -gold -libedit {-test} -xar" LLVM_TARGETS="(AArch64) BPF -AMDGPU -ARM -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -X86 -XCore" 0 KiB
So it has worked.

The -- Check for working C compiler fails.

-- Found assembler: /usr/bin/aarch64-unknown-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-unknown-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-unknown-linux-gnu-gcc -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/usr/bin/aarch64-unknown-linux-gnu-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /var/tmp/portage/sys-devel/llvm-6.0.0/work/llvm-6.0.0.src-.arm64/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/ninja" "cmTC_383d6"
    [1/2] Building C object CMakeFiles/cmTC_383d6.dir/testCCompiler.c.o
    FAILED: CMakeFiles/cmTC_383d6.dir/testCCompiler.c.o 
    /usr/bin/aarch64-unknown-linux-gnu-gcc    -DNDEBUG -mcpu=cortex-a53+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer -mno-bmi -o CMakeFiles/cmTC_383d6.dir/testCCompiler.c.o -c testCCompiler.c
    aarch64-unknown-linux-gnu-gcc: error: unrecognized command line option '-mno-bmi'; did you mean '-Wno-abi'?
    ninja: build stopped: subcommand failed.
Comment 1 Roy Bamford gentoo-dev 2018-03-14 18:59:22 UTC
Missed emerge --info.  Sorry about that.

neddy_test1 arm64-build / # emerge --info llvm
Portage 2.3.24 (python 2.7.14-final-0, default/linux/arm64/17.0/desktop, gcc-7.3.0, glibc-2.26-r6, 4.9.0-4-arm64 aarch64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.9.0-4-arm64-aarch64-with-gentoo-2.4.1
KiB Mem:   131544964 total,  79669980 free
KiB Swap:    3321056 total,   3321056 free
Timestamp of repository gentoo: Wed, 14 Mar 2018 17:45:01 +0000
Head commit of repository gentoo: 04417076a13a10d172b6e00d22f04ffa128eae38
sh bash 4.4_p19
ld GNU gold (Gentoo 2.30 p1 2.30.0) 1.15
distcc 3.2rc1 aarch64-unknown-linux-gnu [disabled]
app-shells/bash:          4.4_p19::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r2::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.10.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.35.3::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo, 2.30::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo, 7.3.0-r1::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r2::gentoo
sys-kernel/linux-headers: 4.15::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.namerica.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: no
    sync-rsync-extra-opts: 

Pi_aarch64
    location: /usr/local/last_out_of_the_past
    masters: gentoo

mrueg
    location: /var/lib/layman/mrueg
    masters: gentoo
    priority: 50

palemoon
    location: /var/lib/layman/palemoon
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="* -@EULA FraunhoferFDK"
CBUILD="aarch64-unknown-linux-gnu"
CFLAGS="-mcpu=cortex-a53+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"
CHOST="aarch64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/qmail/alias /var/qmail/control"
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="-mcpu=cortex-a53+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
FCFLAGS="-O2"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2"
GENTOO_MIRRORS="http://ftp.heanet.ie/pub/gentoo/                  http://mirror.mdfnet.se/gentoo                  http://mirrors.163.com/gentoo/                  http://gentoo.mirror.web4u.cz/                  http://64.50.236.52/                  http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/                  http://gentoo.mneisen.org/                  http://gentoo.mirror.pw.edu.pl/                  http://gentoo.prz.rzeszow.pl                  http://mirror.mdfnet.se/mirror/gentoo                  http://ftp.gentoo.bg/                  http://distfiles.gentoo.bg/                  http://mirrors.ludost.net/gentoo/                  http://mirror.hamakor.org.il/pub/mirrors/gentoo/                  http://ftp.dei.uc.pt/pub/linux/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--fix-cortex-a53-843419 -Wl,--fix-cortex-a53-835769 -Wl,--no-map-whole-files"
LINGUAS="en en_GB"
MAKEOPTS="-j50"
PKGDIR="/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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa arm64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdnav dvdr eds egl emboss encode exif fam flac fortran gdbm gif glamor gles1 gles2 gnome-keyring gpm gtk iconv icu ipv6 jpeg lcms libnotify mad minizip mng modules mp3 mp4 mpeg multilib ncurses nls nptl nss ogg opengl openmp openssl pango pcre pcre16 pdf pie png policykit postproc ppds python qt3support qt5 readline script seccomp skia spell sqlite ssl ssp startup-notification svc svg tcpd threads tiff truetype udev udisks unicode upower usb virt-network vorbis wxwidgets x264 xattr xcb xml xv xvid xvmc 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 crc32 v4 v5 v6 v7 v8 thumb2" ELIBC="glibc" 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="evdev" KERNEL="linux" L10N="en en-GB" 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="ruby21 ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="fbdev vc4" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-devel/llvm-5.0.1::gentoo was built with the following:
USE="libffi ncurses -debug (-doc) -gold -libedit -test" LLVM_TARGETS="(AArch64) BPF -AMDGPU -ARM -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -X86 -XCore"


sys-devel/llvm-6.0.0::gentoo was built with the following:
USE="libffi ncurses xml -debug (-doc) -gold -libedit -test -xar" LLVM_TARGETS="(AArch64) BPF -AMDGPU -ARM -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -X86 -XCore"

neddy_test1 arm64-build / #
Comment 2 Alexey Korepanov 2018-03-15 22:03:38 UTC
I am affected, in a very similar setup.
Comment 3 Yourpleasure 2018-03-17 07:48:18 UTC
in file "llvm-6.0.0.ebuild", it said that
    # workaround BMI bug in gcc-7 (fixed in 7.4)
    # https://bugs.gentoo.org/649880
    if tc-is-gcc && [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]; then
        local CFLAGS="${CFLAGS} -mno-bmi"
        local CXXFLAGS="${CXXFLAGS} -mno-bmi"
    fi
I think this might be the program.
I will remove those lines and have a test.
Comment 4 Yourpleasure 2018-03-17 15:50:53 UTC
When remove those lines, I can emerge llvm now. But I don't know whether there is something wrong with it.
Comment 5 Roy Bamford gentoo-dev 2018-03-22 15:18:55 UTC
        # workaround BMI bug in gcc-7 (fixed in 7.4)
        # https://bugs.gentoo.org/649880
        if tc-is-gcc && [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]; then
                local CFLAGS="${CFLAGS} -mno-bmi"
                local CXXFLAGS="${CXXFLAGS} -mno-bmi"
        fi

From man gcc, the -mbmi or-mno-bmi option appears to be x86 specific, so this fix should only be applied to amd64.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-23 09:06:23 UTC
Yeah, I'll fix that. Thanks for reporting.
Comment 7 Larry the Git Cow gentoo-dev 2018-03-23 09:36:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea7b6929b52c6571eadd5d6fd6fb3f8e266a3e1e

commit ea7b6929b52c6571eadd5d6fd6fb3f8e266a3e1e
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2018-03-23 09:20:54 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-03-23 09:35:54 +0000

    sys-devel/llvm: Apply -fno-bmi only on x86 arches
    
    Closes: https://bugs.gentoo.org/650506

 sys-devel/llvm/llvm-6.0.0.ebuild    | 5 ++++-
 sys-devel/llvm/llvm-6.0.9999.ebuild | 5 ++++-
 sys-devel/llvm/llvm-9999.ebuild     | 5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)
Comment 8 Arfrever Frehtes Taifersar Arahesis 2018-03-25 23:58:02 UTC
*** Bug 651514 has been marked as a duplicate of this bug. ***