diff mbox

[Ada] Adjust path names in debug info

Message ID 4642528.yfCrZJd73B@polaris
State New
Headers show

Commit Message

Eric Botcazou Oct. 19, 2013, 11:45 a.m. UTC
This ensures the path names in the debug info of the library are consistent 
with those of libgcc.

Tested on x86_64-suse-linux, applied on the mainline.


2013-10-19  Thomas Quinot  <quinot@adacore.com>

	* gcc-interface/Makefile.in: Use canonical absolute path to refer to
	the top source directory and to the libgcc subidrectories.
diff mbox

Patch

Index: gcc-interface/Makefile.in
===================================================================
--- gcc-interface/Makefile.in	(revision 203844)
+++ gcc-interface/Makefile.in	(working copy)
@@ -167,6 +167,13 @@  tmake_file = @tmake_file@
 # Directory where sources are, from where we are.
 VPATH = $(srcdir)/ada
 
+# Full path to top source directory
+# In particular this is used to access libgcc headers, so that references to
+# these headers from GNAT runtime objects have path names in debugging info
+# that are consistent with libgcc objects.  Also used for other references to
+# the top source directory for consistency.
+ftop_srcdir := $(shell cd $(srcdir)/..;${PWD_COMMAND})
+
 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
 fcurdir := $(shell ${PWD_COMMAND})
@@ -262,7 +269,7 @@  TOOLS_LIBS = ../link.o ../targext.o ../.
 # Both . and srcdir are used, in that order,
 # so that tm.h and config.h will be found in the compilation
 # subdirectory rather than in the source directory.
-INCLUDES = -I- -I. -I.. -I$(srcdir)/ada -I$(srcdir) -I$(srcdir)/../include $(GMPINC)
+INCLUDES = -I- -I. -I.. -I$(srcdir)/ada -I$(srcdir) -I$(ftop_srcdir)/include $(GMPINC)
 
 ADA_INCLUDES = -I- -I. -I$(srcdir)/ada
 
@@ -272,11 +279,11 @@  ADA_INCLUDES = -I- -I. -I$(srcdir)/ada
 ifneq ($(findstring vxworks,$(target_os)),)
   INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
 			-iquote $(fsrcdir)/ada \
-			-I$(fsrcdir)/../include $(GMPINC)
+			-I$(ftop_srcdir)/include $(GMPINC)
 else
   INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
 			-iquote $(fsrcdir)/ada -iquote $(fsrcdir) \
-			-I$(fsrcdir)/../include $(GMPINC)
+			-I$(ftop_srcdir)/include $(GMPINC)
 endif
 
 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
@@ -3015,7 +3024,7 @@  vx_stack_info.o : vx_stack_info.c
 
 raise-gcc.o : raise-gcc.c raise.h
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-		-iquote $(srcdir) -iquote $(srcdir)/../libgcc \
+		-iquote $(srcdir) -iquote $(ftop_srcdir)/libgcc \
 		$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
 
 cio.o     : cio.c