[llvm-dev] Get full cmake lines and prepocessed source for a GCC bug report

Sedat Dilek via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 29 03:28:47 PDT 2018


On Wed, Aug 29, 2018 at 10:53 AM, Hans Wennborg <hans at chromium.org> wrote:
> On Wed, Aug 29, 2018 at 10:18 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
>> On Wed, Aug 29, 2018 at 10:14 AM, Hans Wennborg <hans at chromium.org> wrote:
>>> On Wed, Aug 29, 2018 at 9:45 AM, Sedat Dilek via llvm-dev
>>> <llvm-dev at lists.llvm.org> wrote:
>>>> Hi,
>>>>
>>>> for filing a GCC v8.2.0 bug in Debian/buster AMD64 the Debian/GCC
>>>> mainatiners want two things...
>>>>
>>>> [ FULL CMAKE LINE ]
>>>>
>>>> How do I configure this in the LLVM/Clang build?
>>>> Can I set an option of cmake?
>>>>
>>>> [ PREPROCESSED SOURCE FILES ]
>>>>
>>>> How and where do I get the preprocessed source?
>>>> Do I need to set options for this in my build-script?
>>>
>>> From your other email, when the compiler crashed, ninja printed the invocation:
>>>
>>> /usr/bin/g++-8  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE
>>> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
>>> -Ilib/Bitcode/Reader
>>> -I/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader -Iinclude
>>> -I/home/sdi/src/llvm-toolchain/llvm/include -fPIC
>>> -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra
>>> -Wno-unused-parameter -Wwrite-strings -Wcast-qual
>>> -Wno-missing-field-initializers -pedantic -Wno-long-long
>>> -Wno-maybe-uninitialized -Wno-class-memaccess
>>> -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color
>>> -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions
>>> -fno-rtti -MD -MT
>>> lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o
>>> -MF lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o.d
>>> -o lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o
>>> -c /home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
>>>
>>>
>>> To generate preprocessed source from that, you use the -E flag, so
>>> adding something like this to the end of command-line should work:
>>>
>>> -E -o /tmp/preprocessed.ii
>>>
>>>
>>> To see the internal GCC invocation, you can add the -### option to the
>>> command. The output of that, and the preprocessed source, should be
>>> enough to reproduce the bug.
>>>
>>
>> Thanks, Hans.
>>
>> I kept the build-directory of my build with my selfmade llvm-toolchain
>> v7.0.0rc2.
>>
>> So I can run this gcc-line directly?
>
> Yes, I think that should work.

[ 2nd tryout ]

sdi at iniza:~/src/llvm-toolchain$ LANG=C rm -v
build/lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o
build/lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o.d
removed 'build/lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o'
removed 'build/lib/Bitcode/Reader/CMakeFiles/LLVMBitReader.dir/MetadataLoader.cpp.o.d'

sdi at iniza:~/src/llvm-toolchain$ ./scripts/gcc-bug_preprocessed.sh
# 1 "/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.cpp"
# 10 "/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.cpp"
# 1 "/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.h" 1
In file included from
/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.cpp:10:
/home/sdi/src/llvm-toolchain/llvm/lib/Bitcode/Reader/MetadataLoader.h:17:10:
fatal error: llvm/ADT/SmallVector.h: No such file or directory
 #include "llvm/ADT/SmallVector.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

New script attached.

- Sedat -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-bug_preprocessed.sh
Type: application/x-shellscript
Size: 1085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180829/41baa656/attachment.bin>


More information about the llvm-dev mailing list