Skip to content

Commit

Permalink
Merge branch 'topic/cross-gcc-14' into 'master'
Browse files Browse the repository at this point in the history
Build cross aarch64 GNAT from GCC 14 sources

See merge request eng/ide/VSS!336
  • Loading branch information
reznikmm committed Aug 6, 2024
2 parents d7d3716 + a0a8c41 commit 04ee087
Showing 1 changed file with 13 additions and 86 deletions.
99 changes: 13 additions & 86 deletions .github/workflows/build_gnat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
sudo apt remove -y gcc binutils
sudo apt autoremove -y
sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu libc6-dev texinfo bison m4 flex
curl -L https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-13.2.0-1/gnat-x86_64-linux-13.2.0-1.tar.gz | tar xzf -
curl -L https://ftp.gwdg.de/pub/misc/gcc/releases/gcc-13.2.0/gcc-13.2.0.tar.xz |tar xJf -
export PATH=$PWD/gnat-x86_64-linux-13.2.0-1/bin:$PATH
cd gcc-13.2.0
curl -L https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-14.1.0-3/gnat-x86_64-linux-14.1.0-3.tar.gz | tar xzf -
curl -L https://ftp.gwdg.de/pub/misc/gcc/releases/gcc-14.1.0/gcc-14.1.0.tar.xz |tar xJf -
export PATH=$PWD/gnat-x86_64-linux-14.1.0-3/bin:$PATH
cd gcc-14.1.0
echo '--ipv4' >> ~/.curlrc
./contrib/download_prerequisites
mkdir ../build
cd ../build
CC="x86_64-pc-linux-gnu-gcc" CXX="x86_64-pc-linux-gnu-g++" \
../gcc-13.2.0/configure \
../gcc-14.1.0/configure \
--prefix=/usr \
--enable-languages=c,ada,c++ \
--enable-libstdcxx --enable-libstdcxx-threads --enable-libada --disable-nls \
Expand All @@ -34,17 +34,17 @@ jobs:
make -j4 all
make install-strip DESTDIR=$PWD/../destdir
# missing files required to rebuild RTS
cp -v gcc/ada/rts/*.{c,h,gpr,lst} ../gcc-13.2.0/libgcc/unwind-pe.h \
../destdir/usr/lib/gcc/aarch64-linux-gnu/13.2.0/adainclude/
cp -v gcc/ada/rts/*.{c,h,gpr,lst} ../gcc-14.1.0/libgcc/unwind-pe.h \
../destdir/usr/lib/gcc/aarch64-linux-gnu/14.1.0/adainclude/
cd ..
tar cavf aarch64-Linux-gcc-13.2.tar.bz2 -C destdir .
tar cavf aarch64-Linux-gcc-14.1.tar.bz2 -C destdir .
rm -rf destdir
- name: Build GMP
run: |
export PATH=$PWD/gnat-x86_64-linux-13.2.0-1/bin:$PATH
sudo tar xjf aarch64-Linux-gcc-13.2.tar.bz2 -C /
cd gcc-13.2.0/gmp
export PATH=$PWD/gnat-x86_64-linux-14.1.0-3/bin:$PATH
sudo tar xjf aarch64-Linux-gcc-14.1.tar.bz2 -C /
cd gcc-14.1.0/gmp
./configure --host=aarch64-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr/aarch64-linux-gnu
make -j4 all
make install DESTDIR=$PWD/../../destdir
Expand All @@ -54,9 +54,9 @@ jobs:
- name: Archive GNAT binary
uses: actions/upload-artifact@v3
with:
name: aarch64-${{ runner.os }}-gnat-13
name: aarch64-${{ runner.os }}-gnat-14
path: |
aarch64-Linux-gcc-13.2.tar.bz2
aarch64-Linux-gcc-14.1.tar.bz2
aarch64-Linux-gmp-6.2.1.tar.bz2
- name: AWS S3 upload
Expand All @@ -69,76 +69,3 @@ jobs:
aws s3 cp . s3://adacore-gha-tray-eu-west-1/toolchain/ --recursive --exclude "*" --include "*.tar.bz2" --sse=AES256
aws s3 ls s3://adacore-gha-tray-eu-west-1/toolchain/
build_macos:
runs-on: macos-11
steps:
- name: Get VSS
uses: actions/checkout@v3
with:
path: ./vss
- name: Build GNAT
run: |
brew install texinfo bison m4 flex
curl -L https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-13.2.0-1/gnat-x86_64-darwin-13.2.0-1.tar.gz | tar xzf -
git clone --depth=1 https://github.com/iains/gcc-13-branch gcc-13.2.0
export PATH=$PWD/gnat-x86_64-darwin-13.2.0-1/bin:$PATH
cd gcc-13.2.0
./contrib/download_prerequisites
mkdir ../build
cd ../build
CC="x86_64-apple-darwin21.6.0-gcc" CXX="x86_64-apple-darwin21.6.0-g++" \
../gcc-13.2.0/configure \
--prefix=/usr/local \
--enable-languages=c,ada,c++ \
--enable-libstdcxx --enable-libstdcxx-threads --enable-libada --disable-nls \
--without-libiconv-prefix --disable-libstdcxx-pch \
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \
--without-target-system-zlib \
--with-as=/usr/bin/as --with-ar=/usr/bin/ar --with-ld=/usr/bin/ld \
--with-dsymutil=/usr/bin/dsymutil --with-ranlib=/usr/bin/ranlib \
--disable-multilib --disable-libcilkrts --without-build-config \
--with-specs='%{!sysroot=*:--sysroot=%:if-exists-else(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk)}'\
--target=aarch64-apple-darwin21.6.0 --build=x86_64-apple-darwin21.6.0 \
AS_FOR_TARGET=/usr/bin/as LD_FOR_TARGET=/usr/bin/ld \
NM_FOR_TARGET=/usr/bin/nm RANLIB_FOR_TARGET=/usr/bin/ranlib \
AR_FOR_TARGET=/usr/bin/ar LIPO_FOR_TARGET=/usr/bin/lipo \
DSYMUTIL_FOR_TARGET=/usr/bin/dsymutil \
STRIP_FOR_TARGET=/usr/bin/strip
make -j4 all
make install-strip DESTDIR=$PWD/../destdir
# missing files required to rebuild RTS
cp -v gcc/ada/rts/*.{c,h,gpr,lst} ../gcc-13.2.0/libgcc/unwind-pe.h \
../destdir/usr/local/lib/gcc/aarch64-apple-darwin21.6.0/13.2.0/adainclude/
cd ..
tar cavf aarch64-macOS-gcc-13.2.tar.bz2 -C destdir .
rm -rf destdir
- name: Build GMP
run: |
export PATH=$PWD/gnat-x86_64-darwin-13.2.0-1/bin:$PATH
sudo tar xjf aarch64-macOS-gcc-13.2.tar.bz2 --strip-components=3 -C /usr/local
cd gcc-13.2.0/gmp
./configure --host=aarch64-apple-darwin21.6.0 --build=x86_64-apple-darwin21.6.0 --prefix=/usr/local/aarch64-apple-darwin21.6.0
make -j4 all
make install DESTDIR=$PWD/../../destdir
cd ../..
tar cavf aarch64-macOS-gmp-6.2.1.tar.bz2 -C destdir .
- name: Archive GNAT binary
uses: actions/upload-artifact@v3
with:
name: aarch64-${{ runner.os }}-gnat-13
path: |
aarch64-macOS-gcc-13.2.tar.bz2
aarch64-macOS-gmp-6.2.1.tar.bz2
- name: AWS S3 upload
if: ${{ github.repository == 'AdaCore/VSS' }}
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
AWS_DEFAULT_REGION: eu-west-1
run: |
aws s3 cp . s3://adacore-gha-tray-eu-west-1/toolchain/ --recursive --exclude "*" --include "*.tar.bz2" --sse=AES256
aws s3 ls s3://adacore-gha-tray-eu-west-1/toolchain/

0 comments on commit 04ee087

Please sign in to comment.