This commit is contained in:
Richard Ramos
2025-07-09 13:56:14 -04:00
parent 7b50e9721f
commit d397b02d8c
2 changed files with 44 additions and 4 deletions

View File

@@ -92,6 +92,12 @@ jobs:
run: |
nimble install
- name: Install multilib support
if: ${{ matrix.platform.cpu == 'i386' && contains(matrix.platform.os, 'linux') }}
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
- name: Use gcc 14
if : ${{ matrix.platform.os == 'linux-gcc-14'}}
run: |

View File

@@ -1,14 +1,48 @@
#!/bin/bash
set -euo pipefail
root=$(dirname "$0")
sources=${root}/libs
tmpdir=$(mktemp -d)
force_i386=false
cmake -S . -B build
# check args
for arg in "$@"; do
case "$arg" in
--i386)
force_i386=true
;;
*)
echo "unknown arg: $arg" >&2
exit 1
;;
esac
done
cmake_args=(
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF
-DFIPS=OFF
-DBUILD_TOOL=OFF
-DDISABLE_GO=ON
)
# optionally inject i386 toolchain
if [ "$force_i386" = true ]; then
toolchain_file=$(mktemp)
cat > "$toolchain_file" <<EOF
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i386)
set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -m32")
EOF
cmake_args+=("-DCMAKE_TOOLCHAIN_FILE=$toolchain_file")
fi
# build aws-lc
tmpdir=$(mktemp -d)
cmake -S ./libs/aws-lc -B "$tmpdir" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DFIPS=OFF -DBUILD_TOOL=OFF -DDISABLE_GO=ON
cmake -S ./libs/aws-lc -B "$tmpdir" "${cmake_args[@]}"
cmake --build "$tmpdir" --target all
cp "$tmpdir"/ssl/libssl.a ./build/.
cp "$tmpdir"/crypto/libcrypto.a ./build/.
cp "$tmpdir"/crypto/libcrypto.a ./build/.