X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=automation%2Fansible%2Froles%2Fcross-compilers%2Ffiles%2Fscript.sh;h=b868787e098e60823cc831b10c1c12dd69d5d3f7;hb=HEAD;hp=47b04a07e07d49048af440ee40f26cbfca4b7883;hpb=e261a28e1eb9e25a9dbac69d05cf622ce935bac4;p=lttng-ci.git diff --git a/automation/ansible/roles/cross-compilers/files/script.sh b/automation/ansible/roles/cross-compilers/files/script.sh index 47b04a0..b868787 100755 --- a/automation/ansible/roles/cross-compilers/files/script.sh +++ b/automation/ansible/roles/cross-compilers/files/script.sh @@ -1,14 +1,23 @@ #!/bin/bash -x +# +# SPDX-FileCopyrightText: 2024 Kienan Stewart "/output/${TARGET}.time" + fi -"${SRC_DIR}/configure" --build="${HOST}" --host="${HOST}" --enable-languages=c,c++ \ - --program-prefix="${TARGET}-" --target="${TARGET}" --program-suffix=-4.8 \ - --prefix=/usr/ --with-system-zlib \ - --libexecdir=/usr/lib/ --libdir=/usr/lib/ \ - --disable-nls --disable-shared --enable-host-shared \ - --disable-bootstrap --enable-threads=posix --enable-default-pie \ - --with-sysroot=/ --includedir=/usr/"${TARGET}"/include \ - --without-target-system-zlib --enable-multiarch - ${TARGET_ARGS[@]} ${CONFIGURE_ARGS} \ - CFLAGS='-std=gnu99' CXXFLAGS='-std=gnu++98' + cp config.log "/output/config-${TARGET}.log" +done -make -j"${NPROC:-$(nproc)}" ${MAKE_ARGS} \ - CFLAGS='-std=gnu99' CXXFLAGS='-std=gnu++98' +cp -r "/usr/local/gcc${BIN_SUFFIX}" "/output/usr/local/" -make install ${MAKE_INSTALL_ARGS} -mkdir -p /output/usr/lib/ /output/usr/bin/ -cp -r /usr/lib/gcc-cross /output/usr/lib/ -cp /usr/bin/*-4.8 /output/usr/bin/ +# To test +# 1. Copy the output tarball from the Makefile to a Debian bookworm instance +# 2. Unpack, eg. `tar -xzf gcc55.tar.gz -C /` +# 3. Build a small test program, eg. +# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc5.5/bin \ +# PATH=$PATH:/usr/local/gcc5.5/bin \ +# aarch64-linux-gnu-gcc-5.5 -o hello hello.c +# 4. Copy the built binary to a system with that native architecture and run it +# 5. Upload to object storage, eg. +# s3cmd put gcc55.tar.gz s3://jenkins/gcc-5.5-x86_64-linux-gnu-cross.tgz +#