Skip to content

[NativeAOT-LLVM] 'wasi' Linker options #3194

@cyraid

Description

@cyraid

I'd like to include my own --max-memory and --initial-memory, could you change:

<IlcWasmGlobalBase>1024</IlcWasmGlobalBase>
<!-- ... -->
<CustomLinkerArg Include="-Wl,--max-memory=2147483648" />
<CustomLinkerArg Include="-Wl,--global-base=$(IlcWasmGlobalBase)" />

to

<IlcWasmGlobalBase Condition="'$(IlcWasmGlobalBase)' == ''">1024</IlcWasmGlobalBase>
<!-- ... -->
<CustomLinkerArg Include="-Wl,--initial-memory=$(EmccInitialHeapSize)" Condition="'(EmccInitialHeapSize)' != ''" />
<CustomLinkerArg Include="-Wl,--max-memory=$(EmccMaximumHeapSize)" Condition="'(EmccMaximumHeapSize)' != ''" />
<CustomLinkerArg Include="-Wl,--max-memory=2147483648" Condition="'(EmccMaximumHeapSize)' == ''" />
<CustomLinkerArg Include="-Wl,--global-base=$(IlcWasmGlobalBase)" Condition="'$(IlcWasmGlobalBase)' != ''" />

The EmccInitialHeapSize/EmccMaximumHeapSize are used in the browser-wasm for initial/max size, why not have them? So that we can include things like --relocatable (if it came to that, I know there's other things that need to be changed).

Can you also make the linking another target, so we can bootstrap more of the things in LinkNativeLlvm in the future if we need to?

Edit: Ultimately it'd be nice to be able to link a wasm created with this with another wasm with the linker. But it complains about not being relocatable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions