From 8bf6290a018e0c9bde79883c3e96722387e4c792 Mon Sep 17 00:00:00 2001 From: ijl Date: Mon, 4 Dec 2023 15:12:48 +0000 Subject: [PATCH] clang --- .github/workflows/linux.yaml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index ff140db0..9cfbb92b 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -195,40 +195,46 @@ jobs: { arch: 'aarch64', target: 'aarch64-unknown-linux-gnu', - cflags: '-O2', + cflags: '-O2 -fno-plt -flto=thin', + rustflags: '-C linker=clang -C linker-plugin-lto -C link-arg=-fuse-ld=lld -C link-args=-s -D warnings', }, { arch: 'armv7', target: 'armv7-unknown-linux-gnueabihf', - cflags: '-Os -fstrict-aliasing', + cflags: '-Os -fno-plt -flto=thin -fstrict-aliasing', + rustflags: '-C linker=clang -C linker-plugin-lto -C link-arg=-fuse-ld=lld -C link-args=-s -D warnings', }, { arch: 'ppc64le', target: 'powerpc64le-unknown-linux-gnu', - cflags: '-O2', + cflags: '-O2 -fno-plt -flto=thin', + rustflags: '-C linker=clang -C linker-plugin-lto -C link-arg=-fuse-ld=lld -C link-args=-s -D warnings', }, { arch: 's390x', target: 's390x-unknown-linux-gnu', - cflags: '-O2 -march=z10', + cflags: '-O2 -fno-plt -flto=thin -march=z10', + rustflags: '-C linker=clang -C linker-plugin-lto -C link-arg=-fuse-ld=lld -C link-args=-s -D warnings', }, ] steps: - uses: actions/checkout@v4 - - name: build-std run: | mkdir .cargo cp ci/config.toml .cargo/config.toml - name: Build - uses: PyO3/maturin-action@v1 + uses: PyO3/maturin-action@v1.40.8 env: + CC: "clang" PYO3_CROSS_LIB_DIR: "/opt/python/${{ matrix.python.abi }}" CFLAGS: "${{ matrix.target.cflags }}" - LDFLAGS: "${{ matrix.target.cflags }} -flto -Wl,--as-needed" + LDFLAGS: "${{ matrix.target.cflags }} -Wl,--as-needed" CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + RUSTFLAGS: "${{ matrix.target.rustflags }}" with: + before-script-linux: apt-get update && apt-get install -y clang lld target: ${{ matrix.target.target }} rust-toolchain: nightly-2023-11-15 rustup-components: rust-src