rpms/fpc/devel fpc-2.2.0-DWARF_Patch_r8847.diff, NONE, 1.1 fpc.spec, 1.25, 1.26

Joost van der Sluis (joost) fedora-extras-commits at redhat.com
Thu Apr 17 16:44:04 UTC 2008


Author: joost

Update of /cvs/pkgs/rpms/fpc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4563

Modified Files:
	fpc.spec 
Added Files:
	fpc-2.2.0-DWARF_Patch_r8847.diff 
Log Message:
* Wed Apr 16 2008 Joost van der Sluis <joost at cnoc.nl> 2.2.0-12
- Fix for DWARF-debug generation - fixes some more build problems on x86_64 and F9, bugzilla 337051


fpc-2.2.0-DWARF_Patch_r8847.diff:

--- NEW FILE fpc-2.2.0-DWARF_Patch_r8847.diff ---
--- fpcsrc/compiler/dbgdwarf.pas.org	2008-04-17 17:32:10.000000000 +0200
+++ fpcsrc/compiler/dbgdwarf.pas	2008-04-17 17:32:23.000000000 +0200
@@ -37,7 +37,7 @@
 interface
 
     uses
-      cclasses,
+      cclasses,globtype,
       aasmbase,aasmtai,aasmdata,
       symbase,symtype,symdef,symsym,
       finput,
@@ -221,6 +221,7 @@
         function def_dwarf_class_struct_lab(def:tobjectdef) : tasmsymbol;
         function get_file_index(afile: tinputfile): Integer;
         procedure write_symtable_syms(st:TSymtable);
+	function clean_dwarf_path(const s:tcmdstr):tcmdstr;
       protected
         // set if we should use 64bit headers (dwarf3 and up)
         _use_64bit_headers: Boolean;
@@ -331,8 +332,8 @@
 implementation
 
     uses
-      cutils,cfileutils,
-      version,globtype,globals,verbose,systems,
+      sysutils,cutils,cfileutils,
+      version,globals,verbose,systems,
       cpubase,cgbase,paramgr,
       fmodule,
       defutil,symconst,symtable
@@ -622,6 +623,14 @@
                               TDebugInfoDwarf
 ****************************************************************************}
 
+    function TDebugInfoDwarf.clean_dwarf_path(const s:tcmdstr):tcmdstr;
+      begin
+        { Make a clean path for gdb. Remove trailing / and ./ prefixes and
+	  use always a / }
+        result:=BsToSlash(ExcludeTrailingPathDelimiter(ExtractRelativePath('.',s)));
+      end;
+
+
     procedure TDebugInfoDwarf.set_use_64bit_headers(state: boolean);
       begin
          _use_64bit_headers:=state;
@@ -2233,7 +2242,8 @@
             ditem := TDirIndexItem(dirlist[n]);
             if ditem.Name = '.' then
               Continue;
-            linelist.concat(tai_string.create(ditem.Name+#0));
+            { Write without trailing path delimiter and also don't prefix with ./ for current dir }
+            linelist.concat(tai_string.create(clean_dwarf_path(ditem.Name)+#0));
           end;
         linelist.concat(tai_const.create_8bit(0));
 
@@ -2356,9 +2366,9 @@
 
         { first manadatory compilation unit TAG }
         append_entry(DW_TAG_compile_unit,true,[
-          DW_AT_name,DW_FORM_string,FixFileName(current_module.sourcefiles.get_file(1).name^)+#0,
+          DW_AT_name,DW_FORM_string,clean_dwarf_path(FixFileName(current_module.sourcefiles.get_file(1).path^+current_module.sourcefiles.get_file(1).name^))+#0,
           DW_AT_producer,DW_FORM_string,'Free Pascal '+full_version_string+' '+date_string+#0,
-          DW_AT_comp_dir,DW_FORM_string,BsToSlash(FixPath(current_module.sourcefiles.get_file(1).path^,false))+#0,
+          DW_AT_comp_dir,DW_FORM_string,clean_dwarf_path(FixPath(GetCurrentDir,false))+#0,
           DW_AT_language,DW_FORM_data1,DW_LANG_Pascal83,
           DW_AT_identifier_case,DW_FORM_data1,DW_ID_case_insensitive]);
 


Index: fpc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/fpc/devel/fpc.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- fpc.spec	19 Feb 2008 06:57:30 -0000	1.25
+++ fpc.spec	17 Apr 2008 16:43:26 -0000	1.26
@@ -4,7 +4,7 @@
 
 Name:           fpc
 Version:        2.2.0
-Release:        11%{?dist}
+Release:        12%{?dist}
 Summary:        Free Pascal Compiler
 
 Group:          Development/Languages
@@ -17,6 +17,7 @@
 Patch0:         %{name}-%{version}-samplecfg_32and64bit.patch
 Patch1:         %{name}-%{version}-build-id.patch
 Patch2:         %{name}-%{version}-fpcdocs.patch
+Patch3:         %{name}-%{version}-DWARF_Patch_r8847.diff
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires:       gpm, glibc, ncurses, binutils
@@ -81,6 +82,7 @@
 %patch0
 %patch1
 %patch2
+%patch3
 
 %build
 # The source-files:
@@ -192,6 +194,9 @@
 %{_datadir}/fpcsrc
 
 %changelog
+* Wed Apr 16 2008 Joost van der Sluis <joost at cnoc.nl> 2.2.0-12
+- Fix for DWARF-debug generation - fixes some more build problems on x86_64 and F9, bugzilla 337051
+
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 2.2.0-11
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list