Hi all,

When I used the clang toolchain to build a riscv image in `vision five2`
board, I got an error message from the linker.
I can avoid this problem by adding the option
--with-extra-ldflags="-Wl,--undefined-version" when configuring.
I want to ask whether it is a bug? I think it is not convenient for
developers to add such an option manually.

configure log:
```
checking resolved symbolic links for CC... /usr/lib/llvm-18/bin/clang
configure: Using clang C compiler version 18.1.8 [Debian clang version
18.1.8 (18+b1) Target: riscv64-unknown-linux-gnu]
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether /usr/bin/clang accepts -g... yes
checking for ibm-clang++_r... [not found]
checking for clang++... /usr/bin/clang++
checking resolved symbolic links for CXX... /usr/lib/llvm-18/bin/clang
configure: Using clang C++ compiler version 18.1.8 [Debian clang version
18.1.8 (18+b1) Target: riscv64-unknown-linux-gnu]
checking whether /usr/bin/clang++ accepts -g... yes
checking how to run the C preprocessor... /usr/bin/clang -E
checking how to run the C++ preprocessor... /usr/bin/clang++ -E
configure: Using clang linker version 18.1.8 [Debian LLD 18.1.8 (compatible
with GNU linkers)]
```

building error message:
```
ld.lld: error: version script assignment of 'local' to symbol '_fini'
failed: symbol not defined
ld.lld: error: version script assignment of 'local' to symbol '_init'
failed: symbol not defined
clang++: error: linker command failed with exit code 1 (use -v to see
invocation)
gmake[3]: *** [lib/CompileJvm.gmk:183:
/home/user/source/jdk/build/linux-riscv64-server-release/support/modules_libs/java.base/server/libjvm.so]
Error 1
gmake[2]: *** [make/Main.gmk:242: hotspot-server-libs] Error 2
```

Best Regards,
-- Guoxiong

Reply via email to