Mandrel is a downstream distribution of the GraalVM community edition. Mandrel's main goal is to provide a native-image release specifically to support Quarkus.
Other
394
stars
15
forks
source link
[24.2] Add support for building the libsvm_container.a native library #765
Is your feature request related to a problem? Please describe.
There is going to be a new native library needed for Linux. See https://github.com/oracle/graal/pull/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)
Is your feature request related to a problem? Please describe. There is going to be a new native library needed for Linux. See https://github.com/oracle/graal/pull/8989. When trying to build mandrel with it a link of a simple
HelloWorld.java
app fails with:Additional context https://github.com/oracle/graal/pull/8989