From 217802b9c0b9115c508ade1fe541d9c895d47328 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 18 Aug 2024 21:03:47 +0800 Subject: [PATCH] gcc-pass2: Fix description of LDFLAGS_FOR_TARGET= Pass 2 libstdc++ still links to libgcc.a even with LDFLAGS_FOR_TARGET=, despite this libgcc.a is from pass 2 instead of pass 1. The difference between pass 2 libgcc and pass 1 libgcc is Glibc wasn't installed when the pass 1 libgcc was built. This difference causes both consequences (1) pass 1 libgcc lacks shared library and (2) pass 1 libgcc cannot support C++ EH, but it's not (1) causing (2). --- chapter06/gcc-pass2.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml index 6ca5a0fa2..6d0098c80 100644 --- a/chapter06/gcc-pass2.xml +++ b/chapter06/gcc-pass2.xml @@ -138,10 +138,11 @@ cd build LDFLAGS_FOR_TARGET=... Allow libstdc++ to - use the shared libgcc being - built in this pass, instead of the static version that was built in GCC - pass 1. This is necessary to support C++ exception - handling. + use the libgcc being + built in this pass, instead of the previous version built in + . The previous version cannot + properly support C++ exception handling because it was built + without libc support.