I’ve got precompiled Clang from: https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-sparcv9-sun-solaris2.11.tar.xz
When try to run clang:
ld.so.1: clang-16: fatal: relocation error: file clang-16: symbol __cxa_atexit: referenced symbol not found
I found out that “__cxa_atexit” is feature of glibc. But there isn’t glibc for Solaris. At least when I try to configure glibc-2.37, I get:
*** The GNU C library is currently unavailable for this platform.
Can anybody help me?
Or may be clang for Solaris should be compiled with gcc without “–enable-__cxa_atexit” ? So a question comes here: how clang has been compiled with “__cxa_atexit”, while there isn’t libc on Solaris with support of it?
From ./configure gcc:
Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. This is essential for fully standards-compliant handling of destructors, but requires __cxa_atexit in libc. This option is currently only available on systems with GNU libc. When enabled, this will cause -fuse-cxa-atexit to be passed by default.
libc by Solaris:
$ nm -D /lib/64/libc.so.1 | grep __cxa_atexit
$ cat /etc/release
Oracle Solaris 11.3 SPARC
Copyright (c) 1983, 2018, Oracle and/or its affiliates. All rights reserved.
Assembled 09 May 2018