mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
Build rpcs3's AppImages with link time optimization
On the clang build we now link with lld, and on GCC we now link with Gold
This commit is contained in:
parent
2678ac6382
commit
6ec149d8f5
@ -21,12 +21,24 @@ if [ $COMPILER = "gcc" ]; then
|
||||
# These are set in the dockerfile
|
||||
export CC=${GCC_BINARY}
|
||||
export CXX=${GXX_BINARY}
|
||||
export LINKER=gold
|
||||
# We need to set the following variables for LTO to link properly
|
||||
export AR=/usr/bin/gcc-ar-9
|
||||
export RANLIB=/usr/bin/gcc-ranlib-9
|
||||
else
|
||||
export CC=${CLANG_BINARY}
|
||||
export CXX=${CLANGXX_BINARY}
|
||||
export LINKER=lld
|
||||
export AR=/usr/bin/llvm-ar-$LLVMVER
|
||||
export RANLIB=/usr/bin/llvm-ranlib-$LLVMVER
|
||||
fi
|
||||
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_LLVM_SUBMODULE=OFF -DUSE_COTIRE=OFF -DLLVM_DIR=llvmlibs/lib/cmake/llvm/ -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja
|
||||
# Use link time optimization to save some space
|
||||
export CFLAGS="-flto -fuse-linker-plugin -fuse-ld=${LINKER}"
|
||||
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_LLVM_SUBMODULE=OFF -DUSE_COTIRE=OFF -DLLVM_DIR=llvmlibs/lib/cmake/llvm/ -DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CFLAGS" -DCMAKE_AR=$AR -DCMAKE_RANLIB=$RANLIB \
|
||||
-G Ninja
|
||||
|
||||
ninja; build_status=$?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user