[cfe-dev] Missing /usr/lib/cxa_finalize.o on Solaris 11.1

Игорь Пашев pashev.igor at gmail.com
Mon Jun 10 13:53:19 PDT 2013


Hi, all!

I'm trying to compile a C++ program on Solaris 11.1 with the lastest
LLVM and Clang
and get a failure:
../build/Debug+Asserts/bin/clang++ 1.cpp
ld: fatal: file /usr/lib/cxa_finalize.o: open failed: No such file or directory
ld: fatal: file processing errors. No output written to a.out
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is the program:
int main()
{
   return 0;
}

LLVM and Clang are takes from SVN as described here -
http://clang.llvm.org/get_started.html
LLVM revision is r183143, Clang - r183144.

Solaris info:
$ cat /etc/release
                             Oracle Solaris 11.1 X86
  Copyright (c) 1983, 2012, Oracle and/or its affiliates.  All rights reserved.
                           Assembled 19 September 2012


Linker command:
$ LD_ALTEXEC=/bin/echo ../build/Debug+Asserts/bin/clang++ 1.cpp
-C -e _start -Bdynamic --dynamic-linker /usr/lib/ld.so.1 -o a.out
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/values-Xa.o
/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/crtbegin.o
/usr/lib/cxa_finalize.o
-L/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/ /tmp/1-P9aWqd.o
-lstdc++ -lgcc_s -lgcc -lc -lm
/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/crtend.o
/usr/lib/crtn.o


clang (not clang++) - OK
g++ - OK

"pkg search -r cxa_finalize.o" shows nothing

There is no in source and build trees:
find ../llvm/ ../build/ -name cxa_finalize\*

cxa_finalize.o is mentioned only once in LLVM+Clang sources:
$ ggrep -rnH cxa_finalize.o ../llvm/
../llvm/tools/clang/lib/Driver/Tools.cpp:4958:
CmdArgs.push_back(Args.MakeArgString(LibPath + "cxa_finalize.o"));

When googling for  cxa_finalize.o I always find it in context of glibc :-)

Removing cxa_finalize.o from linker args results in a valid executable:
$ ../build/Debug+Asserts/bin/clang++ -c 1.cpp
$ ld -C -e _start -Bdynamic --dynamic-linker /usr/lib/ld.so.1 -o a.out
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/values-Xa.o
/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/crtbegin.o
-L/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/ 1.o -lstdc++ -lgcc_s
-lgcc -lc -lm /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/crtend.o
/usr/lib/crtn.o
$ ./a.out ; echo $?
0



More information about the cfe-dev mailing list