FS#48203 - [clang] crashes when compile with -Winvalid-pch
Attached to Project:
Arch Linux
Opened by Weitian Leung (timxx) - Tuesday, 16 February 2016, 09:16 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 07 May 2016, 16:33 GMT
Opened by Weitian Leung (timxx) - Tuesday, 16 February 2016, 09:16 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 07 May 2016, 16:33 GMT
|
Details
Description:
After gcc abi changed, clang isn't works well anymore. When clang compile with -Winvalid-pch flag, set -I to a long include path (24+ characters as my test), and uses lambda, call std::find_if, clang will crashes when compile. The important conditions are: - compile with -Winvalid-pch - uses Precompiled Header - -I to include a 24+ characters path (exists or not isn't that important) - call std::find_if inside lambda You can change the Makefile CFLAGS/LFLAGS from clang-bug.zip, e.g. change /usr/aaaaaaaaaaa/include to /usr/include/qt4/QtMultimedia, or remove the -stdlib=libc++ flag, clean and recompile, clang still crashes. Thus, the include path and libc++ isn't the point to crash. (But the include path still need long enough) GCC works. Another strange things is, our project can compile with debug build (-O0), but this demo pass -O0 or not take no effects. PS, only tested in x64 machine. I don't known is this Arch Linux relative or clang's bug. But before gcc abi changed, everythings works. This is so annoying with abi changed. :( Additional info: * clang 3.7.1-1 Steps to reproduce: Download the clang-bug.zip attachment, extract it. make pch && make You will see a Segmentation fault (clang.log for details). |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Saturday, 07 May 2016, 16:33 GMT
Reason for closing: Fixed
Additional comments about closing: clang 3.8.0-1
Saturday, 07 May 2016, 16:33 GMT
Reason for closing: Fixed
Additional comments about closing: clang 3.8.0-1
So this is should be a bug of Arch Linux. :(
I can't check this by myself but this may be related.
LLVM bugtracker: https://llvm.org/bugs/show_bug.cgi?id=25969#c19
Looks like http://reviews.llvm.org/D12834 (clang-3.7.0-add-gcc-abi-tag-support.patch) is buggy and unsupported, so it shouldn't be used in this package.
For gcc's attribute abi_tag, follow http://llvm.org/pr23529 instead.