Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52741 Signed-off-by: Mohamad Al-Jaf mohamadaljaf@gmail.com --- v3: - Use the default implementations for DllRegisterServer and DllUnregisterServer. --- configure.ac | 1 + dlls/chakra/Makefile.in | 5 ++ dlls/chakra/chakra.spec | 160 ++++++++++++++++++++++++++++++++++++++++ dlls/chakra/version.rc | 26 +++++++ 4 files changed, 192 insertions(+) create mode 100644 dlls/chakra/Makefile.in create mode 100644 dlls/chakra/chakra.spec create mode 100644 dlls/chakra/version.rc
diff --git a/configure.ac b/configure.ac index e509b232d11..f9ac5e45ed4 100644 --- a/configure.ac +++ b/configure.ac @@ -2372,6 +2372,7 @@ WINE_CONFIG_MAKEFILE(dlls/capi2032) WINE_CONFIG_MAKEFILE(dlls/cards) WINE_CONFIG_MAKEFILE(dlls/cdosys) WINE_CONFIG_MAKEFILE(dlls/cfgmgr32) +WINE_CONFIG_MAKEFILE(dlls/chakra) WINE_CONFIG_MAKEFILE(dlls/clusapi) WINE_CONFIG_MAKEFILE(dlls/cng.sys) WINE_CONFIG_MAKEFILE(dlls/combase) diff --git a/dlls/chakra/Makefile.in b/dlls/chakra/Makefile.in new file mode 100644 index 00000000000..7ca3e00c6d7 --- /dev/null +++ b/dlls/chakra/Makefile.in @@ -0,0 +1,5 @@ +MODULE = chakra.dll + +EXTRADLLFLAGS = -Wb,--prefer-native + +RC_SRCS = version.rc diff --git a/dlls/chakra/chakra.spec b/dlls/chakra/chakra.spec new file mode 100644 index 00000000000..90e176ddf85 --- /dev/null +++ b/dlls/chakra/chakra.spec @@ -0,0 +1,160 @@ +@ stub JsProjectWinRTNamespace +@ stub JsSetProjectionEnqueueCallback +@ stub CreateChakraEngine +@ stub DumpDiagInfo +@ stub JsDiscardBackgroundParse +@ stub JsInitializeJITServer +@ stub JsQueueBackgroundParse +@ stub MemProtectHeapAddRootSection +@ stub MemProtectHeapCollect +@ stub MemProtectHeapCreate +@ stub MemProtectHeapDestroy +@ stub MemProtectHeapDisableCollection +@ stub MemProtectHeapIsValidObject +@ stub MemProtectHeapMemSize +@ stub MemProtectHeapNotifyCurrentThreadDetach +@ stub MemProtectHeapProtectCurrentThread +@ stub MemProtectHeapRemoveRootSection +@ stub MemProtectHeapReportHeapSize +@ stub MemProtectHeapRootAlloc +@ stub MemProtectHeapRootAllocLeaf +@ stub MemProtectHeapRootRealloc +@ stub MemProtectHeapRootReallocLeaf +@ stub MemProtectHeapSynchronizeWithCollector +@ stub MemProtectHeapUnprotectCurrentThread +@ stub MemProtectHeapUnrootAndZero +@ stub RecyclerNativeHeapAddExternalMemoryUsage +@ stub RecyclerNativeHeapAllocLeaf +@ stub RecyclerNativeHeapAllocLeafFinalized +@ stub RecyclerNativeHeapAllocTraced +@ stub RecyclerNativeHeapAllocTracedFinalized +@ stub RecyclerNativeHeapCollectGarbageInThread +@ stub RecyclerNativeHeapCreateWeakReference +@ stub RecyclerNativeHeapGetRealAddressFromInterior +@ stub RecyclerNativeHeapGetStrongReference +@ stub RecyclerNativeHeapHasWeakReferenceCleanupOccurred +@ stub RecyclerNativeHeapRootAddRef +@ stub RecyclerNativeHeapRootRelease +@ stdcall -private DllCanUnloadNow() +@ stub DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() +@ stub JsAddRef +@ stub JsBoolToBoolean +@ stub JsBooleanToBool +@ stub JsCallFunction +@ stub JsCollectGarbage +@ stub JsConstructObject +@ stub JsConvertValueToBoolean +@ stub JsConvertValueToNumber +@ stub JsConvertValueToObject +@ stub JsConvertValueToString +@ stub JsCreateArray +@ stub JsCreateArrayBuffer +@ stub JsCreateContext +@ stub JsCreateDataView +@ stub JsCreateError +@ stub JsCreateExternalArrayBuffer +@ stub JsCreateExternalObject +@ stub JsCreateFunction +@ stub JsCreateNamedFunction +@ stub JsCreateObject +@ stub JsCreateRangeError +@ stub JsCreateReferenceError +@ stub JsCreateRuntime +@ stub JsCreateSymbol +@ stub JsCreateSyntaxError +@ stub JsCreateThreadService +@ stub JsCreateTypeError +@ stub JsCreateTypedArray +@ stub JsCreateURIError +@ stub JsDefineProperty +@ stub JsDeleteIndexedProperty +@ stub JsDeleteProperty +@ stub JsDisableRuntimeExecution +@ stub JsDisposeRuntime +@ stub JsDoubleToNumber +@ stub JsEnableRuntimeExecution +@ stub JsEnumerateHeap +@ stub JsEquals +@ stub JsGetAndClearException +@ stub JsGetArrayBufferStorage +@ stub JsGetContextData +@ stub JsGetContextOfObject +@ stub JsGetCurrentContext +@ stub JsGetDataViewStorage +@ stub JsGetExtensionAllowed +@ stub JsGetExternalData +@ stub JsGetFalseValue +@ stub JsGetGlobalObject +@ stub JsGetIndexedPropertiesExternalData +@ stub JsGetIndexedProperty +@ stub JsGetNullValue +@ stub JsGetOwnPropertyDescriptor +@ stub JsGetOwnPropertyNames +@ stub JsGetOwnPropertySymbols +@ stub JsGetProperty +@ stub JsGetPropertyIdFromName +@ stub JsGetPropertyIdFromSymbol +@ stub JsGetPropertyIdType +@ stub JsGetPropertyNameFromId +@ stub JsGetPrototype +@ stub JsGetRuntime +@ stub JsGetRuntimeMemoryLimit +@ stub JsGetRuntimeMemoryUsage +@ stub JsGetStringLength +@ stub JsGetSymbolFromPropertyId +@ stub JsGetTrueValue +@ stub JsGetTypedArrayInfo +@ stub JsGetTypedArrayStorage +@ stub JsGetUndefinedValue +@ stub JsGetValueType +@ stub JsHasException +@ stub JsHasExternalData +@ stub JsHasIndexedPropertiesExternalData +@ stub JsHasIndexedProperty +@ stub JsHasProperty +@ stub JsIdle +@ stub JsInspectableToObject +@ stub JsInstanceOf +@ stub JsIntToNumber +@ stub JsIsEnumeratingHeap +@ stub JsIsRuntimeExecutionDisabled +@ stub JsNumberToDouble +@ stub JsNumberToInt +@ stub JsObjectToInspectable +@ stub JsParseScript +@ stub JsParseScriptWithAttributes +@ stub JsParseSerializedScript +@ stub JsParseSerializedScriptWithCallback +@ stub JsPointerToString +@ stub JsPreventExtension +@ stub JsRelease +@ stub JsRunScript +@ stub JsRunSerializedScript +@ stub JsRunSerializedScriptWithCallback +@ stub JsSerializeScript +@ stub JsSetContextData +@ stub JsSetCurrentContext +@ stub JsSetException +@ stub JsSetExternalData +@ stub JsSetIndexedPropertiesToExternalData +@ stub JsSetIndexedProperty +@ stub JsSetObjectBeforeCollectCallback +@ stub JsSetPromiseContinuationCallback +@ stub JsSetProperty +@ stub JsSetPrototype +@ stub JsSetRuntimeBeforeCollectCallback +@ stub JsSetRuntimeMemoryAllocationCallback +@ stub JsSetRuntimeMemoryLimit +@ stub JsStartDebugging +@ stub JsStartProfiling +@ stub JsStopProfiling +@ stub JsStrictEquals +@ stub JsStringToPointer +@ stub JsValueToVariant +@ stub JsVarAddRef +@ stub JsVarRelease +@ stub JsVarToExtension +@ stub JsVarToScriptDirect +@ stub JsVariantToValue diff --git a/dlls/chakra/version.rc b/dlls/chakra/version.rc new file mode 100644 index 00000000000..a73bf2bc5ad --- /dev/null +++ b/dlls/chakra/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2022 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Wine chakra" +#define WINE_FILENAME_STR "chakra.dll" +#define WINE_FILEVERSION 11,0,22000,348 +#define WINE_FILEVERSION_STR "11.0.22000.348" +#define WINE_PRODUCTVERSION 11,00,22000,348 +#define WINE_PRODUCTVERSION_STR "11.00.22000.348" + +#include "wine/wine_common_ver.rc"
On 4/3/22 06:42, Mohamad Al-Jaf wrote:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52741 Signed-off-by: Mohamad Al-Jaf mohamadaljaf@gmail.com
v3: - Use the default implementations for DllRegisterServer and DllUnregisterServer.
configure.ac | 1 + dlls/chakra/Makefile.in | 5 ++ dlls/chakra/chakra.spec | 160 ++++++++++++++++++++++++++++++++++++++++ dlls/chakra/version.rc | 26 +++++++ 4 files changed, 192 insertions(+)
I think it's worth exploring if opensourced engine is usable for this, before adding this stub.
On Sun, Apr 3, 2022 at 2:30 AM Nikolay Sivov nsivov@codeweavers.com wrote:
I think it's worth exploring if opensourced engine is usable for this, before adding this stub.
What do you mean by opensourced engine? -- Kind regards, Mohamad
On Sun, Apr 3, 2022 at 2:30 AM Nikolay Sivov nsivov@codeweavers.com wrote:
I think it's worth exploring if opensourced engine is usable for this, before adding this stub.
Nikolay, if the stub helps some app, I think it's quite orthogonal to a possible implementation.
On 2022-04-03 09:52, Mohamad Al-Jaf wrote:
What do you mean by opensourced engine?
Mohamad, I guess Nikolay means this project (MIT licensed): https://github.com/chakra-core/ChakraCore
S.
On Sun, Apr 3, 2022 at 3:10 AM Saulius Krasuckas saulius2@ar-fi.lt wrote:
Mohamad, I guess Nikolay means this project (MIT licensed): https://github.com/chakra-core/ChakraCore
Thanks for the link, Saulius. It looks like most of the chakra.dll functions are in the source files, both prototypes and implementations. So it does look like it's usable in Wine.
Nikolay, I can add a header of the prototypes in a separate patch if you think this dll is going to be implemented in the future. -- Kind regards, Mohamad
On 4/3/22 10:10, Saulius Krasuckas wrote:
On Sun, Apr 3, 2022 at 2:30 AM Nikolay Sivov nsivov@codeweavers.com wrote:
I think it's worth exploring if opensourced engine is usable for this, before adding this stub.
Nikolay, if the stub helps some app, I think it's quite orthogonal to a possible implementation.
It depends. Once we add something it usually stays in, and when once we find something that actually uses this JS implementation, there will be a problem. In this case the problem will be in the scope of such module, that we are unlikely to pull off from scratch.
On 2022-04-03 09:52, Mohamad Al-Jaf wrote:
What do you mean by opensourced engine?
Mohamad, I guess Nikolay means this project (MIT licensed): https://github.com/chakra-core/ChakraCore
Yes, that.
S.
On Wed, Apr 6, 2022 at 2:02 PM Nikolay Sivov nsivov@codeweavers.com wrote:
On 4/3/22 10:10, Saulius Krasuckas wrote:
On Sun, Apr 3, 2022 at 2:30 AM Nikolay Sivov nsivov@codeweavers.com wrote:
I think it's worth exploring if opensourced engine is usable for this, before adding this stub.
Nikolay, if the stub helps some app, I think it's quite orthogonal to a possible implementation.
It depends. Once we add something it usually stays in, and when once we find something that actually uses this JS implementation, there will be a problem. In this case the problem will be in the scope of such module, that we are unlikely to pull off from scratch.
On 2022-04-03 09:52, Mohamad Al-Jaf wrote:
What do you mean by opensourced engine?
Mohamad, I guess Nikolay means this project (MIT licensed): https://github.com/chakra-core/ChakraCore
Yes, that.
S.
Why would we need to pull it off from scratch? The implementations are already publicly available under an MIT license in ChakraCore. AFAIK, this means we can use them under a GNU license. They just need to be modified slightly to fit under Wine's code style and requirements.
Unfortunately, this dll is likely going to be needed. Since Microsoft decided to use the dll in Minecraft they're probably going to use it in other games. Also, keep in mind that Minecraft is a very popular game so this bug is likely affecting a lot of Wine users. Yes, there's a native Linux client but some people want to use the Windows version for whatever reason. Plus, this also affects the Windows Minecraft server. -- Kind regards, Mohamad