diff options
author | Andrey Ponomarenko <aponomarenko@rosalab.ru> | 2013-05-24 16:48:30 +0400 |
---|---|---|
committer | Andrey Ponomarenko <aponomarenko@rosalab.ru> | 2013-05-24 16:48:30 +0400 |
commit | fe00e7ef2a23c401d9cdfd47b1523bc9ec711ed0 (patch) | |
tree | 405e08c067a46c9e67809454a4506ccdfe0c0e90 /modules/Internals | |
parent | c8471239281e3b994d99d3f1c0fcf6eb3bbd4f7a (diff) | |
download | abi-compliance-checker-fe00e7ef2a23c401d9cdfd47b1523bc9ec711ed0.tar.gz |
ABI Compliance Checker 1.99
Diffstat (limited to 'modules/Internals')
-rw-r--r-- | modules/Internals/CallConv.pm | 173 | ||||
-rw-r--r-- | modules/Internals/RegTests.pm | 208 |
2 files changed, 320 insertions, 61 deletions
diff --git a/modules/Internals/CallConv.pm b/modules/Internals/CallConv.pm index a2255e1..23390e7 100644 --- a/modules/Internals/CallConv.pm +++ b/modules/Internals/CallConv.pm @@ -48,7 +48,7 @@ sub classifyType($$$$$) $Classes{0}{"Class"} = "VOID"; return %Classes; } - if($System=~/\A(linux|macos|freebsd)\Z/) + if($System=~/\A(unix|linux|macos|freebsd)\Z/) { # GCC if($Arch eq "x86") { @@ -175,7 +175,11 @@ sub classifyAggregate($$$$$) } foreach my $Pos (0 .. $Max) { - $Type{"Memb"}{$Pos}{"algn"} = getTypeAlgn($BaseType{"Tid"}, $TInfo); + # if($TInfo->{1}{"Name"} eq "void") + # { # DWARF ABI Dump + # $Type{"Memb"}{$Pos}{"offset"} = $Type{"Size"}/($Max+1); + # } + $Type{"Memb"}{$Pos}{"algn"} = getAlignment_Model($BaseType{"Tid"}, $TInfo, $Arch); $Type{"Memb"}{$Pos}{"type"} = $BaseType{"Tid"}; $Type{"Memb"}{$Pos}{"name"} = "[$Pos]"; } @@ -192,7 +196,7 @@ sub classifyAggregate($$$$$) { # Struct, Class foreach my $Pos (keys(%{$Type{"Memb"}})) { - my $Offset = getOffset($Pos, \%Type, $TInfo, $Word)/$BYTE; + my $Offset = getOffset($Pos, \%Type, $TInfo, $Arch, $Word)/$BYTE; $Offsets{$Pos} = $Offset; my $GroupOffset = int($Offset/$Word)*$Word; $Group{$GroupOffset}{$Pos} = 1; @@ -281,7 +285,7 @@ sub postMerger($$$) my $Class1 = $PreClasses->{$Offset1}{"Class"}; my $Class2 = $PreClasses->{$Offset2}{"Class"}; my $ResClass = ""; - if($System=~/\A(linux|macos|freebsd)\Z/) + if($System=~/\A(unix|linux|macos|freebsd)\Z/) { # GCC if($Arch eq "x86_64") { @@ -381,7 +385,7 @@ sub callingConvention_R_I_Model($$$$$$) next; } - if($System=~/\A(linux|macos|freebsd)\Z/) + if($System=~/\A(unix|linux|macos|freebsd)\Z/) { # GCC if($Arch eq "x86") { @@ -556,7 +560,7 @@ sub usedBy($$) sub useHidden($$$$) { my ($SInfo, $Arch, $System, $Word) = @_; - if($System=~/\A(linux|macos|freebsd)\Z/) + if($System=~/\A(unix|linux|macos|freebsd)\Z/) { # GCC if($Arch eq "x86") { pushStack_R($SInfo, $Word); @@ -585,11 +589,19 @@ sub pushStack_P($$$$) my ($SInfo, $Pos, $TInfo, $StackAlgn) = @_; my $PTid = $SInfo->{"Param"}{$Pos}{"type"}; my $PName = $SInfo->{"Param"}{$Pos}{"name"}; - my $Alignment = $SInfo->{"Param"}{$Pos}{"algn"}; - if($Alignment<$StackAlgn) { - $Alignment = $StackAlgn; + + if(my $Offset = $SInfo->{"Param"}{$Pos}{"offset"}) + { # DWARF ABI Dump + return pushStack_Offset($SInfo, $Offset, $TInfo->{$PTid}{"Size"}, { 0 => $PName }); + } + else + { + my $Alignment = $SInfo->{"Param"}{$Pos}{"algn"}; + if($Alignment<$StackAlgn) { + $Alignment = $StackAlgn; + } + return pushStack($SInfo, $Alignment, $TInfo->{$PTid}{"Size"}, { 0 => $PName }); } - return pushStack($SInfo, $Alignment, $TInfo->{$PTid}{"Size"}, { 0 => $PName }); } sub pushStack_R($$) @@ -614,6 +626,12 @@ sub pushStack($$$$) $Offset += $UsedStack{$SInfo}{$Offset}{"Size"}; $Offset += getPadding($Offset, $Algn); } + return pushStack_Offset($SInfo, $Offset, $Size, $Elem); +} + +sub pushStack_Offset($$$$) +{ + my ($SInfo, $Offset, $Size, $Elem) = @_; my %Info = ( "Size" => $Size, "Elem" => $Elem @@ -733,7 +751,7 @@ sub callingConvention_P_I_Model($$$$$$$) next; } - if($System=~/\A(linux|macos|freebsd)\Z/) + if($System=~/\A(unix|linux|macos|freebsd)\Z/) { # GCC if($Arch eq "x86") { @@ -880,15 +898,15 @@ sub callingConvention_P_I_Model($$$$$$$) return %Conv; } -sub getTypeAlgn($$) +sub getAlignment_Model($$$) { - my ($Tid, $TInfo) = @_; + my ($Tid, $TInfo, $Arch) = @_; if(defined $TInfo->{$Tid}{"Algn"}) { return $TInfo->{$Tid}{"Algn"}; } else - { # support for old ABI dumps - if($TInfo->{$Tid}{"Type"}=~/Struct|Class|Union/) + { + if($TInfo->{$Tid}{"Type"}=~/Struct|Class|Union|MethodPtr/) { if(defined $TInfo->{$Tid}{"Memb"}) { @@ -896,7 +914,10 @@ sub getTypeAlgn($$) foreach my $Pos (keys(%{$TInfo->{$Tid}{"Memb"}})) { my $Algn = $TInfo->{$Tid}{"Memb"}{$Pos}{"algn"}; - if($Algn>$Algn) { + if(not $Algn) { + $Algn = getAlignment_Model($TInfo->{$Tid}{"Memb"}{$Pos}{"type"}, $TInfo, $Arch); + } + if($Algn>$Max) { $Max = $Algn; } } @@ -907,23 +928,64 @@ sub getTypeAlgn($$) elsif($TInfo->{$Tid}{"Type"} eq "Array") { my %Base = get_OneStep_BaseType($Tid, $TInfo); - return getTypeAlgn($Base{"Tid"}, $TInfo); + return getAlignment_Model($Base{"Tid"}, $TInfo, $Arch); } - elsif($TInfo->{$Tid}{"Type"}=~/Intrinsic|Enum|Pointer|Ptr/) + elsif($TInfo->{$Tid}{"Type"}=~/Intrinsic|Enum|Pointer|FuncPtr/) { # model - return $TInfo->{$Tid}{"Size"}; + return getInt_Algn($Tid, $TInfo, $Arch); } else { my %PureType = get_PureType($Tid, $TInfo); - return getTypeAlgn($PureType{"Tid"}, $TInfo); + return getAlignment_Model($PureType{"Tid"}, $TInfo, $Arch); + } + } +} + +my %IntAlgn = ( + "x86"=>( + "double"=>4, + "long double"=>4 + ) +); + +sub getInt_Algn($$$) +{ + my ($Tid, $TInfo, $Arch) = @_; + my $Name = $TInfo->{$Tid}{"Name"}; + if(my $Algn = $IntAlgn{$Arch}{$Name}) { + return $Algn; + } + else + { + my $Size = $TInfo->{$Tid}{"Size"}; + if($Arch eq "x86_64") + { # x86_64: sizeof==alignment + return $Size; + } + elsif($Arch eq "arm") + { + if($Size>8) + { # 128-bit vector (16) + return 8; + } + return $Size; + } + elsif($Arch eq "x86") + { + if($Size>4) + { # "double" (8) and "long double" (12) + return 4; + } + return $Size; } + return $Size; } } -sub getAlignment($$$$) +sub getAlignment($$$$$) { - my ($Pos, $TypePtr, $TInfo, $Word) = @_; + my ($Pos, $TypePtr, $TInfo, $Arch, $Word) = @_; my $Tid = $TypePtr->{"Memb"}{$Pos}{"type"}; my %Type = get_PureType($Tid, $TInfo); my $Computed = $TypePtr->{"Memb"}{$Pos}{"algn"}; @@ -935,6 +997,16 @@ sub getAlignment($$$$) { # real in bits $Alignment = $Computed; } + else + { # model + if($BSize eq $Type{"Size"}*$BYTE) + { + $Alignment = $BSize; + } + else { + $Alignment = 1; + } + } return ($Alignment, $BSize); } else @@ -945,22 +1017,31 @@ sub getAlignment($$$$) } else { # model - $Alignment = $Type{"Size"}*$BYTE; + $Alignment = getAlignment_Model($Tid, $TInfo, $Arch)*$BYTE; } return ($Alignment, $Type{"Size"}*$BYTE); } } -sub getOffset($$$$) +sub getOffset($$$$$) { # offset of the field including padding - my ($FieldPos, $TypePtr, $TInfo, $Word) = @_; - my $Offset = 0; + my ($FieldPos, $TypePtr, $TInfo, $Arch, $Word) = @_; + + if($TypePtr->{"Type"} eq "Union") { + return 0; + } + # if((my $Off = $TypePtr->{"Memb"}{$FieldPos}{"offset"}) ne "") + # { # DWARF ABI Dump (generated by the ABI Dumper tool) + # return $Off*$BYTE; + # } + + my $Offset = 0; my $Buffer=0; foreach my $Pos (0 .. keys(%{$TypePtr->{"Memb"}})-1) { - my ($Alignment, $MSize) = getAlignment($Pos, $TypePtr, $TInfo, $Word); + my ($Alignment, $MSize) = getAlignment($Pos, $TypePtr, $TInfo, $Arch, $Word); if(not $Alignment) { # support for old ABI dumps @@ -993,7 +1074,7 @@ sub getOffset($$$$) } $Offset += $MSize; } - return $FieldPos;# if something is going wrong + return $FieldPos; # if something is going wrong } sub getPadding($$) @@ -1010,7 +1091,7 @@ sub getPadding($$) sub isMemPadded($$$$$$) { # check if the target field can be added/removed/changed # without shifting other fields because of padding bits - my ($FieldPos, $Size, $TypePtr, $Skip, $TInfo, $Word) = @_; + my ($FieldPos, $Size, $TypePtr, $Skip, $TInfo, $Arch, $Word) = @_; return 0 if($FieldPos==0); delete($TypePtr->{"Memb"}{""}); my $Offset = 0; @@ -1028,7 +1109,7 @@ sub isMemPadded($$$$$$) next; } } - ($Alignment{$Pos}, $MSize{$Pos}) = getAlignment($Pos, $TypePtr, $TInfo, $Word); + ($Alignment{$Pos}, $MSize{$Pos}) = getAlignment($Pos, $TypePtr, $TInfo, $Arch, $Word); if($Alignment{$Pos}>$MaxAlgn) { $MaxAlgn = $Alignment{$Pos}; } @@ -1157,19 +1238,16 @@ sub callingConvention_R_Real($) my %Conv = (); my %Regs = (); my $Hidden = 0; - foreach my $Reg (keys(%{$SInfo->{"Reg"}})) + foreach my $Elem (keys(%{$SInfo->{"Reg"}})) { - - foreach my $Elem (keys(%{$SInfo->{"Reg"}{$Reg}})) + my $Reg = $SInfo->{"Reg"}{$Elem}; + if($Elem eq ".result_ptr") { - if($Elem eq ".result_ptr") - { - $Hidden = 1; - $Regs{$Reg}=1; - } - elsif(index($Elem, ".result")==0) { - $Regs{$Reg}=1; - } + $Hidden = 1; + $Regs{$Reg} = 1; + } + elsif(index($Elem, ".result")==0) { + $Regs{$Reg} = 1; } } if(my @R = sort keys(%Regs)) @@ -1191,18 +1269,13 @@ sub callingConvention_R_Real($) sub callingConvention_P_Real($$) { my ($SInfo, $Pos) = @_; - my $PName = $SInfo->{"Param"}{$Pos}{"name"}; my %Conv = (); my %Regs = (); - my $Hidden = 0; - foreach my $Reg (keys(%{$SInfo->{"Reg"}})) + foreach my $Elem (keys(%{$SInfo->{"Reg"}})) { - - foreach my $Elem (keys(%{$SInfo->{"Reg"}{$Reg}})) - { - if($Elem=~/\A$PName(\.|\Z)/) { - $Regs{$Reg}=1; - } + my $Reg = $SInfo->{"Reg"}{$Elem}; + if($Elem=~/\A$Pos([\.\+]|\Z)/) { + $Regs{$Reg} = 1; } } if(my @R = sort keys(%Regs)) diff --git a/modules/Internals/RegTests.pm b/modules/Internals/RegTests.pm index 87b1eab..9bcecc2 100644 --- a/modules/Internals/RegTests.pm +++ b/modules/Internals/RegTests.pm @@ -71,6 +71,26 @@ sub testCpp() $SOURCE1 .= "namespace TestNS {\n"; $SOURCE2 .= "namespace TestNS {\n"; + # Removed inline method + $HEADER1 .= " + class $DECL_SPEC RemovedInlineMethod { + public: + int someMethod(); + inline int removedMethod() { return 0; }; + int field; + };"; + $SOURCE1 .= " + int RemovedInlineMethod::someMethod() { return removedMethod(); }"; + + $HEADER2 .= " + class $DECL_SPEC RemovedInlineMethod { + public: + int someMethod(); + int field; + };"; + $SOURCE2 .= " + int RemovedInlineMethod::someMethod() { return 0; }"; + # Pure_Virtual_Replacement $HEADER1 .= " class $DECL_SPEC PureVirtualReplacement { @@ -144,6 +164,24 @@ sub testCpp() $HEADER1 .= " inline int removedInlineFunction(int param) { return 0; }"; + # Became Non-Opaque + $HEADER1 .= " + struct OpaqueStruct; + int paramBecameNonOpaque(OpaqueStruct* p);"; + $SOURCE1 .= " + int paramBecameNonOpaque(OpaqueStruct* p) { return 0; }"; + + $HEADER2 .= " + struct OpaqueStruct + { + int i; + short j; + OpaqueStruct(); + }; + int paramBecameNonOpaque(OpaqueStruct* p);"; + $SOURCE2 .= " + int paramBecameNonOpaque(OpaqueStruct* p) { return 0; }"; + # Field_Became_Const # Typedef $HEADER1 .= " @@ -206,6 +244,46 @@ sub testCpp() $SOURCE2 .= " int FieldBecameConst::method() { return 0; }"; + # Field_Became_Private + $HEADER1 .= " + class $DECL_SPEC FieldBecamePrivate { + public: + int* f; + int method(); + };"; + $SOURCE1 .= " + int FieldBecamePrivate::method() { return 0; }"; + + $HEADER2 .= " + class $DECL_SPEC FieldBecamePrivate { + private: + int* f; + public: + int method(); + };"; + $SOURCE2 .= " + int FieldBecamePrivate::method() { return 0; }"; + + # Field_Became_Protected + $HEADER1 .= " + class $DECL_SPEC FieldBecameProtected { + public: + int* f; + int method(); + };"; + $SOURCE1 .= " + int FieldBecameProtected::method() { return 0; }"; + + $HEADER2 .= " + class $DECL_SPEC FieldBecameProtected { + protected: + int* f; + public: + int method(); + };"; + $SOURCE2 .= " + int FieldBecameProtected::method() { return 0; }"; + # Global_Data_Became_Private $HEADER1 .= " class $DECL_SPEC GlobalDataBecamePrivate { @@ -408,7 +486,7 @@ sub testCpp() $SOURCE2 .= " int ParameterBecameRestrict::method(int* __restrict param) { return 0; }"; - # Parameter_Became_NonRestrict + # Parameter_Became_Non_Restrict $HEADER1 .= " class $DECL_SPEC ParameterBecameNonRestrict { public: @@ -444,7 +522,7 @@ sub testCpp() $SOURCE2 .= " int FieldBecameVolatile::method(int param) { return param; }"; - # Field_Became_NonVolatile + # Field_Became_Non_Volatile $HEADER1 .= " class $DECL_SPEC FieldBecameNonVolatile { public: @@ -482,7 +560,7 @@ sub testCpp() $SOURCE2 .= " int FieldBecameMutable::method(int param) { return param; }"; - # Field_Became_NonMutable + # Field_Became_Non_Mutable $HEADER1 .= " class $DECL_SPEC FieldBecameNonMutable { public: @@ -536,7 +614,7 @@ sub testCpp() $SOURCE2 .= " int MethodBecameConst::method(int param) const { return param; }"; - # Method_Became_NonConst + # Method_Became_Non_Const $HEADER1 .= " class $DECL_SPEC MethodBecameNonConst { public: @@ -729,6 +807,38 @@ sub testCpp() $SOURCE2 .= " int parameterTypeFormat_Safe(class DType param) { return 0; }"; + # Type_Became_Opaque (Struct) + $HEADER1 .= " + struct StructBecameOpaque + { + int i, j; + }; + $DECL_SPEC int structBecameOpaque(struct StructBecameOpaque* param);"; + $SOURCE1 .= " + int structBecameOpaque(struct StructBecameOpaque* param) { return 0; }"; + + $HEADER2 .= " + struct StructBecameOpaque; + $DECL_SPEC int structBecameOpaque(struct StructBecameOpaque* param);"; + $SOURCE2 .= " + int structBecameOpaque(struct StructBecameOpaque* param) { return 0; }"; + + # Type_Became_Opaque (Union) + $HEADER1 .= " + union UnionBecameOpaque + { + int i, j; + }; + $DECL_SPEC int unionBecameOpaque(union UnionBecameOpaque* param);"; + $SOURCE1 .= " + int unionBecameOpaque(union UnionBecameOpaque* param) { return 0; }"; + + $HEADER2 .= " + union UnionBecameOpaque; + $DECL_SPEC int unionBecameOpaque(union UnionBecameOpaque* param);"; + $SOURCE2 .= " + int unionBecameOpaque(union UnionBecameOpaque* param) { return 0; }"; + # Field_Type_Format $HEADER1 .= " struct DType1 @@ -760,6 +870,29 @@ sub testCpp() $SOURCE2 .= " int fieldTypeFormat(struct FieldTypeFormat param) { return 0; }"; + # Field_Type_Format (func ptr) + $HEADER1 .= " + typedef void (*FuncPtr_Old) (int a); + struct FieldTypeFormat_FuncPtr + { + int i; + FuncPtr_Old j; + }; + $DECL_SPEC int fieldTypeFormat_FuncPtr(struct FieldTypeFormat_FuncPtr param);"; + $SOURCE1 .= " + int fieldTypeFormat_FuncPtr(struct FieldTypeFormat_FuncPtr param) { return 0; }"; + + $HEADER2 .= " + typedef void (*FuncPtr_New) (int a, int b); + struct FieldTypeFormat_FuncPtr + { + int i; + FuncPtr_New j; + }; + $DECL_SPEC int fieldTypeFormat_FuncPtr(struct FieldTypeFormat_FuncPtr param);"; + $SOURCE2 .= " + int fieldTypeFormat_FuncPtr(struct FieldTypeFormat_FuncPtr param) { return 0; }"; + # Removed_Virtual_Method (inline) $HEADER1 .= " class $DECL_SPEC RemovedInlineVirtualFunction { @@ -1056,6 +1189,7 @@ sub testCpp() $HEADER1 .= " class $DECL_SPEC RemovedVirtualFunction { public: + int a, b, c; virtual int removedMethod(int param); virtual int vMethod(int param); };"; @@ -1066,6 +1200,7 @@ sub testCpp() $HEADER2 .= " class $DECL_SPEC RemovedVirtualFunction { public: + int a, b, c; int removedMethod(int param); virtual int vMethod(int param); };"; @@ -2306,7 +2441,7 @@ sub testCpp() $SOURCE2 .= " MethodBecameStatic MethodBecameStatic::becameStatic(MethodBecameStatic param) { return param; }"; - # Method_Became_NonStatic + # Method_Became_Non_Static $HEADER1 .= " struct $DECL_SPEC MethodBecameNonStatic { @@ -2809,6 +2944,21 @@ sub testC() my $DECL_SPEC = ($OSgroup eq "windows")?"__declspec( dllexport )":""; my $EXTERN = ($OSgroup eq "windows")?"extern ":""; # add "extern" for CL compiler + # Typedef to function + $HEADER1 .= " + typedef int(TypedefToFunction)(int pX); + + $DECL_SPEC int typedefToFunction(TypedefToFunction* p);"; + $SOURCE1 .= " + int typedefToFunction(TypedefToFunction* p) { return 0; }"; + + $HEADER2 .= " + typedef int(TypedefToFunction)(int pX, int pY); + + $DECL_SPEC int typedefToFunction(TypedefToFunction* p);"; + $SOURCE2 .= " + int typedefToFunction(TypedefToFunction* p) { return 0; }"; + # Used_Reserved $HEADER1 .= " typedef struct { @@ -2999,6 +3149,17 @@ sub testC() $SOURCE2 .= " char const*const returnTypeBecameConst3(int param) { return (char const*const)malloc(256); }"; + # Return_Type_Became_Volatile + $HEADER1 .= " + $DECL_SPEC char* returnTypeBecameVolatile(int param);"; + $SOURCE1 .= " + char* returnTypeBecameVolatile(int param) { return (char*)malloc(256); }"; + + $HEADER2 .= " + $DECL_SPEC volatile char* returnTypeBecameVolatile(int param);"; + $SOURCE2 .= " + volatile char* returnTypeBecameVolatile(int param) { return \"abc\"; }"; + # Added_Enum_Member $HEADER1 .= " enum AddedEnumMember { @@ -3068,7 +3229,7 @@ sub testC() $SOURCE2 .= " int arrayFieldSize(struct ArrayFieldSize param) { return 0; }"; - # Parameter_Became_NonVaList + # Parameter_Became_Non_VaList $HEADER1 .= " $DECL_SPEC int parameterNonVaList(int param, ...);"; $SOURCE1 .= " @@ -3729,6 +3890,17 @@ sub testC() $DECL_SPEC int parameterTypeAndSize(long long param, int other_param);"; $SOURCE2 .= " int parameterTypeAndSize(long long param, int other_param) { return other_param; }"; + + # Parameter_Type_And_Size + Parameter_Became_Non_Const + $HEADER1 .= " + $DECL_SPEC int parameterTypeAndSizeBecameNonConst(int* const param, int other_param);"; + $SOURCE1 .= " + int parameterTypeAndSizeBecameNonConst(int* const param, int other_param) { return other_param; }"; + + $HEADER2 .= " + $DECL_SPEC int parameterTypeAndSizeBecameNonConst(long double param, int other_param);"; + $SOURCE2 .= " + int parameterTypeAndSizeBecameNonConst(long double param, int other_param) { return other_param; }"; # Parameter_Type_And_Size (test calling conventions) $HEADER1 .= " @@ -3766,6 +3938,20 @@ sub testC() return *param; }"; + # Parameter_Became_Non_Const + Parameter_Became_Non_Volatile + $HEADER1 .= " + $DECL_SPEC int parameterBecameNonConstNonVolatile(int const volatile* param);"; + $SOURCE1 .= " + int parameterBecameNonConstNonVolatile(int const volatile* param) { return *param; }"; + + $HEADER2 .= " + $DECL_SPEC int parameterBecameNonConstNonVolatile(int* param);"; + $SOURCE2 .= " + int parameterBecameNonConstNonVolatile(int* param) { + *param=10; + return *param; + }"; + # Parameter_BaseType (Typedef) $HEADER1 .= " typedef int* PARAM_TYPEDEF; @@ -4386,7 +4572,7 @@ sub testC() }; #endif"; $SOURCE2 .= " - $DECL_SPEC int testCppKeywords(int class, int virtual) { return 0; }"; + $DECL_SPEC int testCppKeywords1(int class, int virtual) { return 0; }"; # Regression $HEADER1 .= " @@ -4525,12 +4711,12 @@ sub runTests($$$$$$$$) changedDefaultVersion; }; "); - $BuildCmd = $GCC_PATH." -Wl,--version-script version -shared libsample.$Ext -o libsample.$LIB_EXT"; + $BuildCmd = $GCC_PATH." -Wl,--version-script version -shared libsample.$Ext -o libsample.$LIB_EXT -g"; $BuildCmd_Test = $GCC_PATH." -Wl,--version-script version test.$Ext -Wl,libsample.$LIB_EXT -o test"; } else { - $BuildCmd = $GCC_PATH." -shared -x c++ libsample.$Ext -lstdc++ -o libsample.$LIB_EXT"; + $BuildCmd = $GCC_PATH." -shared -x c++ libsample.$Ext -lstdc++ -o libsample.$LIB_EXT -g"; $BuildCmd_Test = $GCC_PATH." -x c++ test.$Ext -lstdc++ -Wl,libsample.$LIB_EXT -o test"; } if(getArch(1)=~/\A(arm|x86_64)\Z/i) @@ -4557,12 +4743,12 @@ sub runTests($$$$$$$$) # symbian target if($Lang eq "C") { - $BuildCmd = $GCC_PATH." -shared libsample.$Ext -o libsample.$LIB_EXT"; + $BuildCmd = $GCC_PATH." -shared libsample.$Ext -o libsample.$LIB_EXT -g"; $BuildCmd_Test = $GCC_PATH." test.$Ext -Wl,libsample.$LIB_EXT -o test"; } else { # C++ - $BuildCmd = $GCC_PATH." -shared -x c++ libsample.$Ext -lstdc++ -o libsample.$LIB_EXT"; + $BuildCmd = $GCC_PATH." -shared -x c++ libsample.$Ext -lstdc++ -o libsample.$LIB_EXT -g"; $BuildCmd_Test = $GCC_PATH." -x c++ test.$Ext -Wl,libsample.$LIB_EXT -o test"; } } |