authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-15 22:27:11-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-16 03:01:13-07:00
logafb1652c50f0b25d45ccbbd7aa37f1c20cf61b0b
tree8294f2841a8c40d3cd5d473dd72241215d65ec37
parentbf2bd8e7220b9468c17a8d1415948e1f93a4b8f4

glibc: i386: make glibc not use invalid inline asm syntax


1 files changed, 8 insertions(+), 0 deletions(-)

src/glibc.zig+8
......@@ -269,6 +269,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
269269 return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_os, abi_note_o });
270270 },
271271 .libc_nonshared_a => {
272 const target = comp.getTarget();
272273 const s = path.sep_str;
273274 const linux_prefix = lib_libc_glibc ++
274275 "sysdeps" ++ s ++ "unix" ++ s ++ "sysv" ++ s ++ "linux" ++ s;
......@@ -354,6 +355,13 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
354355 });
355356 try add_include_dirs(comp, arena, &args);
356357
358 if (target.cpu.arch == .i386) {
359 // This prevents i386/sysdep.h from trying to do some
360 // silly and unnecessary inline asm hack that uses weird
361 // syntax that clang does not support.
362 try args.append("-DCAN_USE_REGISTER_ASM_EBP");
363 }
364
357365 const shared_def = switch (dep.flavor) {
358366 .shared => "-DSHARED",
359367 .nonshared => "-DLIBC_NONSHARED=1",