Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.2] Add support for building the libsvm_container.a native library #765

Closed
jerboaa opened this issue Jul 4, 2024 · 1 comment · Fixed by graalvm/mandrel-packaging#430
Assignees
Labels
affects/JDK24 Affects JDK 24 based Mandrel affects/24.2 Mandrel for JDK 24 enhancement New feature or request

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Jul 4, 2024

Is your feature request related to a problem? Please describe.
There is going to be a new native library needed for Linux. See oracle#8989. When trying to build mandrel with it a link of a simple HelloWorld.java app fails with:

Failed generating 'testme-helloworld' after 39.1s.

The build process encountered an unexpected error:

java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1

Linker command executed:
/usr/bin/gcc -z noexecstack -z text -Wl,--gc-sections -Wl,--version-script,/tmp/SVM-3234040458488234296/exported_symbols.list -Wl,-x -o /disk/graal/upstream-sources/graal/mandrel-build/testme-helloworld testme-helloworld.o /disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc/liblibchelper.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libnet.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libnio.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libjava.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libzip.a /disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc/libjvm.a -Wl,--export-dynamic -v -L/tmp/SVM-3234040458488234296 -L/disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc -L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc -L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64 -L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries -ldl -lpthread -lz -lrt

Linker command output:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-13.3.1-20240522/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.1 20240522 (Red Hat 13.3.1-1) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/13/:/usr/libexec/gcc/x86_64-redhat-linux/13/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/13/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/13/:/usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-z' 'noexecstack' '-z' 'text' '-o' '/disk/graal/upstream-sources/graal/mandrel-build/testme-helloworld' '-v' '-L/tmp/SVM-3234040458488234296' '-L/disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc' '-L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc' '-L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64' '-L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries' '-mtune=generic' '-march=x86-64' '-dumpdir' '/disk/graal/upstream-sources/graal/mandrel-build/testme-helloworld.'
 /usr/libexec/gcc/x86_64-redhat-linux/13/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/13/lto-wrapper -plugin-opt=-fresolution=/tmp/ccGS8IH1.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /disk/graal/upstream-sources/graal/mandrel-build/testme-helloworld -z noexecstack -z text /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/13/crtbegin.o -L/tmp/SVM-3234040458488234296 -L/disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc -L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc -L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64 -L/disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries -L/usr/lib/gcc/x86_64-redhat-linux/13 -L/usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/13/../../.. --gc-sections --version-script /tmp/SVM-3234040458488234296/exported_symbols.list -x testme-helloworld.o /disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc/liblibchelper.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libnet.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libnio.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libjava.a /disk/graal/upstream-sources/graal/mandrel-build/lib/static/linux-amd64/glibc/libzip.a /disk/graal/upstream-sources/graal/mandrel-build/lib/svm/clibraries/linux-amd64/glibc/libjvm.a --export-dynamic -ldl -lpthread -lz -lrt -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-redhat-linux/13/crtend.o /usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/crtn.o
/usr/bin/ld: testme-helloworld.o:(.data+0x180): undefined reference to `svm_container_physical_memory'
/usr/bin/ld: testme-helloworld.o:(.data+0x1d8): undefined reference to `svm_container_initialize'
/usr/bin/ld: testme-helloworld.o:(.data+0x668): undefined reference to `svm_container_active_processor_count'
collect2: error: ld returned 1 exit status
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.handleLinkerFailure(NativeImageViaCC.java:210)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.runLinkerCommand(NativeImageViaCC.java:154)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.write(NativeImageViaCC.java:115)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:758)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:552)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:528)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:711)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:139)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)

Additional context
oracle#8989

@jerboaa jerboaa added enhancement New feature or request affects/JDK24 Affects JDK 24 based Mandrel affects/24.2 Mandrel for JDK 24 labels Jul 4, 2024
@jerboaa jerboaa self-assigned this Jul 4, 2024
@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 4, 2024

GraalVM CE has the library in lib/svm/clibraries/linux-amd64/glibc/libsvm_container.a

@jerboaa jerboaa changed the title [24.2] Add support for building the svm_container.a native library [24.2] Add support for building the libsvm_container.a native library Jul 4, 2024
@zakkak zakkak added this to the 24.2.0.0-Final milestone Jul 4, 2024
jerboaa added a commit to jerboaa/mandrel-packaging that referenced this issue Jul 4, 2024
zakkak pushed a commit to zakkak/mandrel-packaging that referenced this issue Jul 18, 2024
Closes: graalvm/mandrel#765

Depends on this upstream PR to be merged:
oracle/graal#8989

(cherry picked from commit d6ba9ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/JDK24 Affects JDK 24 based Mandrel affects/24.2 Mandrel for JDK 24 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants