Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yocto Warrior fails compiling #13

Closed
jens-f opened this issue Jan 8, 2020 · 10 comments
Closed

Yocto Warrior fails compiling #13

jens-f opened this issue Jan 8, 2020 · 10 comments

Comments

@jens-f
Copy link

jens-f commented Jan 8, 2020

As mentioned in #12, I was also unable to compile using Yocto Warrior.
Steps to reproduce:

repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b warrior
repo sync
git clone https://github.com/kraj/meta-clang.git sources/meta-clang -b warrior
git clone https://github.com/mirzak/meta-coral.git sources/meta-coral -b master
MACHINE=coral-dev DISTRO=fslc-wayland source ./setup-environment build
echo 'BBLAYERS += "${BSPDIR}/sources/meta-clang"' >> conf/bblayers.conf
echo 'BBLAYERS += "${BSPDIR}/sources/meta-coral"' >> conf/bblayers.conf
bitbake core-image-base

The error I'm getting is:

ERROR: clang-native-8.0.1-r0 do_compile: Function failed: do_compile (log file is located at /home/jens/coral/build/tmp/work/x86_64-linux/clang-native/8.0.1-r0/temp/log.do_compile.26644)
ERROR: Logfile of failure stored in: /home/jens/coral/build/tmp/work/x86_64-linux/clang-native/8.0.1-r0/temp/log.do_compile.26644
Log data follows:
| DEBUG: Executing shell function do_compile
| [1/2538] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Atomic.cpp.o
| [2/2538] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.o
..
.. removed 3 - 1473
..
..
| [1474/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86AvoidStoreForwardingBlocks.cpp.o
| [1475/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86FloatingPoint.cpp.o
| [1476/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86FlagsCopyLowering.cpp.o
| [1477/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86FastISel.cpp.o
| [1478/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86FrameLowering.cpp.o
| [1479/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86IndirectBranchTracking.cpp.o
| [1480/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InstructionSelector.cpp.o
| [1481/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InstrFMA3Info.cpp.o
| [1482/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelDAGToDAG.cpp.o
| FAILED: lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelDAGToDAG.cpp.o
| /home/jens/coral/build/tmp/hosttools/g++  -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/X86 -I/home/jens/coral/build/tmp/work-shared/llvm-project-source-8.0.1-r0/git/llvm/lib/Target/X86 -Iinclude -I/home/jens/coral/build/tmp/work-shared/llvm-project-source-8.0.1-r0/git/llvm/include -isystem/home/jens/coral/build/tmp/work/x86_64-linux/clang-native/8.0.1-r0/recipe-sysroot-native/usr/include -O2 -pipe   -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 -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -DNDEBUG -MD -MT lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelDAGToDAG.cpp.o -MF lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelDAGToDAG.cpp.o.d -o lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelDAGToDAG.cpp.o -c /home/jens/coral/build/tmp/work-shared/llvm-project-source-8.0.1-r0/git/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
| g++: internal compiler error: Killed (program cc1plus)
| Please submit a full bug report,
| with preprocessed source if appropriate.
| See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
| [1483/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InstrFoldTables.cpp.o
| [1484/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InsertPrefetch.cpp.o
| [1485/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InstrInfo.cpp.o
| [1486/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InterleavedAccess.cpp.o
| [1487/2538] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/jens/coral/build/tmp/work/x86_64-linux/clang-native/8.0.1-r0/temp/log.do_compile.26644)
ERROR: Task (virtual:native:/home/jens/coral/sources/meta-clang/recipes-devtools/clang/clang_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1235 tasks of which 0 didn't need to be rerun and 2 failed.
NOTE: Writing buildhistory

Summary: 2 tasks failed:
  /home/jens/coral/sources/poky/meta/recipes-core/glibc/glibc_2.29.bb:do_package_write_rpm
  virtual:native:/home/jens/coral/sources/meta-clang/recipes-devtools/clang/clang_git.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
@mirzak
Copy link
Owner

mirzak commented Jan 8, 2020

In this case you should be using,

git clone https://github.com/mirzak/meta-coral.git sources/meta-coral -b warrior

Do you have any other local changes?

@jens-f
Copy link
Author

jens-f commented Jan 8, 2020

I tried that as well and I'm getting the exact same error. I have no local changes, I'm doing a fresh checkout using the steps I listed above. It seems like clang-native-8.0.1-r0 that is pulled in cannot be successfully compiled using build/tmp/hosttools/g++, which is gcc 7.4.0

@mirzak
Copy link
Owner

mirzak commented Jan 13, 2020

I wonder if this is something that should be reported to the meta-clang maintainers instead.

I did try a fresh build in my environment (Debian 9) and I could not re-produce, which might indicate that is using binaries from the host system and hence we get different result.

@mirzak
Copy link
Owner

mirzak commented Jan 13, 2020

using build/tmp/hosttools/g++, which is gcc 7.4.0

Are you forcing usage of GCC 7? As far as I know the default on warrior should be GCC 8.

@jens-f
Copy link
Author

jens-f commented Jan 16, 2020

I'm building on a Ubuntu 18.04 VM. Not doing anything special for the build, in fact that VM is pretty basic with hardly anything installed. I'm also not forcing any compiler version - as far as I can tell, the gcc is made by Yocto as part of the native tooling. Could you double check in your debian environment what g++ version you get when you call coral/build/tmp/hosttools/g++?

@jens-f
Copy link
Author

jens-f commented Jan 16, 2020

Oh wait, coral/build/tmp/hosttools contains links to the native OS tooling. Isn't Yocto supposed to first build the tooling for the native host and then use it to compile?

Knowing that, I was trying to use gcc 8

sudo apt-get install gcc-8 g++-8

By doing so, the error message has now changed to this:

| [1172/2538] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64InstrInfo.cpp.o
| FAILED: lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64InstrInfo.cpp.o
| /home/jens/coral/build/tmp/hosttools/g++  -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AArch64 -I/home/jens/coral/build/tmp/work-shared/llvm-project-source-8.0.1-r0/git/llvm/lib/Target/AArch64 -Iinclude -I/home/jens/coral/build/tmp/work-shared/llvm-project-source-8.0.1-r0/git/llvm/include -isystem/home/jens/coral/build/tmp/work/x86_64-linux/clang-native/8.0.1-r0/recipe-sysroot-native/usr/include -O2 -pipe   -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 -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -DNDEBUG -MD -MT lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64InstrInfo.cpp.o -MF lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64InstrInfo.cpp.o.d -o lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64InstrInfo.cpp.o -c /home/jens/coral/build/tmp/work-shared/llvm-project-source-8.0.1-r0/git/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
| g++: fatal error: Killed signal terminated program cc1plus
| compilation terminated.
| [1173/2538] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64LegalizerInfo.cpp.o
| [1174/2538] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64LoadStoreOptimizer.cpp.o
| [1175/2538] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64InstructionSelector.cpp.o
| [1176/2538] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64ISelDAGToDAG.cpp.o
| [1177/2538] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64ISelLowering.cpp.o
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/jens/coral/build/tmp/work/x86_64-linux/clang-native/8.0.1-r0/temp/log.do_compile.5581)
ERROR: Task (virtual:native:/home/jens/coral/sources/meta-clang/recipes-devtools/clang/clang_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3022 tasks of which 1383 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

Summary: 1 task failed:
  virtual:native:/home/jens/coral/sources/meta-clang/recipes-devtools/clang/clang_git.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

The gcc I'm using now is this:

g++ (Ubuntu 8.3.0-6ubuntu1~18.04.1) 8.3.0

Could you post the version that you were using on Debian 9?

@mirzak
Copy link
Owner

mirzak commented Jan 16, 2020

$ gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516

@mirzak
Copy link
Owner

mirzak commented Jan 16, 2020

Also note that the components in the hosttools directory are just symlinks,

$ ls -alh ./tmp/hosttools/g++
lrwxrwxrwx 1 admin admin 12 Jan 16 07:25 ./tmp/hosttools/g++ -> /usr/bin/g++

@jens-f
Copy link
Author

jens-f commented Jan 17, 2020

After more experimentation I was able to figure out the reason for the gcc internal compiler errors. It turns out that gcc was simply running out of memory (but didn't report this in a good way). My virtual machine only had 4 GB of memory. Once I upped this to 8 GB RAM, the compilation went through without any issues. Note: I did this with gcc upgraded to 8.3.0 (see above) instead of reverting to using version 7.4.0 which is default on Ubuntu 18.04. Once I have time I might try using 7.4.0 as well.

Thanks @mirzak for supporting the investigation!

@jens-f jens-f closed this as completed Jan 17, 2020
@mirzak
Copy link
Owner

mirzak commented Jan 17, 2020

Awesome, thanks for reporting back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants