Closed Karm closed 3 years ago
It works for me locally with 21.1 Final:
2021-04-29 10:19:04.817 INFO [o.g.t.i.AppReproducersTest] (imageioAWTTest) Testing app: IMAGEIO
2021-04-29 10:20:13.278 INFO [o.g.t.i.AppReproducersTest] (imageioAWTTest) Running...
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 71.647 s - in org.graalvm.tests.integration.AppReproducersTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
~$ find /usr/ -name "*libfreetype*"
/usr/lib/debug/usr/lib64/libfreetype.so.6.16.1-2.9.1-4.el8_3.1.x86_64.debug
/usr/lib/libfreetype.so
/usr/lib/libfreetype.so.6
/usr/lib/libfreetype.so.6.16.1
/usr/lib64/libfreetype.so.6
/usr/lib64/libfreetype.so.6.16.1
/usr/lib64/vlc/plugins/text_renderer/libfreetype_plugin.so
/usr/lib64/python2.7/site-packages/PIL/.libs/libfreetype-69f25d5e.so.6.17.1
/usr/lib64/libfreetype.so
Snapshot build passes for me locally too https://ci.modcluster.io/view/Mandrel/job/mandrel-21.1-linux-build/2/
So it's either linker/compiler version or libfreetype version, env on the executor in CI :(
@Karm Probably missing freetype-devel package on the build machine where the issue happens? A -devel
package usually provides a version-less link to the versioned freetype.so.
@jerboaa My conclusion too. The list of packages for the CI executors is incomplete.
I wonder if it becomes an issue here too? https://github.com/quarkusio/quarkus-images/blob/main/modules/mandrel/21.1.0.0-Final-java11/module.yaml#L26
fontconfig does not bring freetype-devel, fontconfig-devel does...
I can give that a spin.
@Karm Where did you get the linker commandline from the native-image invokation from?
You have:
/bin/gcc -z noexecstack -Wl,--gc-sections -Wl,--dynamic-list -Wl,/tmp/SVM-4547260237648230489/exported_symbols.list -Wl,--exclude-libs,ALL -Wl,-x -o /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/apps/imageio/target/imageio target/imageio.o /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libnet.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libjavajpeg.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libnio.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/svm/clibraries/linux-amd64/liblibchelper.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libjava.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/liblcms.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libfontmanager.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libawt_headless.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libawt.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libharfbuzz.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libfdlibm.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc/libzip.a /home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/svm/clibraries/linux-amd64/libjvm.a -v -L/tmp/SVM-4547260237648230489 -L/home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/static/linux-amd64/glibc -L/home/tester/jenkins/workspace/mandrel-linux-integration-tests/21288de5/archive/mandrel-java11-master-SNAPSHOT/lib/svm/clibraries/linux-amd64 -lstdc++ -lm -lfreetype -lpthread -ldl -lz -lrt
I have:
/usr/libexec/gcc/x86_64-redhat-linux/10/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapper -plugin-opt=-fresolution=/tmp/ccGkrwC9.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/mandrel-integration-tests/apps/imageio/target/imageio -z noexecstack /usr/lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/10/crtbegin.o -L/tmp/SVM-2595749298840495695 -L/disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc -L/disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/svm/clibraries/linux-amd64 -L/usr/lib/gcc/x86_64-redhat-linux/10 -L/usr/lib/gcc/x86_64-redhat-linux/10/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/10/../../.. --gc-sections --dynamic-list /tmp/SVM-2595749298840495695/exported_symbols.list --exclude-libs ALL -x target/imageio.o /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/svm/clibraries/linux-amd64/liblibchelper.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/liblcms.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libawt_headless.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libawt.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libnet.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libjavajpeg.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libnio.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libjava.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libfdlibm.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc/libzip.a /disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/svm/clibraries/linux-amd64/libjvm.a -lstdc++ -lm -lpthread -ldl -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/10/crtend.o /usr/lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crtn.o
># COLLECT_GCC_OPTIONS='-z' 'noexecstack' '-o' '/disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/imageio' '-v' '-L/tmp/SVM-2595749298840495695' '-L/disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/static/linux-amd64/glibc' '-L/disk/graal/builds/mandrel-java11-21.1.0.0-Final/lib/svm/clibraries/linux-amd64' '-mtune=generic' '-march=x86-64'
Note that yours has -lfreetype
and mine hasn't. Why?
@Karm Could you please re-test with the mandrel 21.1 container image: quay.io/quarkus/ubi-quarkus-mandrel:21.1-java11
. It passes my simple imageio test case (a manual one), fwiw.
@jerboaa The new 21.1 image fails the ImageIO/Awt test for me on the expected libfreetype.a missing. We need to be installing the fontconfig-devel IMHO.
[target/imageio:59] classlist: 1,019.33 ms, 0.96 GB
[target/imageio:59] (cap): 491.24 ms, 0.96 GB
[target/imageio:59] setup: 1,907.48 ms, 0.96 GB
[target/imageio:59] (clinit): 416.97 ms, 2.29 GB
[target/imageio:59] (typeflow): 10,127.43 ms, 2.29 GB
[target/imageio:59] (objects): 10,463.71 ms, 2.29 GB
[target/imageio:59] (features): 770.14 ms, 2.29 GB
[target/imageio:59] analysis: 22,280.89 ms, 2.29 GB
[target/imageio:59] universe: 829.55 ms, 2.29 GB
[target/imageio:59] (parse): 3,056.31 ms, 3.21 GB
[target/imageio:59] (inline): 4,580.71 ms, 3.89 GB
[target/imageio:59] (compile): 19,417.13 ms, 5.28 GB
[target/imageio:59] compile: 28,677.08 ms, 5.28 GB
[target/imageio:59] image: 4,013.07 ms, 5.28 GB
[target/imageio:59] write: 317.42 ms, 5.28 GB
Fatal error:java.lang.RuntimeException: java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1
Based on the linker command output, possible reasons for this include:
1. It appears as though libfreetype.a is missing. Please install it.
Linker command executed:
/usr/bin/gcc -z noexecstack -Wl,--gc-sections -Wl,--dynamic-list -Wl,/tmp/SVM-14895082601658416685/exported_symbols.list -Wl,--exclude-libs,ALL -Wl,-x -o /project/target/imageio target/imageio.o /opt/mandrel/lib/static/linux-amd64/glibc/libnet.a /opt/mandrel/lib/static/linux-amd64/glibc/libjavajpeg.a /opt/mandrel/lib/static/linux-amd64/glibc/libnio.a /opt/mandrel/lib/svm/clibraries/linux-amd64/liblibchelper.a /opt/mandrel/lib/static/linux-amd64/glibc/libjava.a /opt/mandrel/lib/static/linux-amd64/glibc/liblcms.a /opt/mandrel/lib/static/linux-amd64/glibc/libfontmanager.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt_headless.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt.a /opt/mandrel/lib/static/linux-amd64/glibc/libharfbuzz.a /opt/mandrel/lib/static/linux-amd64/glibc/libfdlibm.a /opt/mandrel/lib/static/linux-amd64/glibc/libzip.a /opt/mandrel/lib/svm/clibraries/linux-amd64/libjvm.a -v -L/tmp/SVM-14895082601658416685 -L/opt/mandrel/lib/static/linux-amd64/glibc -L/opt/mandrel/lib/svm/clibraries/linux-amd64 -lstdc++ -lm -lfreetype -lpthread -ldl -lz -lrt
Linker command output:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/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,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 --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-z' 'noexecstack' '-o' '/project/target/imageio' '-v' '-L/tmp/SVM-14895082601658416685' '-L/opt/mandrel/lib/static/linux-amd64/glibc' '-L/opt/mandrel/lib/svm/clibraries/linux-amd64' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccrDo7Ex.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 /project/target/imageio -z noexecstack /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o -L/tmp/SVM-14895082601658416685 -L/opt/mandrel/lib/static/linux-amd64/glibc -L/opt/mandrel/lib/svm/clibraries/linux-amd64 -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. --gc-sections --dynamic-list /tmp/SVM-14895082601658416685/exported_symbols.list --exclude-libs ALL -x target/imageio.o /opt/mandrel/lib/static/linux-amd64/glibc/libnet.a /opt/mandrel/lib/static/linux-amd64/glibc/libjavajpeg.a /opt/mandrel/lib/static/linux-amd64/glibc/libnio.a /opt/mandrel/lib/svm/clibraries/linux-amd64/liblibchelper.a /opt/mandrel/lib/static/linux-amd64/glibc/libjava.a /opt/mandrel/lib/static/linux-amd64/glibc/liblcms.a /opt/mandrel/lib/static/linux-amd64/glibc/libfontmanager.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt_headless.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt.a /opt/mandrel/lib/static/linux-amd64/glibc/libharfbuzz.a /opt/mandrel/lib/static/linux-amd64/glibc/libfdlibm.a /opt/mandrel/lib/static/linux-amd64/glibc/libzip.a /opt/mandrel/lib/svm/clibraries/linux-amd64/libjvm.a -lstdc++ -lm -lfreetype -lpthread -ldl -lz -lrt -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o
/usr/bin/ld: cannot find -lfreetype
collect2: error: ld returned 1 exit status
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:600)
at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:499)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:370)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:531)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:119)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:568)
Caused by: java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1
Based on the linker command output, possible reasons for this include:
1. It appears as though libfreetype.a is missing. Please install it.
Linker command executed:
/usr/bin/gcc -z noexecstack -Wl,--gc-sections -Wl,--dynamic-list -Wl,/tmp/SVM-14895082601658416685/exported_symbols.list -Wl,--exclude-libs,ALL -Wl,-x -o /project/target/imageio target/imageio.o /opt/mandrel/lib/static/linux-amd64/glibc/libnet.a /opt/mandrel/lib/static/linux-amd64/glibc/libjavajpeg.a /opt/mandrel/lib/static/linux-amd64/glibc/libnio.a /opt/mandrel/lib/svm/clibraries/linux-amd64/liblibchelper.a /opt/mandrel/lib/static/linux-amd64/glibc/libjava.a /opt/mandrel/lib/static/linux-amd64/glibc/liblcms.a /opt/mandrel/lib/static/linux-amd64/glibc/libfontmanager.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt_headless.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt.a /opt/mandrel/lib/static/linux-amd64/glibc/libharfbuzz.a /opt/mandrel/lib/static/linux-amd64/glibc/libfdlibm.a /opt/mandrel/lib/static/linux-amd64/glibc/libzip.a /opt/mandrel/lib/svm/clibraries/linux-amd64/libjvm.a -v -L/tmp/SVM-14895082601658416685 -L/opt/mandrel/lib/static/linux-amd64/glibc -L/opt/mandrel/lib/svm/clibraries/linux-amd64 -lstdc++ -lm -lfreetype -lpthread -ldl -lz -lrt
Linker command output:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/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,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 --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-z' 'noexecstack' '-o' '/project/target/imageio' '-v' '-L/tmp/SVM-14895082601658416685' '-L/opt/mandrel/lib/static/linux-amd64/glibc' '-L/opt/mandrel/lib/svm/clibraries/linux-amd64' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/8/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccrDo7Ex.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 /project/target/imageio -z noexecstack /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o -L/tmp/SVM-14895082601658416685 -L/opt/mandrel/lib/static/linux-amd64/glibc -L/opt/mandrel/lib/svm/clibraries/linux-amd64 -L/usr/lib/gcc/x86_64-redhat-linux/8 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8/../../.. --gc-sections --dynamic-list /tmp/SVM-14895082601658416685/exported_symbols.list --exclude-libs ALL -x target/imageio.o /opt/mandrel/lib/static/linux-amd64/glibc/libnet.a /opt/mandrel/lib/static/linux-amd64/glibc/libjavajpeg.a /opt/mandrel/lib/static/linux-amd64/glibc/libnio.a /opt/mandrel/lib/svm/clibraries/linux-amd64/liblibchelper.a /opt/mandrel/lib/static/linux-amd64/glibc/libjava.a /opt/mandrel/lib/static/linux-amd64/glibc/liblcms.a /opt/mandrel/lib/static/linux-amd64/glibc/libfontmanager.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt_headless.a /opt/mandrel/lib/static/linux-amd64/glibc/libawt.a /opt/mandrel/lib/static/linux-amd64/glibc/libharfbuzz.a /opt/mandrel/lib/static/linux-amd64/glibc/libfdlibm.a /opt/mandrel/lib/static/linux-amd64/glibc/libzip.a /opt/mandrel/lib/svm/clibraries/linux-amd64/libjvm.a -lstdc++ -lm -lfreetype -lpthread -ldl -lz -lrt -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/8/crtend.o /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crtn.o
/usr/bin/ld: cannot find -lfreetype
collect2: error: ld returned 1 exit status
at com.oracle.svm.hosted.image.NativeImageViaCC.handleLinkerFailure(NativeImageViaCC.java:513)
at com.oracle.svm.hosted.image.NativeImageViaCC.write(NativeImageViaCC.java:460)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:710)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$2(NativeImageGenerator.java:495)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Error: Image build request failed with exit status 1
I will have it automated soon in the TS, but before I do, you can use the test app in ./apps/imageio to reproduce as follows (assuming your id -u $(whoami)
is 1000):
$ mvn clean package
$ docker run -u 1000:1000 -t --entrypoint /opt/mandrel/bin/java -v $(pwd):/project:z quay.io/quarkus/ubi-quarkus-mandrel:21.1-java11 -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/imageio.jar
$ docker run -u 1000:1000 -t --entrypoint /opt/mandrel/bin/jar -v $(pwd):/project:z quay.io/quarkus/ubi-quarkus-mandrel:21.1-java11 uf target/imageio.jar -C src/main/resources/ META-INF
$ docker run -u 1000:1000 -t -v $(pwd):/project:z quay.io/quarkus/ubi-quarkus-mandrel:21.1-java11 -H:IncludeResources=Grace_M._Hopper.jp2,MyFreeMono.ttf,MyFreeSerif.ttf --no-fallback -jar target/imageio.jar target/imageio
@Karm OK. So this seems a specific case of including fonts, hence needs freetype. Yes, the builder image should include freetype-devel
package in that case. Nice catch!
Fixed in builder images,
Why wasn't it a problem before?
Full log: