aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/package/gcc/package.az
blob: 44c751314ab91f7f9d5ca8565a13c7e5343814bf (plain)
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
package binutils {
	description = "a collection of binary tools";
	website = "https://www.gnu.org/software/binutils";
	anitya = 7981;

	version# = "2.47";
	source = remoteTar {
		url = "https://mirrors.kernel.org/gnu/binutils/binutils-"+version+".tar.bz2";
		checksum = "VjbMg5KtZ6VSeNc77Z5p8RKg9eZ56g29ViKbbsF3tcFhZu0Yurg0nZt7UwB577LM";
		compress = bzip2;
	};

	exec = make {};

	inputs = [ bash ];
}

package gcc {
	description = "The GNU Compiler Collection";
	website = "https://www.gnu.org/software/gcc";
	anitya = 6502;

	version# = "16.2.0";
	source = remoteTar {
		url = "https://ftp.tsukuba.wide.ad.jp/software/gcc/releases/"+
			"gcc-"+version+"/gcc-"+version+".tar.gz";
		checksum = "yWDNSrcKa6yA5ucD4G-a5nCN99yPA8cRlxKgQlaaT-jM4pWYR6e1EvI2qbjUqXWZ";
		compress = gzip;
	};
	patches = [
		"musl-off64_t-loff_t.patch",
		"musl-legacy-lfs.patch",
	];

	// GCC spends most of its time in its many configure scripts, however
	// it also saturates the CPU for a consequential amount of time.
	exclusive = true;

	early = `
ln -s system/lib /
ln -s system/lib /work/
`;

	exec = make {
		configure = {
			"disable-multilib";
			"enable-default-pie";
			"disable-nls";
			"with-gnu-as";
			"with-gnu-ld";
			"with-system-zlib";
			"enable-languages": "c,c++,go";
			"with-native-system-header-dir": "/system/include";

			"with-multilib-list": arch {
				amd64, arm64 = "''";
			};
		};

		make = [
			"BOOT_CFLAGS='-O2 -g'",
			"bootstrap",
		];

		// This toolchain is hacked to pieces, it is not expected to ever work
		// well in its current state. That does not matter as long as the
		// toolchain it produces passes its own test suite.
		check = nil;
	};

	inputs = [
		binutils,

		mpc,
		zlib,
		libucontext,
		kernel-headers,
	];

	runtime = [
		binutils,

		mpc,
		zlib,
		zstd,
		libucontext,
	];
}