From 19ca2415f26b07b399a60fd17a4cf85f290da0fd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 15 Dec 2021 00:22:38 -0700 Subject: update glibc start files to 2.34 This commit introduces tools/update_glibc.zig to update the start files for next time. Some notable changes in recent glibc: * abi-note.S has been changed to abi-note.c but we resist the change to keep it easier to compile the start files. * elf-init.c has been deleted upstream. Further testing should be done to verify that binaries against glibc omitting elf-init.c still run properly on oldel glibc linux systems. Closes #4926 --- src/glibc.zig | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/glibc.zig b/src/glibc.zig index bd5372c2d2..b963247984 100644 --- a/src/glibc.zig +++ b/src/glibc.zig @@ -282,46 +282,13 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { lib_libc_glibc ++ "io" ++ path.sep_str ++ "fstatat64.c", lib_libc_glibc ++ "io" ++ path.sep_str ++ "mknod.c", lib_libc_glibc ++ "io" ++ path.sep_str ++ "mknodat.c", - lib_libc_glibc ++ "nptl" ++ path.sep_str ++ "pthread_atfork.c", + lib_libc_glibc ++ "sysdeps" ++ path.sep_str ++ "pthread" ++ path.sep_str ++ + "pthread_atfork.c", lib_libc_glibc ++ "debug" ++ path.sep_str ++ "stack_chk_fail_local.c", + lib_libc_glibc ++ "csu" ++ path.sep_str ++ "errno.c", }; - var c_source_files: [deps.len + 1]Compilation.CSourceFile = undefined; - - c_source_files[0] = blk: { - var args = std.ArrayList([]const u8).init(arena); - try args.appendSlice(&[_][]const u8{ - "-std=gnu11", - "-fgnu89-inline", - "-fmerge-all-constants", - "-fno-stack-protector", - "-fmath-errno", - "-fno-stack-protector", - "-I", - try lib_path(comp, arena, lib_libc_glibc ++ "csu"), - }); - try add_include_dirs(comp, arena, &args); - try args.appendSlice(&[_][]const u8{ - "-DSTACK_PROTECTOR_LEVEL=0", - "-fPIC", - "-fno-stack-protector", - "-ftls-model=initial-exec", - "-D_LIBC_REENTRANT", - "-include", - try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"), - "-DMODULE_NAME=libc", - "-Wno-nonportable-include-path", - "-include", - try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), - "-DPIC", - "-DLIBC_NONSHARED=1", - "-DTOP_NAMESPACE=glibc", - }); - break :blk .{ - .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "elf-init.c"), - .extra_flags = args.items, - }; - }; + var c_source_files: [deps.len]Compilation.CSourceFile = undefined; for (deps) |dep, i| { var args = std.ArrayList([]const u8).init(arena); @@ -347,7 +314,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { "-DLIBC_NONSHARED=1", "-DTOP_NAMESPACE=glibc", }); - c_source_files[i + 1] = .{ + c_source_files[i] = .{ .src_path = try lib_path(comp, arena, dep), .extra_flags = args.items, }; -- cgit v1.2.3