Your message dated Sun, 4 Dec 2016 20:16:27 +0100
with message-id <[email protected]>
and subject line Re: Bug#839615: libelfin: Library do not work with clang
has caused the Debian Bug report #839615,
regarding libelfin: Library do not work with clang
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
839615: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839615
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:libelfin
Version: 0.1+20160825.git.6eb10ca-1
Severity: important

When building the libelfin shared libraries with GCC 6 in unstable, the
resulting shared library do not work for programs compiled with clang++.

The following test code demonstrate the problem:

CXXFLAGS="-std=c++11"
PKGFLAGS="libdwarf++"
buildtest() {
    CC="$1"
    CXX="$2"
    cat > x.cpp <<EOF
#include <dwarf/dwarf++.hh>
dwarf::value v;
std::string s = v.as_string();
int main(int argc, char *argv[]) { return 0; }
EOF
    if "$CXX" $CXXFLAGS $(pkg-config --cflags "$PKGFLAGS") -c x.cpp &&
       [ -e x.o ] ; then
        echo "success: Compilation with $CC and $CXX produced x.o"
    else
        echo "error: Compilation with $CC and $CXX did not procduce x.o"
    fi
    if "$CXX" -o x x.o $(pkg-config --libs "$PKGFLAGS") &&
       [ -e x ] ; then
        echo "success: Linking with $CXX produced x"
    else
        echo "error: Linking with $CXX did not produce x"
    fi
}
buildtest clang clang++

The error from clang look like this:

x.o: In function `__cxx_global_var_init1':
x.cpp:(.text.startup+0x3d): undefined reference to `dwarf::value::as_string() 
const'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The problem is that the shared library uses an API tag for the symbol in
question:

% nm /usr/lib/x86_64-linux-gnu/libdwarf++.a |grep as_string|c++filt |grep T
0000000000002500 T dwarf::value::as_string[abi:cxx11]() const
00000000000024a0 T dwarf::value::as_string(std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >&) const
%

I have no idea how to avoid this problem.

-- 
Happy hacking
Petter Reinholdtsen

--- End Message ---
--- Begin Message ---
Version: 0.1+20160825.git.6eb10ca-6

This problem was fixed in clang and the test started working with libelfin
version 0.1+20160825.git.6eb10ca-6.  Closing.

-- 
Happy hacking
Petter Reinholdtsen

--- End Message ---

Reply via email to