This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcross-gcc.yaml
94 lines (90 loc) · 2.63 KB
/
cross-gcc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package:
name: cross-gcc-stage1
version: 12.2.0
epoch: 2
description: "the GNU compiler collection (cross compilation)"
target-architecture:
- all
copyright:
- paths:
- "*"
attestation: TODO
license: GPL-3.0-or-later
dependencies:
runtime:
environment:
contents:
repositories:
- https://mirrors.edge.kernel.org/alpine/edge/main
packages:
- alpine-baselayout-data
- busybox
- build-base
- scanelf
- ssl_client
- ca-certificates-bundle
- texinfo
- gmp-dev
- mpfr-dev
- mpc1-dev
- isl-dev
- zlib-dev
- gawk
- bison
- flex
- cross-binutils-stage1
pipeline:
- uses: fetch
with:
uri: https://gcc.gnu.org/pub/gcc/releases/gcc-${{package.version}}/gcc-${{package.version}}.tar.gz
expected-sha256: ac6b317eb4d25444d87cf29c0d141dedc1323a1833ec9995211b13e1a851261c
- name: 'Set up build directory'
runs: |
mkdir build
- name: 'Configure GCC'
runs: |
cd build
../configure \
--target=${{cross.triplet.gnu.glibc}} \
--prefix=/usr \
--disable-nls \
--disable-werror \
--with-glibc-version=2.35 \
--with-newlib \
--with-sysroot=/usr/${{cross.triplet.gnu.glibc}} \
--without-headers \
--enable-initfini-array \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-libcc1 \
--disable-decimal-float \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
- runs: |
make -C build -j$(nproc)
- runs: |
make -C build -j$(nproc) install DESTDIR="${{targets.destdir}}"
- name: 'Clean up host aliases'
runs: |
rm -rf ${{targets.destdir}}/usr/${{cross.triplet.gnu.glibc}}
- name: 'Fix limits.h'
runs: |
FULLPATH=${{targets.destdir}}/usr/lib/gcc/${{cross.triplet.gnu.glibc}}/${{package.version}}
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > $FULLPATH/include-fixed/limits.h
cat gcc/gsyslimits.h > $FULLPATH/include-fixed/syslimits.h
- name: 'Move fixed includes into main directory'
runs: |
FULLPATH=${{targets.destdir}}/usr/lib/gcc/${{cross.triplet.gnu.glibc}}/${{package.version}}
mv $FULLPATH/include-fixed/syslimits.h $FULLPATH/include/syslimits.h
mv $FULLPATH/include-fixed/limits.h $FULLPATH/include/limits.h
- name: 'Clean up documentation'
runs: |
rm -rf ${{targets.destdir}}/usr/share/info
- uses: strip