gcc{48,49,6}: don’t use -pipe with clang assembler

Older versions of GCC use `-pipe` on Darwin due to compatibility
problems with older cctools assemblers. Darwin now uses the clang
integrated assembler. While it is possible to pipe input into it, the
wrapper used in nixpkgs is not set up for it.

Fixing the wrapper would cause all of Darwin to rebuild, which is not
desirable, so just disable `-pipe` in the bootstrap configuration. The
clang integrated assembler doesn’t have the bug anyway.
This commit is contained in:
Randy Eckenrode 2023-11-06 16:44:29 -05:00 committed by Adam Joseph
parent e06f05d23c
commit d4f8aac2c5
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,16 @@
diff -ur a/libgcc/config/t-darwin b/libgcc/config/t-darwin
--- a/libgcc/config/t-darwin 2012-07-14 09:50:59.000000000 -0400
+++ b/libgcc/config/t-darwin 2023-11-05 21:26:11.696825584 -0500
@@ -7,12 +7,6 @@
crttme.o: $(srcdir)/config/darwin-crt-tm.c
$(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -DEND -c $<
-# -pipe because there's an assembler bug, 4077127, which causes
-# it to not properly process the first # directive, causing temporary
-# file names to appear in stabs, causing the bootstrap to fail. Using -pipe
-# works around this by not having any temporary file names.
-HOST_LIBGCC2_CFLAGS += -pipe
-
# Use unwind-dw2-fde-darwin
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c

View File

@ -243,6 +243,12 @@ in
./6/gnat-glibc234.patch
]
# The clang-based assembler used in darwin.cctools-llvm (LLVM >11) does not support piping input.
# Fortunately, it does not exhibit the problem GCC has with the cctools assembler.
# This patch can be dropped should darwin.cctools-llvm ever implement support.
++ optional (!atLeast7 && hostPlatform.isDarwin && lib.versionAtLeast (lib.getVersion stdenv.cc) "12") ./4.9/darwin-clang-as.patch
## gcc 4.9 and older ##############################################################################
++ optional (!atLeast6) ./parallel-bconfig.patch