mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-25 08:11:29 +02:00
+ enable linker map file creation for the llvm WebAssembly linker. Note: this requires LLVM 12, which is not yet released.
git-svn-id: branches/wasm@48249 -
This commit is contained in:
parent
062360341c
commit
23e7e9530e
@ -74,6 +74,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
SysUtils,
|
||||||
verbose;
|
verbose;
|
||||||
|
|
||||||
{ timportlibwasi }
|
{ timportlibwasi }
|
||||||
@ -91,7 +92,7 @@ end;
|
|||||||
|
|
||||||
procedure tlinkerwasi.SetDefaultInfo;
|
procedure tlinkerwasi.SetDefaultInfo;
|
||||||
begin
|
begin
|
||||||
Info.DllCmd[1] := 'wasm-ld $SONAME $GCSECTIONS -o $EXE';
|
Info.DllCmd[1] := 'wasm-ld $SONAME $GCSECTIONS $MAP -o $EXE';
|
||||||
//Info.DllCmd[2] := 'wasmtool --exportrename $INPUT $EXE';
|
//Info.DllCmd[2] := 'wasmtool --exportrename $INPUT $EXE';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -111,6 +112,10 @@ begin
|
|||||||
if not(cs_link_nolink in current_settings.globalswitches) then
|
if not(cs_link_nolink in current_settings.globalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename);
|
Message1(exec_i_linking,current_module.exefilename);
|
||||||
|
|
||||||
|
{ Create some replacements }
|
||||||
|
mapstr:='';
|
||||||
|
if (cs_link_map in current_settings.globalswitches) then
|
||||||
|
mapstr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.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'
|
||||||
@ -143,7 +148,7 @@ begin
|
|||||||
//Replace(cmdstr,'$INIT',InitStr);
|
//Replace(cmdstr,'$INIT',InitStr);
|
||||||
//Replace(cmdstr,'$FINI',FiniStr);
|
//Replace(cmdstr,'$FINI',FiniStr);
|
||||||
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