[llvm-commits] [PATCH] Fix llvm-gcc bootstrap failure on mac os x 10.4

Devang Patel dpatel at apple.com
Wed Feb 7 17:17:39 PST 2007


At the moment, llvm-gcc enables DWARF by default on darwin. But  
you'll don't have required tools. This patch enables DWARF only if  
they are available.

Applied. I also regenerated gcc/config.in and gcc/configure.

-
Devang


Index: configure.ac
===================================================================
--- configure.ac        (revision 123268)
+++ configure.ac        (working copy)
@@ -705,6 +705,28 @@ esac],
  AC_SUBST(onestep)

  # APPLE LOCAL begin LLVM
+# See if dsymutil has been installed and is modern enough
+# that we can use DWARF.
+gcc_AC_CHECK_PROG_VER(DSYMUTIL, dsymutil, --version,
+  [.*dwarfutils.\([0-9]*\)],
+  [2[5-9]*])
+if test $gcc_cv_prog_dsymutil_modern = no; then
+   AC_MSG_RESULT([dsymutil is not available])
+else
+  AC_DEFINE(HAVE_DSYMUTIL, 1,
+            [dsymutil is available])
+fi
+
+gcc_AC_CHECK_PROG_VER(DSYMUTIL, dsymutil, --version,
+  [.*dwarfutils.\([0-9]*\)],
+  [[3-9][0-9]*])
+if test $gcc_cv_prog_dsymutil_modern = no; then
+   AC_MSG_RESULT([dsymutil is not available])
+else
+  AC_DEFINE(HAVE_DSYMUTIL, 1,
+            [dsymutil is available])
+fi
+
  AC_ARG_ENABLE(llvm,
  [  --enable-llvm=DIR       enable the LLVM backend, use DIR as LLVM  
root],
  [case "${enableval}" in
Index: config/darwin.h
===================================================================
--- config/darwin.h     (revision 123268)
+++ config/darwin.h     (working copy)
@@ -367,6 +367,15 @@ do {                                       \
  #define CC1PLUS_SPEC "-D__private_extern__=extern"
  /* APPLE LOCAL end private extern */

+/* APPLE LOCAL begin llvm */
+#ifdef HAVE_DSYMUTIL
+#define DARWIN_DSYMUTIL_SPEC  "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:% 
{!MM:%{!E:%{!S:\
+                                 %{.c|.cc|.C|.cpp|.c++|.CPP|.m|.mm: \
+                                 %{g*:%{!gstabs*:%{!g0: dsymutil % 
{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+#else
+#define DARWIN_DSYMUTIL_SPEC ""
+#endif
+/* APPLE LOCAL end llvm */
  /* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
     precomp, libtool, and fat build additions.  Also we
     don't specify a second %G after %L because libSystem is
@@ -389,10 +398,10 @@ do {                                      \
      %{fnested-functions: -allow_stack_execute} \
      %{!nostdlib:%{!nodefaultlibs:%G %L}} \
  "/* APPLE LOCAL begin mainline 4.3 2006-12-20 4370146 4869554 */"\
-    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}\n\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
-    %{.c|.cc|.C|.cpp|.c++|.CPP|.m|.mm: \
-    %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+"/* APPLE LOCAL begin llvm */"\
+    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}} \n % 
(darwin_dsymutil) "
+/* APPLE LOCAL end llvm */
+
  /* APPLE LOCAL end mainline 4.3 2006-12-20 4370146 4869554 */
  /* APPLE LOCAL end no-libtool */

@@ -553,7 +562,9 @@ do {                                        \
  /* APPLE LOCAL begin crt1 4521370 */
  #define DARWIN_EXTRA_SPECS     \
    { "darwin_crt1",  
DARWIN_CRT1_SPEC },                                 \
-  { "darwin_dylib1", DARWIN_DYLIB1_SPEC },
+  { "darwin_dylib1",  
DARWIN_DYLIB1_SPEC },                              \
+  /* APPLE LOCAL LLVM  
*/                                                \
+  { "darwin_dsymutil", DARWIN_DSYMUTIL_SPEC },

  #define  
DARWIN_DYLIB1_SPEC                                             \
    "%:version-compare(!> 10.5 mmacosx-version-min= - 
ldylib1.o)          \
@@ -576,9 +587,15 @@ do {                                       \
  #define DBX_DEBUGGING_INFO 1

  /* Prefer DWARF2.  */
+/* APPLE LOCAL begin llvm */
+/* Prefer DWARF only if appropriate dsymutil is available.  */
  #define DWARF2_DEBUGGING_INFO
+#ifdef HAVE_DSYMUTIL
  #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
+#else
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#endif
+/* APPLE LOCAL end llvm */
  /* APPLE LOCAL end for-fsf-4_3 4370143 */
  /* APPLE LOCAL begin mainline 2006-03-16 dwarf2 section flags */
  #define DEBUG_FRAME_SECTION    "__DWARF,__debug_frame,regular,debug"




More information about the llvm-commits mailing list