Cross compile error with cmake version 3.8.1
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 3
Description
I tried follow the cross build method at ELC 2017 presentation by Hiroyuki ISHII
but I got build error like below ,after upgrade cmake to version 3.8.1
butter@desktop:~/bcc/build$ cmake .. -DCMAKE_CROSSCOMPILING=1 -DCMAKE_SYSROOT=${sysroot} \
> -DCMAKE_FIND_ROOT_PATH=${sysroot} \
> -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
> -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
> -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
> -DCMAKE_INSTALL_PREFIX=${sysroot}/us r\
> -DCMAKE_INSTALL_LIBDIR=lib64 \
> -DCMAKE_C_COMPILER=aarch64-poky-linux-gcc \
> -DCMAKE_CXX_COMPILER=aarch64-poky-linux-g++ \
> -DCMAKE_C_FLAGS="-mabi=lp64 -march=armv8-a -mtune=cortex-a57.cortex-a53 -Wall --sysroot=${sysroot}" \
> -DCMAKE_CXX_FLAGS="-mabi=lp64 -march=armv8-a -mtune=cortex-a57.cortex-a53 -Wall -std=c++11 --sysroot=${sysroot}" \
> -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${sysroot}" \
> -DCMAKE_SHARED_LINKER_FLAGS="--sysroot=${sysroot}" \
> -DMULTILIB_LIB64=ON \
> -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Latest recognized Git tag is v0.3.0
-- Git HEAD is 2923e204266c8c0114b7d0572c051c655b3cc26a
-- Revision is 0.3.0-2923e204
-- Found BISON: /usr/bin/bison (found version "3.0.2")
-- Found FLEX: /usr/bin/flex (found version "2.5.39")
-- Found LLVM: /usr/lib/llvm-3.7/include
-- Found LibElf: /usr/lib/x86_64-linux-gnu/libelf.so
-- Performing Test ELF_GETSHDRSTRNDX
-- Performing Test ELF_GETSHDRSTRNDX - Failed
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Found LuaJIT: /usr/lib/x86_64-linux-gnu/libluajit-5.1.a;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so
CMake Warning at tests/python/CMakeLists.txt:6 (message):
Recommended test program 'arping' not found
CMake Warning at tests/python/CMakeLists.txt:10 (message):
Recommended test program 'netperf' not found
CMake Warning at tests/python/CMakeLists.txt:14 (message):
Recommended test program 'iperf' not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/butter/tool/bcc/build
butter@desktop:~/bcc/build$ make
[ 1%] Building CXX object src/cc/frontends/clang/CMakeFiles/clang_frontend.dir/loader.cc.o
/home/butter/bcc/src/cc/frontends/clang/loader.cc:17:15: fatal error: map: No such file or directory
#include <map>
^
compilation terminated.
make[2]: *** [src/cc/frontends/clang/CMakeFiles/clang_frontend.dir/loader.cc.o] Error 1
make[1]: *** [src/cc/frontends/clang/CMakeFiles/clang_frontend.dir/all] Error 2
make: *** [all] Error 2
Is there a max cmake version limit to bcc?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported CMake 3.8.1 cross-compilation configuration and inspect the generated compile command for src/cc/frontends/clang/loader.cc. Compare its C++ include and toolchain settings with a working configuration. Done means the cross-compiled build proceeds past the missing error and the supported CMake range or required configuration is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100