mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 15:47:51 +02:00
+ allow creating a linker map file, when compiling for the wasm32-embedded target
This commit is contained in:
parent
078aa5d046
commit
9dfda963a3
@ -2155,7 +2155,7 @@ constructor TLinkerEmbedded_Wasm.Create;
|
|||||||
|
|
||||||
procedure TLinkerEmbedded_Wasm.SetDefaultInfo;
|
procedure TLinkerEmbedded_Wasm.SetDefaultInfo;
|
||||||
begin
|
begin
|
||||||
Info.DllCmd[1] := 'wasm-ld -m wasm32 $SONAME $GCSECTIONS -z stack-size=$STACKSIZE -o $EXE';
|
Info.DllCmd[1] := 'wasm-ld -m wasm32 $SONAME $GCSECTIONS $MAP -z stack-size=$STACKSIZE -o $EXE';
|
||||||
//Info.DllCmd[2] := 'wasmtool --exportrename $INPUT $EXE';
|
//Info.DllCmd[2] := 'wasmtool --exportrename $INPUT $EXE';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2174,6 +2174,9 @@ function TLinkerEmbedded_Wasm.MakeSharedLibrary: boolean;
|
|||||||
begin
|
begin
|
||||||
//Result := true;
|
//Result := true;
|
||||||
//Result:=inherited MakeSharedLibrary;
|
//Result:=inherited MakeSharedLibrary;
|
||||||
|
mapstr:='';
|
||||||
|
if (cs_link_map in current_settings.globalswitches) then
|
||||||
|
mapstr:='-Map '+maybequoted(ChangeFileExt(current_module.sharedlibfilename,'.map'));
|
||||||
if (cs_link_smart in current_settings.globalswitches) and
|
if (cs_link_smart in current_settings.globalswitches) and
|
||||||
create_smartlink_sections then
|
create_smartlink_sections then
|
||||||
GCSectionsStr:='--gc-sections'
|
GCSectionsStr:='--gc-sections'
|
||||||
@ -2207,7 +2210,7 @@ function TLinkerEmbedded_Wasm.MakeSharedLibrary: boolean;
|
|||||||
//Replace(cmdstr,'$FINI',FiniStr);
|
//Replace(cmdstr,'$FINI',FiniStr);
|
||||||
Replace(cmdstr,'$STACKSIZE',tostr(stacksize));
|
Replace(cmdstr,'$STACKSIZE',tostr(stacksize));
|
||||||
Replace(cmdstr,'$SONAME',SoNameStr);
|
Replace(cmdstr,'$SONAME',SoNameStr);
|
||||||
//Replace(cmdstr,'$MAP',mapstr);
|
Replace(cmdstr,'$MAP',mapstr);
|
||||||
//Replace(cmdstr,'$LTO',ltostr);
|
//Replace(cmdstr,'$LTO',ltostr);
|
||||||
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
||||||
writeln(utilsprefix+binstr,' ',cmdstr);
|
writeln(utilsprefix+binstr,' ',cmdstr);
|
||||||
|
Loading…
Reference in New Issue
Block a user