Subject: Re: Bootstrapping Zig with no Binary Blobs

From: Motiejus Jakštys <[email-masked]>
Date: Thu, 28 Nov 2024 22:53:57 +0200

On Thu, Nov 28, 2024 at 5:20 PM Hilton Chain <[email-masked]> wrote:
> Thanks!  Then I'll keep abilists removed before we can reproduce one :)

OK here it is for 0.11:

1. check out glibc-abi-tool 13576b1ea957882be7ff2c99f4cdc27454930219
2. rm -fr glibc/2.3{5,6,7,8}
3. apply the attached patch.
4. /path/to/zig-0.11/bin/zig run consolidate.zig

... which results in abilists
546e3c64b5c972b45c4c5c3e81fa1c73282db9377d57ae870d7abcb276f9605c.

Motiejus
From 23135302904467aa2e814500af6327408c46f52e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= <[email-masked]>
Date: Thu, 28 Nov 2024 22:52:13 +0200
Subject: [PATCH] Backport consolidate.zig to zig 0.11.0

---
 consolidate.zig | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/consolidate.zig b/consolidate.zig
index 0956b11ea983..b5f4969d28c2 100644
--- a/consolidate.zig
+++ b/consolidate.zig
@@ -126,10 +126,6 @@ const versions = [_]Version{
     .{.major = 2, .minor = 32},
     .{.major = 2, .minor = 33},
     .{.major = 2, .minor = 34},
-    .{.major = 2, .minor = 35},
-    .{.major = 2, .minor = 36},
-    .{.major = 2, .minor = 37},
-    .{.major = 2, .minor = 38},
 };
 
 // fpu/nofpu are hardcoded elsewhere, based on .gnueabi/.gnueabihf with an exception for .arm
@@ -838,7 +834,7 @@ pub fn main() !void {
 
     {
         // Function Inclusions
-        try w.writeIntLittle(u16, @intCast(fn_inclusions.items.len));
+        try w.writeIntLittle(u16, @as(u16, @intCast(fn_inclusions.items.len)));
         var i: usize = 0;
         while (i < fn_inclusions.items.len) {
             const name = fn_inclusions.items[i].name;
@@ -874,7 +870,7 @@ pub fn main() !void {
 
     {
         // Object Inclusions
-        try w.writeIntLittle(u16, @intCast(obj_inclusions.items.len));
+        try w.writeIntLittle(u16, @as(u16, @intCast(obj_inclusions.items.len)));
         var i: usize = 0;
         while (i < obj_inclusions.items.len) {
             const name = obj_inclusions.items[i].name;
-- 
2.47.0