Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 608984 - sys-devel/llvm-3.9.1-r1: FAILED: .../work/llvm-3.9.1.src-abi_x86_32.x86/bin/llvm-tblgen -gen-attrs [...] .../work/llvm-3.9.1.src/include/llvm/IR/Attributes.td -o .../work/llvm-3.9.1.src-abi_x86_32.x86/include/llvm/IR/Attributes.inc.tmp
Summary: sys-devel/llvm-3.9.1-r1: FAILED: .../work/llvm-3.9.1.src-abi_x86_32.x86/bin/l...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-11 18:10 UTC by George Diamantopoulos
Modified: 2018-03-29 08:24 UTC (History)
2 users (show)

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


Attachments
emerge --info output (emerge-info.txt,6.05 KB, text/plain)
2017-02-11 18:10 UTC, George Diamantopoulos
Details
llvm-3.9.1-r1-build.log (llvm-3.9.1-r1-build.log,185.16 KB, text/plain)
2017-02-11 18:11 UTC, George Diamantopoulos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description George Diamantopoulos 2017-02-11 18:10:55 UTC
Created attachment 463326 [details]
emerge --info output

I've been getting failures when emerging llvm-3.9.1-r1 for a few weeks now. I can't really say what's to blame because error descriptions are not very helpful (at least to me). The only failure-related output I was able to find is:

[146/3151] cd /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src-abi_x86_32.x86/include/llvm/IR && /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src-abi_x86_32.x86/bin/llvm-tblgen -gen-attrs -I /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include/llvm/IR -I /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/lib/Target -I /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include/llvm/IR/Attributes.td -o /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src-abi_x86_32.x86/include/llvm/IR/Attributes.inc.tmp
FAILED: include/llvm/IR/Attributes.inc.tmp 
cd /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src-abi_x86_32.x86/include/llvm/IR && /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src-abi_x86_32.x86/bin/llvm-tblgen -gen-attrs -I /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include/llvm/IR -I /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/lib/Target -I /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include/llvm/IR/Attributes.td -o /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src-abi_x86_32.x86/include/llvm/IR/Attributes.inc.tmp
[147/3151] /usr/bin/x86_64-pc-linux-gnu-g++ -m32 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/MC -I/var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/lib/MC -Iinclude -I/var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include  -DNDEBUG -march=skylake -O2 -pipe -fno-delete-null-pointer-checks -flifetime-dse=1 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -fPIC -MD -MT lib/MC/CMakeFiles/LLVMMC.dir/MCAsmBackend.cpp.o -MF lib/MC/CMakeFiles/LLVMMC.dir/MCAsmBackend.cpp.o.d -o lib/MC/CMakeFiles/LLVMMC.dir/MCAsmBackend.cpp.o -c /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/lib/MC/MCAsmBackend.cpp
[148/3151] /usr/bin/x86_64-pc-linux-gnu-g++ -m32 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/MC -I/var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/lib/MC -Iinclude -I/var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/include  -DNDEBUG -march=skylake -O2 -pipe -fno-delete-null-pointer-checks -flifetime-dse=1 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -fPIC -MD -MT lib/MC/CMakeFiles/LLVMMC.dir/ELFObjectWriter.cpp.o -MF lib/MC/CMakeFiles/LLVMMC.dir/ELFObjectWriter.cpp.o.d -o lib/MC/CMakeFiles/LLVMMC.dir/ELFObjectWriter.cpp.o -c /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/lib/MC/ELFObjectWriter.cpp
ninja: build stopped: subcommand failed.

I'm attaching emerge-info and build log.
Comment 1 George Diamantopoulos 2017-02-11 18:11:39 UTC
Created attachment 463328 [details]
llvm-3.9.1-r1-build.log
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-02-12 08:48:10 UTC
My immediate guess was gcc-6.3.0 being the problem but I can't reproduce with it either. Could you try seeing if dmesg has anything? Like invalid opcodes? Alternatively, could you run the tablegen command by hand and see what code it exits with? Possibly strace it.
Comment 3 Eric Siegel 2017-05-31 04:49:03 UTC
I'm having this same issue with sys-devel/llvm-4.0.0-r2:

/bin/sh: line 1: 13892 Segmentation fault      /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/llvm-tblgen -gen-attrs -I /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include/llvm/IR -I /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include/llvm/IR/Attributes.td -o /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/include/llvm/IR/Attributes.gen.tmp

This was with gcc 6.3.0, though gcc 5.4.0 and even clang 4.0.0 seemed to give the same issue.

I tried running the above command via gdb and saw the following:

(gdb) run -gen-attrs -I /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include/llvm/IR -I /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include/llvm/IR/Attributes.td -o /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/include/llvm/IR/Attributes.gen.tmp

Starting program: /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/llvm-tblgen -gen-attrs -I /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include/llvm/IR -I /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src/include/llvm/IR/Attributes.td -o /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/include/llvm/IR/Attributes.gen.tmp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) info stack
#0  0x00000000 in ?? ()
#1  0xf79c30c3 in ?? () from /usr/lib32/libz.so.1
#2  0xf7fe9aa2 in ?? () from /lib/ld-linux.so.2
#3  0xf7a81313 in ?? () from /lib32/libc.so.6
#4  0xf7a8136f in exit () from /lib32/libc.so.6
#5  0xf7a6b4f2 in __libc_start_main () from /lib32/libc.so.6
#6  0x08050526 in _start ()

I also tried simply running llvm-tblgen --help with gdb and saw:
(gdb) run -help

Starting program: /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/llvm-tblgen -help
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
USAGE: llvm-tblgen [options] <input file>

OPTIONS:

General options:

  -I=<directory>            - Directory of include files
  -asmparsernum=<uint>      - Make -gen-asm-parser emit assembly parser #N
  -asmwriternum=<uint>      - Make -gen-asm-writer emit assembly writer #N
  -class=<class name>       - Print Enum list for this class
  -d=<filename>             - Dependency filename
  -match-prefix=<string>    - Only match instructions with the given prefix
  -o=<filename>             - Output filename
  -omit-comments            - Do not generate comments
  Action to perform:
    -print-records          - Print all records to stdout (default)
    -gen-emitter            - Generate machine code emitter
    -gen-register-info      - Generate registers and register classes info
    -gen-instr-info         - Generate instruction descriptions
    -gen-callingconv        - Generate calling convention descriptions
    -gen-asm-writer         - Generate assembly writer
    -gen-disassembler       - Generate disassembler
    -gen-pseudo-lowering    - Generate pseudo instruction lowering
    -gen-asm-matcher        - Generate assembly instruction matcher
    -gen-dag-isel           - Generate a DAG instruction selector
    -gen-dfa-packetizer     - Generate DFA Packetizer for VLIW targets
    -gen-fast-isel          - Generate a "fast" instruction selector
    -gen-subtarget          - Generate subtarget enumerations
    -gen-intrinsic          - Generate intrinsic information
    -gen-tgt-intrinsic      - Generate target intrinsic information
    -print-enums            - Print enum values for a class
    -print-sets             - Print expanded sets for testing DAG exprs
    -gen-opt-parser-defs    - Generate option definitions
    -gen-ctags              - Generate ctags-compatible index
    -gen-attrs              - Generate attributes
    -gen-searchable-tables  - Generate generic binary-searchable table
    -gen-global-isel        - Generate GlobalISel selector
  -rng-seed=<seed>          - Seed for the random number generator
  -stats                    - Enable statistics output from program (available with Asserts)
  -stats-json               - Display statistics as json data
  -warn-on-skipped-patterns - Explain why a pattern was skipped for inclusion in the GlobalISel selector

Generic Options:

  -help                     - Display available options (-help-hidden for more)
  -help-list                - Display list of available options (-help-list-hidden for more)
  -version                  - Display the version of this program

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) info stack
#0  0x00000000 in ?? ()
#1  0xf79c30c3 in ?? () from /usr/lib32/libz.so.1
#2  0xf7fe9aa2 in ?? () from /lib/ld-linux.so.2
#3  0xf7a81313 in ?? () from /lib32/libc.so.6
#4  0xf7a8136f in exit () from /lib32/libc.so.6
#5  0xf7f07f25 in (anonymous namespace)::HelpPrinter::operator=(bool) () from /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/../lib32/libLLVMSupport.so.4
#6  0xf7f084b7 in llvm::cl::opt<(anonymous namespace)::HelpPrinterWrapper, true, llvm::cl::parser<bool> >::handleOccurrence(unsigned int, llvm::StringRef, llvm::StringRef) ()
   from /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/../lib32/libLLVMSupport.so.4
#7  0xf7f006e5 in llvm::cl::Option::addOccurrence(unsigned int, llvm::StringRef, llvm::StringRef, bool) () from /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/../lib32/libLLVMSupport.so.4
#8  0xf7efd8f0 in CommaSeparateAndAddOccurrence(llvm::cl::Option*, unsigned int, llvm::StringRef, llvm::StringRef, bool) () from /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/../lib32/libLLVMSupport.so.4
#9  0xf7f005df in ProvideOption(llvm::cl::Option*, llvm::StringRef, llvm::StringRef, int, char const* const*, int&) () from /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/../lib32/libLLVMSupport.so.4
#10 0xf7f0609a in (anonymous namespace)::CommandLineParser::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, bool) ()
   from /var/tmp/portage/sys-devel/llvm-4.0.0-r2/work/llvm-4.0.0.src-abi_x86_32.x86/bin/../lib32/libLLVMSupport.so.4
#11 0x0804f99d in main ()
Comment 4 Eric Siegel 2017-05-31 04:55:20 UTC
I'm also seeing lines similar to the following in dmesg:

[7659.825264] llvm-tblgen[20906]: segfault at 0 ip (null) sp 00000000ffdaba4c error 14 in llvm-tblgen[8048000+19a000]
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-05-31 18:33:03 UTC
What's your sys-libs/zlib version and flags? Did you build it with gcc6?
Comment 6 Eric Siegel 2017-06-04 03:12:08 UTC
(In reply to Michał Górny from comment #5)
> What's your sys-libs/zlib version and flags? Did you build it with gcc6?

=sys-libs/zlib-1.2.11[minizip] with ABI_X86 of both 32 and 64.  It's actually built with clang right now.
Comment 7 Eric Siegel 2017-06-07 05:07:43 UTC
(In reply to Michał Górny from comment #5)
> What's your sys-libs/zlib version and flags? Did you build it with gcc6?

That seemed to be the issue.  I recompiled zlib with gcc6 (instead of clang) and llvm-4 compiled for me! :-D