On Thu, Oct 4, 2012 at 5:11 AM, Rainer Orth <r...@cebitec.uni-bielefeld.de> wrote: > Ian Lance Taylor <i...@google.com> writes: > >> This patch to libgo changes it to use libbacktrace. Previously >> backtraces required the Go package debug/elf to register itself with the >> runtime during the package initialization, which only worked if the >> program actually imported debug/elf one way or another. Bootstrapped >> and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to >> mainline. > > Unfortunately, this breaks all use of libgo on versions of Solaris < 11 > which lack strnlen: > > Undefined first referenced > symbol in file > strnlen > /var/gcc/regression/trunk/10-gcc/build/i386- > pc-solaris2.10/libgo/.libs/libgo.so > ld: fatal: symbol referencing errors. No output written to a.out > collect2: error: ld returned 1 exit status > FAIL: bufio > > One could either try to also link libiberty into libgo.la, but that has > the complication of needing to decide whether to use libiberty.a or > pic/libiberty.a since libiberty is no libtool library.
I guess I won't try to link libgo against libiberty. I just changed libbacktrace to provide its own strnlen function, like so. Bootstrapped and ran libbacktrace testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian 2012-10-04 Ian Lance Taylor <i...@google.com> * dwarf.c: If the system header files do not declare strnlen, provide our own version.
foo.patch
Description: Binary data