From e3e71ac9f0b251377eb97bfb8134c1345547e5f4 Mon Sep 17 00:00:00 2001 From: Tue Ton <49886739+chirontt@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:00:04 -0500 Subject: [PATCH] Add support for Windows on Arm64 (WoA) platform build. The following new plug-ins for WoA are added to the project: org.eclipse.core.filesystem.win32.aarch64 org.eclipse.core.resources.win32.aarch64 To build the file system native for WoA: On a WoA box, run the following commands: cd resources\bundles\org.eclipse.core.filesystem\natives\win32 make.bat and the following native file for WoA is generated and saved in the relevant directory: resources\bundles\org.eclipse.core.filesystem.win32.aarch64\os\win32\aarch64\localfile_1_0_0.dll Similarly, to build the Win32 resource native for WoA, run the following commands: cd resources\bundles\org.eclipse.core.resources\natives\win32 make.bat and the following native file for WoA is generated and saved in the relevant directory: resources\bundles\org.eclipse.core.resources.win32.aarch64\os\win32\aarch64\win32refresh.dll The two 'make.bat' files mentioned above have been modified to generate correct binaries for the target environments (x64 or aarch64) --- .../.project | 22 ++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 2 + .../BUILD_INFO.txt | 10 + .../META-INF/MANIFEST.MF | 9 + .../about.html | 36 ++++ .../build.properties | 20 ++ .../fragment.properties | 15 ++ .../pom.xml | 24 +++ .../natives/win32/ia64/make_IA64.bat | 24 --- .../natives/win32/make.bat | 180 ++++++++++++++++- .../natives/win32/setup.bat | 16 -- .../natives/win32/x64/make_x64.bat | 26 --- .../.project | 22 ++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 2 + .../BUILD_INFO.txt | 10 + .../META-INF/MANIFEST.MF | 9 + .../about.html | 36 ++++ .../build.properties | 21 ++ .../fragment.properties | 16 ++ .../fragment.xml | 12 ++ .../pom.xml | 21 ++ .../natives/make.bat | 190 ++++++++++++++++-- .../feature.xml | 6 + .../org.eclipse.compare.win32/META-INF/p2.inf | 5 + 26 files changed, 651 insertions(+), 87 deletions(-) create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.project create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.resources.prefs create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.runtime.prefs create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/BUILD_INFO.txt create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/META-INF/MANIFEST.MF create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/about.html create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/build.properties create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/fragment.properties create mode 100644 resources/bundles/org.eclipse.core.filesystem.win32.aarch64/pom.xml delete mode 100644 resources/bundles/org.eclipse.core.filesystem/natives/win32/ia64/make_IA64.bat delete mode 100644 resources/bundles/org.eclipse.core.filesystem/natives/win32/setup.bat delete mode 100644 resources/bundles/org.eclipse.core.filesystem/natives/win32/x64/make_x64.bat create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/.project create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.resources.prefs create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.runtime.prefs create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/BUILD_INFO.txt create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/META-INF/MANIFEST.MF create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/about.html create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/build.properties create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.properties create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.xml create mode 100644 resources/bundles/org.eclipse.core.resources.win32.aarch64/pom.xml diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.project b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.project new file mode 100644 index 00000000000..388b03a8c28 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.project @@ -0,0 +1,22 @@ + + + org.eclipse.core.filesystem.win32.aarch64 + + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + + diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.resources.prefs b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.runtime.prefs b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 00000000000..5a0ad22d2a7 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/BUILD_INFO.txt b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/BUILD_INFO.txt new file mode 100644 index 00000000000..70cf38aaff4 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/BUILD_INFO.txt @@ -0,0 +1,10 @@ +Native Build Info: +------------------ + +platform: win32.aarch64 +built by: chirontt@gmail.com +build date: 18-Aug-2022 +OS Name: Microsoft Windows 11 on ARM64 +Compiler version: Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31721 for ARM64 +Linker version: Microsoft (R) Incremental Linker Version 14.34.31721.0 +Java version: OpenJDK 64-Bit Server VM Microsoft-38106 (build 11.0.16+8-LTS) diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/META-INF/MANIFEST.MF b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..1a85921e5b0 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %fragmentName +Bundle-SymbolicName: org.eclipse.core.filesystem.win32.aarch64; singleton:=true +Bundle-Version: 1.4.300.qualifier +Bundle-Vendor: %providerName +Fragment-Host: org.eclipse.core.filesystem;bundle-version="[1.4.0,2.0.0)" +Bundle-Localization: fragment +Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=aarch64)) diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/about.html b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/about.html new file mode 100644 index 00000000000..164f781a8fd --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/about.html @@ -0,0 +1,36 @@ + + + + +About + + +

About This Content

+ +

November 30, 2017

+

License

+ +

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

+ +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/build.properties b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/build.properties new file mode 100644 index 00000000000..be8f4938042 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/build.properties @@ -0,0 +1,20 @@ +############################################################################### +# Copyright (c) 2009 IBM Corporation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +bin.includes = os/,\ + fragment.properties,\ + .,\ + META-INF/,\ + about.html +src.includes = about.html +generateSourceBundle=false diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/fragment.properties b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/fragment.properties new file mode 100644 index 00000000000..c3466f124d3 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/fragment.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 2009 IBM Corporation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +fragmentName = Core File System for Windows on Arm64 +providerName = Eclipse.org diff --git a/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/pom.xml b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/pom.xml new file mode 100644 index 00000000000..2607d061b78 --- /dev/null +++ b/resources/bundles/org.eclipse.core.filesystem.win32.aarch64/pom.xml @@ -0,0 +1,24 @@ + + + + 4.0.0 + + eclipse.platform.resources + org.eclipse.platform + 4.32.0-SNAPSHOT + ../../ + + org.eclipse.core.filesystem.win32.aarch64 + 1.4.300-SNAPSHOT + eclipse-plugin + + diff --git a/resources/bundles/org.eclipse.core.filesystem/natives/win32/ia64/make_IA64.bat b/resources/bundles/org.eclipse.core.filesystem/natives/win32/ia64/make_IA64.bat deleted file mode 100644 index 9bde3db0053..00000000000 --- a/resources/bundles/org.eclipse.core.filesystem/natives/win32/ia64/make_IA64.bat +++ /dev/null @@ -1,24 +0,0 @@ -@rem *************************************************************************** -@rem Copyright (c) 2007, 2014 IBM Corporation and others. -@rem -@rem This program and the accompanying materials -@rem are made available under the terms of the Eclipse Public License 2.0 -@rem which accompanies this distribution, and is available at -@rem https://www.eclipse.org/legal/epl-2.0/ -@rem -@rem SPDX-License-Identifier: EPL-2.0 -@rem -@rem Contributors: -@rem IBM Corporation - initial API and implementation -@rem *************************************************************************** -del localfile.obj -del localfile_1_0_0* - -call "%MSSDK%\bin\SetEnv.Cmd" /Release /ia64 /xp - -set win_include=%MSSDK%\include -set lib_includes=UUID.LIB LIBCMT.LIB OLDNAMES.LIB KERNEL32.LIB -set jdk_include=%JAVA_HOME%\include -set dll_name=localfile_1_0_0 - -cl localfile.c -I%win_include% -I%jdk_include% -I%jdk_include%\win32 -LD -Fe%dll_name% /link %lib_includes% diff --git a/resources/bundles/org.eclipse.core.filesystem/natives/win32/make.bat b/resources/bundles/org.eclipse.core.filesystem/natives/win32/make.bat index e480587d9fb..2a302d6f13a 100644 --- a/resources/bundles/org.eclipse.core.filesystem/natives/win32/make.bat +++ b/resources/bundles/org.eclipse.core.filesystem/natives/win32/make.bat @@ -1,5 +1,5 @@ @rem *************************************************************************** -@rem Copyright (c) 2005, 2014 IBM Corporation and others. +@rem Copyright (c) 2005, 2024 IBM Corporation and others. @rem @rem This program and the accompanying materials @rem are made available under the terms of the Eclipse Public License 2.0 @@ -10,11 +10,177 @@ @rem @rem Contributors: @rem IBM Corporation - initial API and implementation +@rem Tue Ton - add auto-search for MSVC compiler @rem *************************************************************************** +REM ---------------------------------------------------------------------------- +REM +REM Required environment variables: +REM JAVA_HOME - path to the JDK11+ installation for x64 or ARM64 architecture +REM +REM ---------------------------------------------------------------------------- +@echo off +echo +echo INFO Starting build of file system binaries. + +@rem Specify VisualStudio Edition: 'Community', 'Enterprise', 'Professional' etc. +IF "x.%MSVC_EDITION%"=="x." set "MSVC_EDITION=auto" + +@rem Specify VisualStudio Version: '2022', '2019', '2017' etc. +IF "x.%MSVC_VERSION%"=="x." set "MSVC_VERSION=auto" + +@rem Search for a usable Visual Studio +@rem --------------------------------- +IF "%MSVC_HOME%"=="" CALL :ECHO "'MSVC_HOME' was not provided, auto-searching for Visual Studio..." +@rem Bug 574007: Path used on Azure build machines +IF "%MSVC_HOME%"=="" CALL :FindVisualStudio "%ProgramFiles(x86)%\Microsoft Visual Studio\$MSVC_VERSION$\BuildTools" +@rem Bug 578519: Common installation paths; VisualStudio is installed in x64 ProgramFiles since VS2022 +IF "%MSVC_HOME%"=="" CALL :FindVisualStudio "%ProgramFiles%\Microsoft Visual Studio\$MSVC_VERSION$\$MSVC_EDITION$" +@rem Bug 578519: Common installation paths; VisualStudio is installed in x86 ProgramFiles before VS2022 +IF "%MSVC_HOME%"=="" CALL :FindVisualStudio "%ProgramFiles(x86)%\Microsoft Visual Studio\$MSVC_VERSION$\$MSVC_EDITION$" +@rem Report +IF NOT EXIST "%MSVC_HOME%" ( + CALL :ECHO "WARNING: Microsoft Visual Studio was not found (for edition=%MSVC_EDITION% version=%MSVC_VERSION%)" + CALL :ECHO " Refer steps for Windows native setup: https://www.eclipse.org/swt/swt_win_native.php" +) ELSE ( + CALL :ECHO "MSVC_HOME: %MSVC_HOME%" +) + +@rem Check for a usable JDK +IF "%JAVA_HOME%"=="" CALL :ECHO "'JAVA_HOME' was not provided" +IF NOT EXIST "%JAVA_HOME%" ( + CALL :ECHO "WARNING: 64-bit Java JDK not found. Please set JAVA_HOME to the JDK directory containing the intended JDK native headers." +) + +@REM Compose host architecture string for MSVC +IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( + SET HOST_ARCH=x64 +) ELSE IF "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( + SET HOST_ARCH=arm64 +) ELSE ( + CALL :ECHO "ERROR: Unknown host architecture: %PROCESSOR_ARCHITECTURE%." + EXIT /B 1 +) + +@REM %TARGET_ARCH% may be specified by the caller for cross-compiling. +@REM If not, build for builder machine's architecture +IF "%TARGET_ARCH%"=="" ( + SET TARGET_ARCH=%HOST_ARCH% +) + +@REM Compose build argument for MSVC +IF "%TARGET_ARCH%"=="%HOST_ARCH%" ( + SET BUILD_ARCH=%TARGET_ARCH% +) ELSE ( + SET BUILD_ARCH=%HOST_ARCH%_%TARGET_ARCH% +) + +@REM Select build's output directory (if not specified) based on target arch +IF "%TARGET_ARCH%"=="x64" ( + IF "x.%OUTPUT_DIR%"=="x." SET OUTPUT_DIR=..\..\..\org.eclipse.core.filesystem.win32.x86_64\os\win32\x86_64 +) ELSE IF "%TARGET_ARCH%"=="arm64" ( + IF "x.%OUTPUT_DIR%"=="x." SET OUTPUT_DIR=..\..\..\org.eclipse.core.filesystem.win32.aarch64\os\win32\aarch64 +) ELSE ( + CALL :ECHO "ERROR: Unknown target architecture: %TARGET_ARCH%." + EXIT /B 1 +) + +call "%MSVC_HOME%\VC\Auxiliary\Build\vcvarsall.bat" %BUILD_ARCH% + +@rem if call to vcvarsall.bat (which sets up environment) silently fails, then provide advice to user. +WHERE cl +if %ERRORLEVEL% NEQ 0 ( + CALL :ECHO "ERROR: cl (Microsoft C compiler) not found on path. Please install Microsoft Visual Studio." + CALL :ECHO " If already installed, try launching eclipse from the 'Developer Command Prompt for VS'" + CALL :ECHO " Refer steps for SWT Windows native setup: https://www.eclipse.org/swt/swt_win_native.php" + CALL :ECHO "ERROR: exit 1" + EXIT 1 +) + +@rem Build the DLL file del localfile.obj -del localfile_3_2_0* -set win_include=k:\msvc60\vc98\include -set lib_includes=K:\Msvc60\VC98\Lib\UUID.LIB K:\Msvc60\VC98\Lib\LIBCMT.LIB K:\Msvc60\VC98\Lib\OLDNAMES.LIB K:\Msvc60\VC98\Lib\KERNEL32.LIB -set jdk_include=d:\vm\jdk1.5.0_05\include -set dll_name=localfile_1_0_0 -cl -I%win_include% -I%jdk_include% -I%jdk_include%\win32 -LD localfile.c -Fe%dll_name% /link %lib_includes% +del localfile_1_0_0* + +set lib_includes=UUID.LIB LIBCMT.LIB OLDNAMES.LIB KERNEL32.LIB +set jdk_include=%JAVA_HOME%\include +set dll_name=localfile_1_0_0.dll + +cl.exe localfile.c -I"%jdk_include%" -I"%jdk_include%\win32" -LD -Fe%dll_name% /link %lib_includes% /Subsystem:CONSOLE +mkdir %OUTPUT_DIR% +move /y %dll_name% %OUTPUT_DIR%\%dll_name% + +GOTO :EOF + +@rem Find Visual Studio +@rem %1 = path template with '$MSVC_VERSION$' and '$MSVC_EDITION$' tokens +:FindVisualStudio + @rem Early return if already found + IF NOT "%MSVC_HOME%"=="" GOTO :EOF + + IF "%MSVC_VERSION%"=="auto" ( + CALL :FindVisualStudio2 "%~1" "2022" + CALL :FindVisualStudio2 "%~1" "2019" + CALL :FindVisualStudio2 "%~1" "2017" + ) ELSE ( + CALL :FindVisualStudio2 "%~1" "%MSVC_VERSION%" + ) +GOTO :EOF + +@rem Find Visual Studio +@rem %1 = path template with '$MSVC_VERSION$' and '$MSVC_EDITION$' tokens +@rem %2 = value for '$MSVC_VERSION$' +:FindVisualStudio2 + @rem Early return if already found + IF NOT "%MSVC_HOME%"=="" GOTO :EOF + + IF "%MSVC_EDITION%"=="auto" ( + CALL :FindVisualStudio3 "%~1" "%~2" "Community" + CALL :FindVisualStudio3 "%~1" "%~2" "Enterprise" + CALL :FindVisualStudio3 "%~1" "%~2" "Professional" + ) ELSE ( + CALL :FindVisualStudio3 "%~1" "%~2" "%MSVC_EDITION%" + ) +GOTO :EOF + +@rem Find Visual Studio +@rem %1 = path template with '$MSVC_VERSION$' and '$MSVC_EDITION$' tokens +@rem %2 = value for '$MSVC_VERSION$' +@rem %3 = value for '$MSVC_EDITION$' +:FindVisualStudio3 + @rem Early return if already found + IF NOT "%MSVC_HOME%"=="" GOTO :EOF + + SET "TESTED_VS_PATH=%~1" + @rem Substitute '$MSVC_VERSION$' and '$MSVC_EDITION$' + CALL SET "TESTED_VS_PATH=%%TESTED_VS_PATH:$MSVC_VERSION$=%~2%%" + CALL SET "TESTED_VS_PATH=%%TESTED_VS_PATH:$MSVC_EDITION$=%~3%%" + + @rem If the folder isn't there, then skip it without printing errors + IF NOT EXIST "%TESTED_VS_PATH%" GOTO :EOF + + @rem Try this path + CALL :TryToUseVisualStudio "%TESTED_VS_PATH%" +GOTO :EOF + +@rem Test Visual Studio and set '%MSVC_HOME%' on success +@rem %1 = tested path +:TryToUseVisualStudio + SET "TESTED_VS_PATH=%~1" + IF NOT EXIST "%TESTED_VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" ( + CALL :ECHO "-- VisualStudio '%TESTED_VS_PATH%' is bad: 'vcvarsall.bat' not found" + GOTO :EOF + ) + CALL :ECHO "-- VisualStudio '%TESTED_VS_PATH%' looks good, selecting it" + SET "MSVC_HOME=%TESTED_VS_PATH%" +GOTO :EOF + +@rem Regular ECHO has trouble with special characters such as (). +@rem At the same time, if its argument is quoted, the quotes are printed literally. +@rem The workaround is to escape all special characters with ^ +:ECHO + SET "ECHO_STRING=%~1" + SET "ECHO_STRING=%ECHO_STRING:<=^<%" + SET "ECHO_STRING=%ECHO_STRING:>=^>%" + SET "ECHO_STRING=%ECHO_STRING:(=^(%" + SET "ECHO_STRING=%ECHO_STRING:)=^)%" + ECHO %ECHO_STRING% +GOTO :EOF diff --git a/resources/bundles/org.eclipse.core.filesystem/natives/win32/setup.bat b/resources/bundles/org.eclipse.core.filesystem/natives/win32/setup.bat deleted file mode 100644 index c74c9fd280a..00000000000 --- a/resources/bundles/org.eclipse.core.filesystem/natives/win32/setup.bat +++ /dev/null @@ -1,16 +0,0 @@ -@rem *************************************************************************** -@rem Copyright (c) 2005, 2014 IBM Corporation and others. -@rem -@rem This program and the accompanying materials -@rem are made available under the terms of the Eclipse Public License 2.0 -@rem which accompanies this distribution, and is available at -@rem https://www.eclipse.org/legal/epl-2.0/ -@rem -@rem SPDX-License-Identifier: EPL-2.0 -@rem -@rem Contributors: -@rem IBM Corporation - initial API and implementation -@rem *************************************************************************** -set path=%path%;K:\msvc60\vc98\bin;K:\msvc60\Common\MSDev98\Bin -set temp=c:\temp -set tmp=c:\temp \ No newline at end of file diff --git a/resources/bundles/org.eclipse.core.filesystem/natives/win32/x64/make_x64.bat b/resources/bundles/org.eclipse.core.filesystem/natives/win32/x64/make_x64.bat deleted file mode 100644 index 6aae3fc3d54..00000000000 --- a/resources/bundles/org.eclipse.core.filesystem/natives/win32/x64/make_x64.bat +++ /dev/null @@ -1,26 +0,0 @@ -@rem *************************************************************************** -@rem Copyright (c) 2009, 2014 IBM Corporation and others. -@rem -@rem This program and the accompanying materials -@rem are made available under the terms of the Eclipse Public License 2.0 -@rem which accompanies this distribution, and is available at -@rem https://www.eclipse.org/legal/epl-2.0/ -@rem -@rem SPDX-License-Identifier: EPL-2.0 -@rem -@rem Contributors: -@rem IBM Corporation - initial API and implementation -@rem *************************************************************************** -del localfile.obj -del localfile_1_0_0* - -set JAVA_HOME=c:\Program Files\Java\j2sdk1.4.2_18 - -call "%MSSDK%\bin\SetEnv.Cmd" /Release /x64 /xp - -set win_include=%MSSDK%\include -set lib_includes=UUID.LIB LIBCMT.LIB OLDNAMES.LIB KERNEL32.LIB -set jdk_include=%JAVA_HOME%\include -set dll_name=localfile_1_0_0 - -cl ..\localfile.c -I"%win_include%" -I"%jdk_include%" -I"%jdk_include%\win32" -LD -Fe%dll_name% /link %lib_includes% /Subsystem:CONSOLE diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/.project b/resources/bundles/org.eclipse.core.resources.win32.aarch64/.project new file mode 100644 index 00000000000..80ebbc98758 --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/.project @@ -0,0 +1,22 @@ + + + org.eclipse.core.resources.win32.aarch64 + + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + + diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.resources.prefs b/resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.runtime.prefs b/resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 00000000000..5a0ad22d2a7 --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/BUILD_INFO.txt b/resources/bundles/org.eclipse.core.resources.win32.aarch64/BUILD_INFO.txt new file mode 100644 index 00000000000..70cf38aaff4 --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/BUILD_INFO.txt @@ -0,0 +1,10 @@ +Native Build Info: +------------------ + +platform: win32.aarch64 +built by: chirontt@gmail.com +build date: 18-Aug-2022 +OS Name: Microsoft Windows 11 on ARM64 +Compiler version: Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31721 for ARM64 +Linker version: Microsoft (R) Incremental Linker Version 14.34.31721.0 +Java version: OpenJDK 64-Bit Server VM Microsoft-38106 (build 11.0.16+8-LTS) diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/META-INF/MANIFEST.MF b/resources/bundles/org.eclipse.core.resources.win32.aarch64/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..4a02d297558 --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %win32FragmentName +Bundle-SymbolicName: org.eclipse.core.resources.win32.aarch64;singleton:=true +Bundle-Version: 3.5.500.qualifier +Bundle-Vendor: %providerName +Fragment-Host: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)" +Bundle-Localization: fragment +Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=aarch64)) diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/about.html b/resources/bundles/org.eclipse.core.resources.win32.aarch64/about.html new file mode 100644 index 00000000000..164f781a8fd --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/about.html @@ -0,0 +1,36 @@ + + + + +About + + +

About This Content

+ +

November 30, 2017

+

License

+ +

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

+ +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/build.properties b/resources/bundles/org.eclipse.core.resources.win32.aarch64/build.properties new file mode 100644 index 00000000000..b15e6253c5e --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/build.properties @@ -0,0 +1,21 @@ +############################################################################### +# Copyright (c) 2012, 2018 IBM Corporation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +bin.includes = fragment.xml,\ + os/,\ + .,\ + META-INF/,\ + about.html,\ + fragment.properties +generateSourceBundle=false + diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.properties b/resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.properties new file mode 100644 index 00000000000..8249a7377b4 --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 2018 IBM Corporation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +providerName = Eclipse.org +win32FragmentName = Core Resource Management Win32 Arm64 Fragment +win32MonitorFactoryName = Windows Auto-refresh monitor diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.xml b/resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.xml new file mode 100644 index 00000000000..b823b6b7e1e --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/fragment.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/resources/bundles/org.eclipse.core.resources.win32.aarch64/pom.xml b/resources/bundles/org.eclipse.core.resources.win32.aarch64/pom.xml new file mode 100644 index 00000000000..5d437ed0ba2 --- /dev/null +++ b/resources/bundles/org.eclipse.core.resources.win32.aarch64/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + eclipse.platform.resources + org.eclipse.platform + 4.32.0-SNAPSHOT + ../../ + + org.eclipse.core.resources.win32.aarch64 + 3.5.500-SNAPSHOT + eclipse-plugin + + diff --git a/resources/bundles/org.eclipse.core.resources/natives/make.bat b/resources/bundles/org.eclipse.core.resources/natives/make.bat index aa8b7008f02..1ab281673f7 100644 --- a/resources/bundles/org.eclipse.core.resources/natives/make.bat +++ b/resources/bundles/org.eclipse.core.resources/natives/make.bat @@ -1,5 +1,5 @@ @rem *************************************************************************** -@rem Copyright (c) 2007, 2014 IBM Corporation and others. +@rem Copyright (c) 2007, 2024 IBM Corporation and others. @rem @rem This program and the accompanying materials @rem are made available under the terms of the Eclipse Public License 2.0 @@ -10,23 +10,185 @@ @rem @rem Contributors: @rem IBM Corporation - initial API and implementation +@rem Tue Ton - add auto-search for MSVC compiler @rem *************************************************************************** +REM ---------------------------------------------------------------------------- +REM +REM Required environment variables: +REM JAVA_HOME - path to the JDK11+ installation for x64 or ARM64 architecture +REM +REM ---------------------------------------------------------------------------- +@echo off +echo +echo INFO Starting build of Win32 resource binaries. + +@rem Specify VisualStudio Edition: 'Community', 'Enterprise', 'Professional' etc. +IF "x.%MSVC_EDITION%"=="x." set "MSVC_EDITION=auto" + +@rem Specify VisualStudio Version: '2022', '2019', '2017' etc. +IF "x.%MSVC_VERSION%"=="x." set "MSVC_VERSION=auto" + +@rem Search for a usable Visual Studio +@rem --------------------------------- +IF "%MSVC_HOME%"=="" CALL :ECHO "'MSVC_HOME' was not provided, auto-searching for Visual Studio..." +@rem Bug 574007: Path used on Azure build machines +IF "%MSVC_HOME%"=="" CALL :FindVisualStudio "%ProgramFiles(x86)%\Microsoft Visual Studio\$MSVC_VERSION$\BuildTools" +@rem Bug 578519: Common installation paths; VisualStudio is installed in x64 ProgramFiles since VS2022 +IF "%MSVC_HOME%"=="" CALL :FindVisualStudio "%ProgramFiles%\Microsoft Visual Studio\$MSVC_VERSION$\$MSVC_EDITION$" +@rem Bug 578519: Common installation paths; VisualStudio is installed in x86 ProgramFiles before VS2022 +IF "%MSVC_HOME%"=="" CALL :FindVisualStudio "%ProgramFiles(x86)%\Microsoft Visual Studio\$MSVC_VERSION$\$MSVC_EDITION$" +@rem Report +IF NOT EXIST "%MSVC_HOME%" ( + CALL :ECHO "WARNING: Microsoft Visual Studio was not found (for edition=%MSVC_EDITION% version=%MSVC_VERSION%)" + CALL :ECHO " Refer steps for Windows native setup: https://www.eclipse.org/swt/swt_win_native.php" +) ELSE ( + CALL :ECHO "MSVC_HOME: %MSVC_HOME%" +) + +@rem Check for a usable JDK +IF "%JAVA_HOME%"=="" CALL :ECHO "'JAVA_HOME' was not provided" +IF NOT EXIST "%JAVA_HOME%" ( + CALL :ECHO "WARNING: 64-bit Java JDK not found. Please set JAVA_HOME to the JDK directory containing the intended JDK native headers." +) + +@REM Compose host architecture string for MSVC +IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( + SET HOST_ARCH=x64 +) ELSE IF "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( + SET HOST_ARCH=arm64 +) ELSE ( + CALL :ECHO "ERROR: Unknown host architecture: %PROCESSOR_ARCHITECTURE%." + EXIT /B 1 +) + +@REM %TARGET_ARCH% may be specified by the caller for cross-compiling. +@REM If not, build for builder machine's architecture +IF "%TARGET_ARCH%"=="" ( + SET TARGET_ARCH=%HOST_ARCH% +) + +@REM Compose build argument for MSVC +IF "%TARGET_ARCH%"=="%HOST_ARCH%" ( + SET BUILD_ARCH=%TARGET_ARCH% +) ELSE ( + SET BUILD_ARCH=%HOST_ARCH%_%TARGET_ARCH% +) + +@REM Select build's output directory (if not specified) based on target arch +IF "%TARGET_ARCH%"=="x64" ( + IF "x.%OUTPUT_DIR%"=="x." SET OUTPUT_DIR=..\..\..\org.eclipse.core.resources.win32.x86_64\os\win32\x86_64 +) ELSE IF "%TARGET_ARCH%"=="arm64" ( + IF "x.%OUTPUT_DIR%"=="x." SET OUTPUT_DIR=..\..\..\org.eclipse.core.resources.win32.aarch64\os\win32\aarch64 +) ELSE ( + CALL :ECHO "ERROR: Unknown target architecture: %TARGET_ARCH%." + EXIT /B 1 +) + +call "%MSVC_HOME%\VC\Auxiliary\Build\vcvarsall.bat" %BUILD_ARCH% + +@rem if call to vcvarsall.bat (which sets up environment) silently fails, then provide advice to user. +WHERE cl +if %ERRORLEVEL% NEQ 0 ( + CALL :ECHO "ERROR: cl (Microsoft C compiler) not found on path. Please install Microsoft Visual Studio." + CALL :ECHO " If already installed, try launching eclipse from the 'Developer Command Prompt for VS'" + CALL :ECHO " Refer steps for SWT Windows native setup: https://www.eclipse.org/swt/swt_win_native.php" + CALL :ECHO "ERROR: exit 1" + EXIT 1 +) + REM build JNI header file -cd ..\bin -"C:\Program Files\Java\jdk1.8.0_65\bin\javah.exe" org.eclipse.core.internal.resources.refresh.win32.Win32Natives -move org_eclipse_core_internal_resources_refresh_win32_Win32Natives.h ..\natives\ref2.h +mkdir bin +cd ..\src +"%JAVA_HOME%\bin\javac.exe" -d ..\natives\bin -h . org\eclipse\core\internal\resources\refresh\win32\Win32Natives.java +move /y org_eclipse_core_internal_resources_refresh_win32_Win32Natives.h ..\natives\bin\ref.h REM compile and link -cd ..\natives -set win_include="C:\Program Files\Microsoft Visual Studio 14.0\VC\include" -set jdk_include="C:\Program Files\Java\jdk1.8.0_65\include" - +cd ..\natives\bin +copy ..\ref.c . +set jdk_include="%JAVA_HOME%\include" set dll_name=win32refresh.dll -call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 -"cl.exe" -I%win_include% -I%jdk_include% -I%jdk_include%\win32 -LD ref.c -Fe%dll_name% -move %dll_name% ..\..\org.eclipse.core.resources.win32.x86\os\win32\x86\%dll_name% +cl.exe -I%jdk_include% -I%jdk_include%\win32 -LD ref.c -Fe%dll_name% +mkdir %OUTPUT_DIR% +move /y %dll_name% %OUTPUT_DIR%\%dll_name% + +REM clean up +cd .. +rmdir /q /s bin + +GOTO :EOF + +@rem Find Visual Studio +@rem %1 = path template with '$MSVC_VERSION$' and '$MSVC_EDITION$' tokens +:FindVisualStudio + @rem Early return if already found + IF NOT "%MSVC_HOME%"=="" GOTO :EOF + + IF "%MSVC_VERSION%"=="auto" ( + CALL :FindVisualStudio2 "%~1" "2022" + CALL :FindVisualStudio2 "%~1" "2019" + CALL :FindVisualStudio2 "%~1" "2017" + ) ELSE ( + CALL :FindVisualStudio2 "%~1" "%MSVC_VERSION%" + ) +GOTO :EOF + +@rem Find Visual Studio +@rem %1 = path template with '$MSVC_VERSION$' and '$MSVC_EDITION$' tokens +@rem %2 = value for '$MSVC_VERSION$' +:FindVisualStudio2 + @rem Early return if already found + IF NOT "%MSVC_HOME%"=="" GOTO :EOF + + IF "%MSVC_EDITION%"=="auto" ( + CALL :FindVisualStudio3 "%~1" "%~2" "Community" + CALL :FindVisualStudio3 "%~1" "%~2" "Enterprise" + CALL :FindVisualStudio3 "%~1" "%~2" "Professional" + ) ELSE ( + CALL :FindVisualStudio3 "%~1" "%~2" "%MSVC_EDITION%" + ) +GOTO :EOF + +@rem Find Visual Studio +@rem %1 = path template with '$MSVC_VERSION$' and '$MSVC_EDITION$' tokens +@rem %2 = value for '$MSVC_VERSION$' +@rem %3 = value for '$MSVC_EDITION$' +:FindVisualStudio3 + @rem Early return if already found + IF NOT "%MSVC_HOME%"=="" GOTO :EOF + + SET "TESTED_VS_PATH=%~1" + @rem Substitute '$MSVC_VERSION$' and '$MSVC_EDITION$' + CALL SET "TESTED_VS_PATH=%%TESTED_VS_PATH:$MSVC_VERSION$=%~2%%" + CALL SET "TESTED_VS_PATH=%%TESTED_VS_PATH:$MSVC_EDITION$=%~3%%" + + @rem If the folder isn't there, then skip it without printing errors + IF NOT EXIST "%TESTED_VS_PATH%" GOTO :EOF + + @rem Try this path + CALL :TryToUseVisualStudio "%TESTED_VS_PATH%" +GOTO :EOF + +@rem Test Visual Studio and set '%MSVC_HOME%' on success +@rem %1 = tested path +:TryToUseVisualStudio + SET "TESTED_VS_PATH=%~1" + IF NOT EXIST "%TESTED_VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" ( + CALL :ECHO "-- VisualStudio '%TESTED_VS_PATH%' is bad: 'vcvarsall.bat' not found" + GOTO :EOF + ) + CALL :ECHO "-- VisualStudio '%TESTED_VS_PATH%' looks good, selecting it" + SET "MSVC_HOME=%TESTED_VS_PATH%" +GOTO :EOF -call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 -"cl.exe" -I%win_include% -I%jdk_include% -I%jdk_include%\win32 -LD ref.c -Fe%dll_name% -move %dll_name% ..\..\org.eclipse.core.resources.win32.x86_64\os\win32\x86_64\%dll_name% \ No newline at end of file +@rem Regular ECHO has trouble with special characters such as (). +@rem At the same time, if its argument is quoted, the quotes are printed literally. +@rem The workaround is to escape all special characters with ^ +:ECHO + SET "ECHO_STRING=%~1" + SET "ECHO_STRING=%ECHO_STRING:<=^<%" + SET "ECHO_STRING=%ECHO_STRING:>=^>%" + SET "ECHO_STRING=%ECHO_STRING:(=^(%" + SET "ECHO_STRING=%ECHO_STRING:)=^)%" + ECHO %ECHO_STRING% +GOTO :EOF diff --git a/resources/tests/org.eclipse.core.tests.filesystem.feature/feature.xml b/resources/tests/org.eclipse.core.tests.filesystem.feature/feature.xml index 35f67389db4..4f03146e28b 100644 --- a/resources/tests/org.eclipse.core.tests.filesystem.feature/feature.xml +++ b/resources/tests/org.eclipse.core.tests.filesystem.feature/feature.xml @@ -25,6 +25,12 @@ arch="x86_64" version="0.0.0"/> + +