Skip to content

Errors when loading SWT library with aggregator build on Arch Linux #3428

@trancexpress

Description

@trancexpress

I build with:

git clean -fdx
git submodule foreach "git clean -fdx"
rm -rf /tmp/.m2/
mvn -e clean install -pl :eclipse-sdk-prereqs,:org.eclipse.jdt.core.compiler.batch -Dmaven.repo.local=/tmp/.m2/repository -DlocalEcjVersion=99.99
mvn -e clean verify -Pbree-libs -DaggregatorBuild=true -DskipTests=true -Dmaven.repo.local=/tmp/.m2/repository -Dcbi-ecj-version=99.99

I launch with:

/data/tmp/jep4266/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/org.eclipse.sdk.ide/linux/gtk/x86_64/eclipse/eclipse -vm /usr/lib/jvm/java-21-openjdk/bin/java -data /data/tmp/jep4266/testws6

When I launch the SDK, I see this on command line:

OpenJDK 64-Bit Server VM warning: You have loaded library /data/tmp/jep4266/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/org.eclipse.sdk.ide/linux/gtk/x86_64/eclipse/configuration/org.eclipse.osgi/273/0/.cp/libswt-gtk-4971r8.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

In the log I see this:

!SESSION 2025-10-23 20:52:30.716 -----------------------------------------------
eclipse.buildId=4.38.0.I20251023-1719
java.version=21.0.9
java.vendor=Arch Linux
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data /data/tmp/jep4266/testws6

!ENTRY org.eclipse.osgi 4 0 2025-10-23 20:52:33.811
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
        /data/tmp/jep4266/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/org.eclipse.sdk.ide/linux/gtk/x86_64/eclipse/configuration/org.eclipse.osgi/273/0/.cp/libswt-gtk-4971r8.so: /data/tmp/jep4266/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/org.eclipse.sdk.ide/linux/gtk/x86_64/eclipse/configuration/org.eclipse.osgi/273/0/.cp/libswt-gtk-4971r8.so: invalid ELF header
        no swt-gtk in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
        no swt in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
        /home/sandreev/.swt/lib/linux/x86_64/libswt-gtk-4971r8.so: /home/sandreev/.swt/lib/linux/x86_64/libswt-gtk-4971r8.so: invalid ELF header
        Can't load library: /home/sandreev/.swt/lib/linux/x86_64/libswt-gtk.so
        Can't load library: /home/sandreev/.swt/lib/linux/x86_64/libswt.so
        /home/sandreev/.swt/lib/linux/x86_64/libswt-gtk-4971r8.so: /home/sandreev/.swt/lib/linux/x86_64/libswt-gtk-4971r8.so: invalid ELF header

        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:345)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:254)
        at org.eclipse.swt.internal.C.<clinit>(C.java:20)
        at org.eclipse.swt.internal.gtk.GdkRGBA.<clinit>(GdkRGBA.java:23)
        at org.eclipse.swt.graphics.Color.init(Color.java:524)
        at org.eclipse.swt.graphics.Color.<init>(Color.java:143)
        at org.eclipse.swt.graphics.Device.<clinit>(Device.java:97)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:771)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:185)
        at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:216)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:158)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1387)

Removing ~/.swt or starting in a new workspace doesn't help.

I don't know if I'm using execstack right, but this doesn't seem to do anything:

➜  ~ /usr/lib/paxtest/execstack -c /data/tmp/jep4266/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/org.eclipse.sdk.ide/linux/gtk/x86_64/eclipse/configuration/org.eclipse.osgi/273/0/.cp/libswt-gtk-4971r8.so
Executable stack                         : Killed

Any idea what is missing here? I was using the SDK built from the aggregator repository on my system, but now it no longer works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions