Skip to content

FullRELRO and PIE

FullRELRO and PIE #34

Workflow file for this run

name: p7zip-CI
on:
push:
tags:
- 'v*'
jobs:
build:
name: p7zip-full build
strategy:
matrix:
include:
- os: ubuntu-latest
mode: "x86_64"
asset_name: p7zip-linux-x86_64-musl.zip
- os: ubuntu-latest
mode: "i686"
asset_name: p7zip-linux-i686-musl.zip
- os: macos-latest
asset_name: p7zip-macos.zip
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@staging
with:
mold-version: 2.3.3
make-default: true
- name: install
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt install git clang llvm patchelf build-essential make cmake wget unzip lld
- name: install (MacOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install llvm libomp
- name: install zig (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
mkdir -p zig
cd zig
curl -LZ https://ziglang.org/builds/zig-linux-x86_64-0.12.0-dev.1642+5f8641401.tar.xz|tar xJ --strip-component=1
cd ..
sudo mv zig /usr/local/zig
- name: install zig (MacOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
mkdir -p zig
cd zig
curl -LZ https://ziglang.org/builds/zig-macos-x86_64-0.12.0-dev.1642+5f8641401.tar.xz|tar xJ --strip-component=1
cd ..
sudo mv zig /usr/local/zig
- name: Set up UASM (MacOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
curl -LZ https://github.com/Terraspace/UASM/archive/refs/tags/v2.55.tar.gz | tar xz
# Apple clang 12+ requires "-Wno-error=implicit-function-declaration" cf https://forum.mmm.ucar.edu/phpBB3/viewtopic.php?t=11087&p=24226
sed -i -e 's/-ansi/-Wno-error=implicit-function-declaration/' UASM-2.55/ClangOSX64.mak
make -C UASM-2.55 -f ClangOSX64.mak CC=clang LD=ld.mold
sudo cp UASM-2.55/GccUnixR/uasm /usr/local/bin/
- name: Set up UASM (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
wget https://github.com/Terraspace/UASM/files/9881874/uasm256_linux64.zip
unzip uasm256_linux64.zip uasm
chmod +x uasm
sudo cp uasm /usr/local/bin/
- name: submodule update
run: |
git submodule update --init
cd Codecs/fast-lzma2/
patch -p1 -i ../../UInt64.patch
- name: Build (Linux x86_64)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.mode == 'x86_64' }}
run: |
source ./zig-linux.sh
./build_linux.sh
- name: Build (Linux i686)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.mode == 'i686' }}
run: |
source ./zig-linux-x86.sh
./build_linux.sh
- name: Build (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
#echo 'clang -arch arm64 -fno-stack-check "$@"' | sudo tee /usr/local/bin/arm64-apple-darwin-clang
#echo 'clang++ -arch arm64 -fno-stack-check "$@"' | sudo tee /usr/local/bin/arm64-apple-darwin-clang++
#sudo chmod 755 /usr/local/bin/arm64-apple-darwin-clang /usr/local/bin/arm64-apple-darwin-clang++
sed -i -e 's/\&\& LZHAM_PLATFORM_PC/\&\& LZHAM_PLATFORM_PC \&\& !defined(__aarch64__)/' Codecs/lzham_codec_devel/lzhamdecomp/lzham_platform.h
./build_macos.sh
- name: 7z check
if: ${{ !( matrix.os == 'ubuntu-latest' && matrix.mode == 'i686' ) }}
run: |
export PROJECT_ROOT=`pwd`
cd $PROJECT_ROOT/p7zip_test_utils/check
#bash ../../check_7z.sh $PROJECT_ROOT/bin/p7zip/7z
bash check.sh $PROJECT_ROOT/bin/p7zip/7zz
- name: 7z check(Linux i686)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.mode == 'i686' }}
run: |
export PROJECT_ROOT=`pwd`
cd $PROJECT_ROOT/p7zip_test_utils/check
#bash ../../check_7z.sh $PROJECT_ROOT/bin/p7zip/7z
bash ../../check_7zz.sh $PROJECT_ROOT/bin/p7zip/7zz
- name: archive
run: |
mkdir -p release
cd bin
./p7zip/7zz a -tzip -mx=9 ../release/${{ matrix.asset_name }} ./p7zip
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}