llvm-g++ fails to links shared lib on amd64

Bug #251457 reported by Václav Šmilauer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
llvm-gcc-4.2 (Debian)
Fix Released
Unknown
llvm-gcc-4.2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

llvm-g++ gives errors when linking shared library:

foo.cc:
   int twice(int a){return 2*a;}

llvm-g++ -o foo.os -c -fPIC foo.cc
llvm-g++ -o libfoo.so -shared foo.os
/usr/bin/ld: /usr/lib/llvm/gcc-4.2/lib/gcc/x86_64-linux-gnu/4.2.1/crtbeginS.o: relocation R_X86_64_PC32 against undefined symbol `__cxa_finalize@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

The error suggests adding -fPIC which is the case already.

Any hints?

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

(Confirmed as per debian report.)

Changed in llvm-gcc-4.2:
status: New → Confirmed
Changed in llvm-gcc-4.2:
status: Unknown → New
Changed in llvm-gcc-4.2 (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.