diff --git a/External/FEXCore/Source/Interface/Config/Config.json.in b/External/FEXCore/Source/Interface/Config/Config.json.in index f31025c76..84f9ddcf0 100644 --- a/External/FEXCore/Source/Interface/Config/Config.json.in +++ b/External/FEXCore/Source/Interface/Config/Config.json.in @@ -115,6 +115,13 @@ "This can be useful for setting environment variables that thunks can pick up.", "Typically isn't necessary since the guest libc isn't thunked. But is possible." ] + }, + "AdditionalArguments": { + "Type": "strarray", + "Default": "", + "Desc": [ + "Allows the user to pass additional arguments to the application" + ] } }, "Debug": { diff --git a/Source/Tests/ELFCodeLoader2.h b/Source/Tests/ELFCodeLoader2.h index 87524d97b..7fbd8eaa9 100644 --- a/Source/Tests/ELFCodeLoader2.h +++ b/Source/Tests/ELFCodeLoader2.h @@ -255,6 +255,11 @@ class ELFCodeLoader2 final : public FEXCore::CodeLoader { Args.erase(Args.begin()); } + // Append any additional arguments from config + for (auto &Arg : AdditionalArguments.All()) { + Args.emplace_back(Arg); + } + if (!MainElf.InterpreterElf.empty()) { if (!InterpElf.ReadElf(ResolveRootfsFile(MainElf.InterpreterElf, RootFS)) && !InterpElf.ReadElf(MainElf.InterpreterElf)) return; @@ -651,5 +656,6 @@ class ELFCodeLoader2 final : public FEXCore::CodeLoader { uint64_t ArgumentBackingSize{}; uint64_t EnvironmentBackingSize{}; uint64_t BaseOffset{}; + FEX_CONFIG_OPT(AdditionalArguments, ADDITIONALARGUMENTS); };