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

Hans Wennborg via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 29 01:14:21 PDT 2018


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.

 - Hans


More information about the llvm-dev mailing list