You are not logged in.

#1 2017-10-04 00:08:04

Godofgrunts
Member
Registered: 2008-11-14
Posts: 43

[SOLVED] libc++ fails to build

Log: https://hastebin.com/otupageqix.lua

When trying to build libc++ I get

clang-5.0: error: unknown argument: '-mprefer-avx128'
clang-5.0: error: unknown argument: '-mvzeroupper'


$ clang --version
clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ grep -m1 -A3 "vendor_id" /proc/cpuinfo
vendor_id    : AuthenticAMD
cpu family    : 21
model        : 2
model name    : AMD FX(tm)-8350 Eight-Core Processor

Last edited by Godofgrunts (2017-10-04 12:26:27)

Offline

#2 2017-10-04 00:27:47

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,321

Re: [SOLVED] libc++ fails to build

Your custom CFLAGS for gcc are not recognized by clang. As evidenced by the "unknown argument".

While arguably clang should strive to recognize gcc flags purely for compatibility even if they don't want to implement certain things, I would suggest you modify your makepkg.conf to have the default CFLAGS first (so your package can build), and then worry about complaining on the clang bugtracker.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-10-04 12:25:25

Godofgrunts
Member
Registered: 2008-11-14
Posts: 43

Re: [SOLVED] libc++ fails to build

Eschwartz wrote:

Your custom CFLAGS for gcc are not recognized by clang. As evidenced by the "unknown argument".

Yeah, I knew this, but it seemed like it was an issue with clang because the libc++ websites tells you to build with clang.

$ cd where-you-want-libcxx-to-live
$ # Check out llvm, libc++ and libc++abi.
$ ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
$ ``svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx``
$ ``svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi``
$ cd where-you-want-to-build
$ mkdir build && cd build
$ export CC=clang CXX=clang++
$ cmake -DLLVM_PATH=path/to/llvm \
        -DLIBCXX_CXX_ABI=libcxxabi \
        -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include \
        path/to/libcxx
$ make

But you're correct, after I changed the makepkg to say

CC=gcc CXX=g++ cmake \

It built just fine.

Last edited by Godofgrunts (2017-10-04 12:25:42)

Offline

#4 2017-10-04 15:18:15

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,321

Re: [SOLVED] libc++ fails to build

Well,  given that libc++ is one of the LLVM projects smile I'm not surprised they would suggest using clang by default. But the docs say it should work with gcc as well.

That being said, there's no reason it shouldn't work with clang, gcc CFLAGS that clang errors on are a clang bug.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB