diff --git a/add_loongarch-support.patch b/add_loongarch-support.patch
new file mode 100644
index 0000000000000000000000000000000000000000..10184060eaf4955c814bbde9e9bc15488bb79e27
--- /dev/null
+++ b/add_loongarch-support.patch
@@ -0,0 +1,305 @@
+diff --git a/eclipse.platform.swt.binaries/pom.xml b/eclipse.platform.swt.binaries/pom.xml
+index 5a2d0d8..3d3af6a 100644
+--- a/eclipse.platform.swt.binaries/pom.xml
++++ b/eclipse.platform.swt.binaries/pom.xml
+@@ -56,6 +56,7 @@
+ bundles/org.eclipse.swt.cocoa.macosx.x86_64
+ bundles/org.eclipse.swt.gtk.linux.arm
+ bundles/org.eclipse.swt.gtk.linux.aarch64
++ bundles/org.eclipse.swt.gtk.linux.loongarch64
+ bundles/org.eclipse.swt.gtk.linux.ppc64le
+ bundles/org.eclipse.swt.gtk.linux.s390x
+ bundles/org.eclipse.swt.gtk.linux.x86
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
+index c783f77..746ea70 100755
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
+@@ -112,6 +112,10 @@ case $MODEL in
+ SWT_ARCH=x86
+ AWT_ARCH=i386
+ ;;
++ "loongarch64")
++ SWT_ARCH=loongarch64
++ AWT_ARCH=loongarch64
++ ;;
+ *)
+ SWT_ARCH=$MODEL
+ AWT_ARCH=$MODEL
+@@ -180,6 +184,17 @@ case $SWT_OS.$SWT_ARCH in
+ export PKG_CONFIG_PATH="/usr/lib64/pkgconfig/"
+ fi
+ ;;
++ "linux.loongarch64")
++ if [ "${CC}" = "" ]; then
++ export CC=gcc
++ fi
++ if [ "${JAVA_HOME}" = "" ]; then
++ export JAVA_HOME=`readlink -f /usr/bin/java | sed "s:jre/bin/java::"`
++ fi
++ if [ "${PKG_CONFIG_PATH}" = "" ]; then
++ export PKG_CONFIG_PATH="/usr/lib64/pkgconfig/"
++ fi
++ ;;
+ "linux.s390x")
+ if [ "${CC}" = "" ]; then
+ export CC=gcc
+@@ -195,7 +210,7 @@ esac
+
+
+ # For 64-bit CPUs, we have a switch
+-if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ia64' -o ${MODEL} = 's390x' -o ${MODEL} = 'ppc64le' -o ${MODEL} = 'aarch64' ]; then
++if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ia64' -o ${MODEL} = 's390x' -o ${MODEL} = 'ppc64le' -o ${MODEL} = 'aarch64' -o ${MODEL} = 'loongarch64' ]; then
+ SWT_PTR_CFLAGS=-DJNI64
+ if [ -d /lib64 ]; then
+ XLIB64=-L/usr/X11R6/lib64
+@@ -215,6 +230,11 @@ if [ ${MODEL} = 'x86' -a ${SWT_OS} = 'linux' ]; then
+ export SWT_LFLAGS SWT_PTR_CFLAGS
+ fi
+
++if [ ${MODEL} = 'loongarch64' -a ${SWT_OS} = 'linux' ]; then
++ SWT_LFLAGS=-o32
++ export SWT_LFLAGS SWT_PTR_CFLAGS
++fi
++
+ if [ x`pkg-config --exists cairo && echo YES` = "xYES" ]; then
+ func_echo_plus "Cairo found, compiling SWT support for the cairo graphics library."
+ MAKE_CAIRO=make_cairo
+@@ -365,4 +385,4 @@ elif [ "${GTK_VERSION}" = "4.0" ]; then
+ elif [ "${GTK_VERSION}" = "3.0" -o "${GTK_VERSION}" = "" ]; then
+ export GTK_VERSION="3.0"
+ func_build_gtk3 "$@"
+-fi
+\ No newline at end of file
++fi
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/META-INF/p2.inf b/eclipse.platform.swt/bundles/org.eclipse.swt/META-INF/p2.inf
+index b5b0b82..b9494a3 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/META-INF/p2.inf
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/META-INF/p2.inf
+@@ -44,3 +44,8 @@ requires.9.namespace = org.eclipse.equinox.p2.iu
+ requires.9.name = org.eclipse.swt.gtk.linux.x86
+ requires.9.range = [$version$,$version$]
+ requires.9.filter = (&(osgi.os=linux)(osgi.ws=gtk)(osgi.arch=x86)(!(org.eclipse.swt.buildtime=true)))
++
++requires.10.namespace = org.eclipse.equinox.p2.iu
++requires.10.name = org.eclipse.swt.gtk.linux.loongarch64
++requires.10.range = [$version$,$version$]
++requires.10.filter = (&(osgi.os=linux)(osgi.ws=gtk)(osgi.arch=loongarch64)(!(org.eclipse.swt.buildtime=true)))
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/buildSWT.xml b/eclipse.platform.swt/bundles/org.eclipse.swt/buildSWT.xml
+index bf4faf7..04a0e3d 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/buildSWT.xml
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/buildSWT.xml
+@@ -69,6 +69,10 @@
+
+
+
++
++
++
++
+
+
+
+@@ -80,12 +84,12 @@
+
+
+
+-
++
+
+
+
+
+-
++
+
+
+
+@@ -122,6 +126,13 @@
+ trust="true"
+ outputproperty="m_linux_x86_64_output"
+ command="hostname"/>
++
+
+
+
++
+
+
+
+diff --git a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh
+index 43136d3..a905ab5 100755
+--- a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh
++++ b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh
+@@ -101,6 +101,11 @@ case $defaultOS in
+ defaultJavaHome=`readlink -f /usr/bin/java | sed "s:jre/bin/java::"`
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
++ "loongarch64")
++ defaultOSArch="loongarch64"
++ defaultJava=DEFAULT_JAVA_EXEC
++ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
++ ;;
+ "s390")
+ defaultOSArch="s390"
+ defaultJava=DEFAULT_JAVA_EXEC
+diff --git a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/pom.xml b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/pom.xml
+index cce14c4..c2db96e 100644
+--- a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/pom.xml
++++ b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/pom.xml
+@@ -129,6 +129,7 @@
+
+
+
++
+
+
+
+diff --git a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/resources/build.properties b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/resources/build.properties
+index 741e9b3..6146da7 100644
+--- a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/resources/build.properties
++++ b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/resources/build.properties
+@@ -29,3 +29,6 @@ root.macosx.cocoa.x86_64.permissions.755=Contents/MacOS/${launcherName}
+ root.linux.gtk.x86_64=bin/gtk/linux/x86_64,gtk_root
+ root.linux.gtk.x86_64.permissions.755=libcairo-swt.so
+
++root.linux.gtk.loongarch64=bin/gtk/linux/loongarch64,gtk_root
++root.linux.gtk.loongarch64.permissions.755=launcher
++
+diff --git a/rt.equinox.framework/pom.xml b/rt.equinox.framework/pom.xml
+index 44c1737..02de3f1 100644
+--- a/rt.equinox.framework/pom.xml
++++ b/rt.equinox.framework/pom.xml
+@@ -61,6 +61,18 @@
+ bundles/org.eclipse.equinox.launcher.gtk.linux.arm
+
+
++
++ build-native-launchers-gtk.linux.loongarch64
++
++
++ native
++ gtk.linux.loongarch64
++
++
++
++ bundles/org.eclipse.equinox.launcher.gtk.linux.loongarch64
++
++
+
+ build-native-launchers-gtk.linux.aarch64
+
+@@ -110,6 +122,7 @@
+ bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64
+ bundles/org.eclipse.equinox.launcher.gtk.linux.ppc64le
+ bundles/org.eclipse.equinox.launcher.gtk.linux.x86_64
++ bundles/org.eclipse.equinox.launcher.gtk.linux.loongarch64
+ bundles/org.eclipse.equinox.launcher.win32.win32.x86_64
+
+ bundles/org.eclipse.osgi.tests
+diff --git a/eclipse.platform.ui/features/org.eclipse.e4.rcp/feature.xml b/eclipse.platform.ui/features/org.eclipse.e4.rcp/feature.xml
+index 134aaea..3dd4d45 100644
+--- a/eclipse.platform.ui/features/org.eclipse.e4.rcp/feature.xml
++++ b/eclipse.platform.ui/features/org.eclipse.e4.rcp/feature.xml
+@@ -324,6 +324,16 @@
+ version="0.0.0"
+ fragment="true"/>
+
++
++
+
+
++
++
+
+
++
++
+ -XstartOnFirstThread
+
+
+-
++
+
+ windows
+
+diff --git a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/build.properties b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/build.properties
+index 7f6dc63..5c81817 100644
+--- a/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/build.properties
++++ b/rt.equinox.framework/features/org.eclipse.equinox.executable.feature/build.properties
+@@ -44,3 +44,6 @@ root.linux.gtk.s390x.permissions.755=launcher
+
+ root.linux.gtk.x86=bin/gtk/linux/x86,gtk_root
+ root.linux.gtk.x86.permissions.755=launcher
++
++root.linux.gtk.loongarch64=bin/gtk/linux/loongarch64,gtk_root
++root.linux.gtk.loongarch64.permissions.755=launcher
diff --git a/eclipse.spec b/eclipse.spec
index 142335bf8d6f820f599f29b6a69bbc28496f9331..22759666325a73438d96d5426ad0ea30781875b8 100644
--- a/eclipse.spec
+++ b/eclipse.spec
@@ -11,7 +11,7 @@
Name: eclipse
Epoch: 1
Version: 4.11
-Release: 8
+Release: 9
Summary: An open, extensible IDE
License: EPL-2.0
URL: http://www.eclipse.org/
@@ -47,6 +47,7 @@ Patch35: fixed-compilation-error.patch
Patch36: fix-objectweb-asm-version-to-increase.patch
# https://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=28aac2514656c669ffa16acb996c77def3d4a8d4
Patch37: CVE-2020-27225.patch
+Patch38: add_loongarch-support.patch
ExcludeArch: s390 %{arm} %{ix86}
BuildRequires: maven-local tycho tycho-extras cbi-plugins maven-antrun-plugin
BuildRequires: maven-assembly-plugin maven-dependency-plugin maven-enforcer-plugin
@@ -222,6 +223,9 @@ rm -rf rt.equinox.binaries/org.eclipse.equinox.executable/{bin,contributed}/
pushd eclipse.platform.ua
%patch37 -p1
popd
+%ifarch loongarch64
+%patch38 -p1
+%endif
rm eclipse.platform.swt/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/accessibility/Bug543949_ComponentExtentsTest.py
%pom_remove_dep :tycho-buildtimestamp-jgit eclipse-platform-parent
%pom_remove_dep :tycho-sourceref-jgit eclipse-platform-parent
@@ -275,7 +279,7 @@ sed -i -e 's/javax.annotation/javax.annotation-api/' eclipse.jdt.core/org.eclips
rm -rf eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.linux.{aarch64,s390x}
rm -rf rt.equinox.framework/bundles/org.eclipse.equinox.launcher.gtk.linux.{aarch64,s390x}
for dir in rt.equinox.binaries rt.equinox.framework/bundles eclipse.platform.swt.binaries/bundles ; do
- utils/ensure_arch.sh "$dir" x86_64 aarch64 s390x
+ utils/ensure_arch.sh "$dir" x86_64 aarch64 s390x loongarch64
done
TYCHO_ENV="linuxgtk%{_arch}"
%pom_xpath_set "pom:configuration/pom:environments" "$TYCHO_ENV" eclipse-platform-parent
@@ -765,6 +769,9 @@ echo "%{version}-%{release}" > %{buildroot}%{_eclipsedir}/.pkgs/Distro%{?dist}
%{_eclipsedir}/plugins/org.eclipse.osgi.util_*
%changelog
+* Wed Aug 09 2023 loongson - 1:4.11-9
+- Add Loongarch64 support
+
* Tue Feb 21 2023 liyanan - 1:4.11-8
- Add security compile options pie, relro and -fstack-protector-strong
- Add glassfish-jsp and glassfish-servlet-api and glassfish-el-api version limit