re PR debug/53453 (darwin linker expects both AT_name and AT_comp_dir debug notes)
authorJack Howarth <howarth@bromo.med.uc.edu>
Tue, 29 May 2012 23:44:09 +0000 (23:44 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Tue, 29 May 2012 23:44:09 +0000 (23:44 +0000)
2012-05-29  Jack Howarth  <howarth@bromo.med.uc.edu>

PR debug/53453
* doc/tm.texi: Update.
* doc/tm.texi.in (SDB and DWARF) <TARGET_FORCE_AT_COMP_DIR>: Add @hook.
* target.def (force_at_comp_dir): New hook.
* config/darwin.h (TARGET_FORCE_AT_COMP_DIR): Define.
* dwarf2out.c (dwarf2out_finish): Check targetm.force_at_comp_dir.

From-SVN: r187994

gcc/ChangeLog
gcc/config/darwin.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/dwarf2out.c
gcc/target.def

index ea8f7ec0a790c37394f251bcda4235dda7d3ae14..68b37a07bf9ec10c6f33ae675f902a918905c55f 100644 (file)
@@ -1,3 +1,12 @@
+2012-05-29  Jack Howarth  <howarth@bromo.med.uc.edu>
+
+       PR debug/53453
+       * doc/tm.texi: Update.
+       * doc/tm.texi.in (SDB and DWARF) <TARGET_FORCE_AT_COMP_DIR>: Add @hook.
+       * target.def (force_at_comp_dir): New hook.
+       * config/darwin.h (TARGET_FORCE_AT_COMP_DIR): Define.
+       * dwarf2out.c (dwarf2out_finish): Check targetm.force_at_comp_dir.
+
 2012-05-29  Jack Howarth  <howarth@bromo.med.uc.edu>
 
        * config/darwin.h (STARTFILE_SPEC): Do not use -lbundle1.o when
index 80ff0b060b736512e7737b85d9cfda6f61afa963..5855778109d0321e2fcf0ee0cd7bad7bdbd26fc0 100644 (file)
@@ -416,6 +416,8 @@ extern GTY(()) int darwin_ms_struct;
 
 #define TARGET_WANT_DEBUG_PUB_SECTIONS true
 
+#define TARGET_FORCE_AT_COMP_DIR true
+
 /* When generating stabs debugging, use N_BINCL entries.  */
 
 #define DBX_USE_BINCL
index f7b2838efd84986b55815a019cb847d2528850f0..aeccc79f39f936ea0c01ad2e88d65b4acc1eed2a 100644 (file)
@@ -9493,6 +9493,10 @@ tables, and hence is desirable if it works.
 True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted.  These sections are not used on most platforms, and in particular GDB does not use them.
 @end deftypevr
 
+@deftypevr {Target Hook} bool TARGET_FORCE_AT_COMP_DIR
+True if the @code{DW_AT_comp_dir} attribute should be emitted for each  compilation unit.  This attribute is required for the darwin linker  to emit debug information.
+@end deftypevr
+
 @deftypevr {Target Hook} bool TARGET_DELAY_SCHED2
 True if sched2 is not to be run at its normal place.  This usually means it will be run as part of machine-specific reorg.
 @end deftypevr
index a54b2298f4b33bb6d9f38ff68af7d47cd8d375a7..31dedad8a228e7e5ece059e0cfffc1e5ccfec582 100644 (file)
@@ -9392,6 +9392,8 @@ tables, and hence is desirable if it works.
 
 @hook TARGET_WANT_DEBUG_PUB_SECTIONS
 
+@hook TARGET_FORCE_AT_COMP_DIR
+
 @hook TARGET_DELAY_SCHED2
 
 @hook TARGET_DELAY_VARTRACK
index b233d30ce460715772f0f1586d663728d6fd57f7..6085a947541be2d260f12aa5d653256c10c64561 100644 (file)
@@ -22078,7 +22078,7 @@ dwarf2out_finish (const char *filename)
   /* Add the name for the main input file now.  We delayed this from
      dwarf2out_init to avoid complications with PCH.  */
   add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
-  if (!IS_ABSOLUTE_PATH (filename))
+  if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir)
     add_comp_dir_attribute (comp_unit_die ());
   else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL)
     {
index fd2bf8a7e33df4290d9b9682b946d0915f2b2090..3463600f99ac930126fb38d6be702a68317e080a 100644 (file)
@@ -2748,6 +2748,13 @@ DEFHOOKPOD
  in particular GDB does not use them.",
  bool, false)
 
+DEFHOOKPOD
+(force_at_comp_dir,
+ "True if the @code{DW_AT_comp_dir} attribute should be emitted for each \
+ compilation unit.  This attribute is required for the darwin linker \
+ to emit debug information.",
+ bool, false)
+
 DEFHOOKPOD
 (delay_sched2, "True if sched2 is not to be run at its normal place.  \
 This usually means it will be run as part of machine-specific reorg.",