From 124c6c0c1367c8bec90e9b7c7a6064b01c4f5d13 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 14 Dec 2007 18:00:35 +0000 Subject: [PATCH] * always let mangled names start with an underscore on Mac OS X, because otherwise the linker does not generate the necessary debug map information for global variables when using dwarf git-svn-id: trunk@9447 - --- compiler/symdef.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 26c4f9daf5..68c2b04a34 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -820,8 +820,11 @@ implementation if suffix<>'' then result:=result+'_'+suffix; { the Darwin assembler assumes that all symbols starting with 'L' are local } - if (target_info.system in systems_darwin) and - (result[1] = 'L') then + { Further, the Mac OS X 10.5 linker does not consider symbols which do not } + { start with '_' as regular symbols (it does not generate N_GSYM entries } + { those in the debug map, leading to troubles with dsymutil). So always } + { add an underscore on darwin. } + if (target_info.system in systems_darwin) then result := '_' + result; end;