Geoff Keating wrote:

On 19/01/2006, at 9:08 AM, Peter O'Gorman wrote:

Eric Botcazou wrote:
|>Yes the workaround is to add -fexceptions or -shared-libgcc to the
|>command line when linking libgnat but I don't know if that is the correct
|>fix or some hacking to config/darwin.h is needed.
|
|
| Thanks. However, that's not sufficient because the tools fail to build too:

I'm adding Geoff Keating to the CC, hoping that he'll both shout at me while explaining why this change to darwin.h is broken, and suggest a real fix.


If ADA is going to use exceptions, then it needs to do what G++ does, which is pass -shared-libgcc in its driver.

This change allows gcc to build on powerpc-apple-darwin8.4 with ada.


It's not OK because for forwards binary compatibility the shared libgcc must be used for exception handling.

Okay.

The following patch allows the 4.1 branch to build ada on powerpc-apple-darwin8.4, okay? If so please apply as I do not have write access.

??-??-2006  Peter O'Gorman  <[EMAIL PROTECTED]>

        * Makefile.in: Pass -static-libgcc when building tools,
        and -shared-libgcc when building library on darwin.

Peter


Index: gcc/ada/Makefile.in
===================================================================
--- gcc/ada/Makefile.in (revision 110022)
+++ gcc/ada/Makefile.in (working copy)
@@ -1308,7 +1308,7 @@
 
   EH_MECHANISM=-gcc
   GNATLIB_SHARED = gnatlib-shared-darwin
-  SO_OPTS = -Wl,-flat_namespace
+  SO_OPTS = -Wl,-flat_namespace -shared-libgcc
   RANLIB = ranlib -c
   GMEM_LIB = gmemlib
   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
@@ -1365,6 +1365,7 @@
 
 LIBGNAT=../rts/libgnat.a 
 GCC_LINK="$(CC) -static-libgcc $(ADA_INCLUDES)"
+TOOL_CC=$(CC) -static-libgcc
 
 # when compiling the tools, the runtime has to be first on the path so that
 # it hides the runtime files lying with the rest of the sources
@@ -1472,15 +1473,15 @@
 
 # Likewise for the tools
 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o $(GNATMAKE_OBJS)
-       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
+       $(TOOL_CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
              $(TOOLS_LIBS)
 
 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o $(GNATLINK_OBJS)
-       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
+       $(TOOL_CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
              $(TOOLS_LIBS)
 
 ../../gnatbl$(exeext): gnatbl.o
-       $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
+       $(TOOL_CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
 
 gnatbl.o: gnatbl.c adaint.h
        $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)

Reply via email to