-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re #464: smaller test case; cross-compile, qemu; command:
set -xe ; cd ~/proj/rapidyaml/samples/add_subdirectory/ ; sys=powerpc64le ; cxxflags="-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -std=c++11 -DNDEBUG" ; bdir=build/$sys ; mkdir -p $bdir ; cmake -S . -B $bdir -D CMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE:STRING="$cxxflags" --toolchain ../../.github/toolchains/linux-gnu-$sys.cmake ; cmake --build $bdir --target run -j --verbose
- Loading branch information
Showing
3 changed files
with
86 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CROSS_COMPILER_PREFIX /usr) | ||
set(CROSS_COMPILER_TARGET powerpc64le-linux-gnu) | ||
set(CMAKE_SYSTEM_PROCESSOR powerpc64le) | ||
set(CMAKE_CROSSCOMPILING_EMULATOR qemu-ppc64le-static) | ||
set(CMAKE_C_COMPILER ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-gcc) | ||
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-g++) | ||
set(CMAKE_AR ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-ar CACHE FILEPATH "Archiver") | ||
set(CMAKE_MAKE_PROGRAM ${CROSS_COMPILER_PREFIX}/bin/make CACHE FILEPATH "make") | ||
|
||
# use -static to avoid having to install the dynamic loader | ||
# see https://mfo.dev.br/2018/03/17/ppc64le-on-x86_64-cross-compilers.html | ||
set(CMAKE_CXX_FLAGS -static) | ||
set(CMAKE_C_FLAGS -static) | ||
|
||
set(CMAKE_FIND_ROOT_PATH ${CROSS_COMPILER_PREFIX}/${CROSS_COMPILER_TARGET}) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
||
# needed ubuntu packages: | ||
# | ||
# sudo apt-get install -y \ | ||
# gcc-powerpc64le-linux-gnu \ | ||
# g++-powerpc64le-linux-gnu \ | ||
# qemu-user-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters