Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile and get errors as undefined reference to `_Ux86_64_getcontext' #278

Closed
liudong1983 opened this issue Apr 12, 2017 · 4 comments
Closed

Comments

@liudong1983
Copy link

liudong1983 commented Apr 12, 2017

  1. download the seastar latest version

  2. we compile to get a libseastar.a file
    ./configure.py --with libseastar.a --mode release
    ninja-build
    then, we can get a libseastar.a file

  3. call seastar api ,then compile and link, we get errors
    build64_release/thirdparty/seastar/libseastar.a(reactor.o): In function backtrace<current_backtrace()::<lambda(uintptr_t)> >': /data/ckv_plus_proj/trunk/thirdparty/seastar/./util/backtrace.hh:33: undefined reference to _Ux86_64_getcontext'
    /data/ckv_plus_proj/trunk/thirdparty/seastar/./util/backtrace.hh:38: undefined reference to _ULx86_64_init_local' /data/ckv_plus_proj/trunk/thirdparty/seastar/./util/backtrace.hh:42: undefined reference to _ULx86_64_step'
    /data/ckv_plus_proj/trunk/thirdparty/seastar/./util/backtrace.hh:44: undefined reference to `_ULx86_64_get_reg'

what's the problem?don't libunwind pack to libseastar.a?

@gleb-cloudius
Copy link
Contributor

gleb-cloudius commented Apr 12, 2017 via email

@liudong1983
Copy link
Author

liudong1983 commented Apr 13, 2017

@gleb-cloudius

  1. libunwind library file is installed in /usr/local/lib directory

root@fea23:/data/ckv_plus_proj/trunk/thirdparty/seastar# ls -al /usr/local/lib/unwind
-rw-r--r-- 1 root root 235618 Apr 13 02:28 /usr/local/lib/libunwind-coredump.a
-rwxr-xr-x 1 root root 997 Apr 13 02:28 /usr/local/lib/libunwind-coredump.la
lrwxrwxrwx 1 root root 27 Apr 13 02:28 /usr/local/lib/libunwind-coredump.so -> libunwind-coredump.so.0.0.0
lrwxrwxrwx 1 root root 27 Apr 13 02:28 /usr/local/lib/libunwind-coredump.so.0 -> libunwind-coredump.so.0.0.0
-rwxr-xr-x 1 root root 103088 Apr 13 02:28 /usr/local/lib/libunwind-coredump.so.0.0.0
lrwxrwxrwx 1 root root 18 Apr 13 02:28 /usr/local/lib/libunwind-generic.a -> libunwind-x86_64.a
lrwxrwxrwx 1 root root 19 Apr 13 02:28 /usr/local/lib/libunwind-generic.so -> libunwind-x86_64.so
-rw-r--r-- 1 root root 191344 Apr 13 02:28 /usr/local/lib/libunwind-ptrace.a
-rwxr-xr-x 1 root root 983 Apr 13 02:28 /usr/local/lib/libunwind-ptrace.la
lrwxrwxrwx 1 root root 25 Apr 13 02:28 /usr/local/lib/libunwind-ptrace.so -> libunwind-ptrace.so.0.0.0
lrwxrwxrwx 1 root root 25 Apr 13 02:28 /usr/local/lib/libunwind-ptrace.so.0 -> libunwind-ptrace.so.0.0.0
-rwxr-xr-x 1 root root 80728 Apr 13 02:28 /usr/local/lib/libunwind-ptrace.so.0.0.0
-rw-r--r-- 1 root root 35316 Apr 13 02:28 /usr/local/lib/libunwind-setjmp.a
-rwxr-xr-x 1 root root 1058 Apr 13 02:28 /usr/local/lib/libunwind-setjmp.la
lrwxrwxrwx 1 root root 25 Apr 13 02:28 /usr/local/lib/libunwind-setjmp.so -> libunwind-setjmp.so.0.0.0
lrwxrwxrwx 1 root root 25 Apr 13 02:28 /usr/local/lib/libunwind-setjmp.so.0 -> libunwind-setjmp.so.0.0.0
-rwxr-xr-x 1 root root 21704 Apr 13 02:28 /usr/local/lib/libunwind-setjmp.so.0.0.0
-rw-r--r-- 1 root root 1099604 Apr 13 02:28 /usr/local/lib/libunwind-x86_64.a
-rwxr-xr-x 1 root root 1023 Apr 13 02:28 /usr/local/lib/libunwind-x86_64.la
lrwxrwxrwx 1 root root 25 Apr 13 02:28 /usr/local/lib/libunwind-x86_64.so -> libunwind-x86_64.so.8.0.1
lrwxrwxrwx 1 root root 25 Apr 13 02:28 /usr/local/lib/libunwind-x86_64.so.8 -> libunwind-x86_64.so.8.0.1
-rwxr-xr-x 1 root root 571328 Apr 13 02:28 /usr/local/lib/libunwind-x86_64.so.8.0.1
-rw-r--r-- 1 root root 829428 Apr 13 02:28 /usr/local/lib/libunwind.a
-rwxr-xr-x 1 root root 946 Apr 13 02:28 /usr/local/lib/libunwind.la
lrwxrwxrwx 1 root root 18 Apr 13 02:28 /usr/local/lib/libunwind.so -> libunwind.so.8.0.1
lrwxrwxrwx 1 root root 18 Apr 13 02:28 /usr/local/lib/libunwind.so.8 -> libunwind.so.8.0.1
-rwxr-xr-x 1 root root 374112 Apr 13 02:28 /usr/local/lib/libunwind.so.8.0.1

root@fea23:/data/ckv_plus_proj/trunk/thirdparty/seastar# nm /usr/local/lib/libunwind.a|grep _Ux86_64_getcontext
66: U _Ux86_64_getcontext
67: U _Ux86_64_getcontext_trace
266:0000000000000000 T _Ux86_64_getcontext
267:0000000000000071 T _Ux86_64_getcontext_trace

  1. i check the build.ninja file

configure_args = --mode release --with libseastar.a --ldflags '-L /usr/local/lib -lunwind'
builddir = build
cxx = g++

cxxflags = -std=gnu++1y -g -Wall -Werror -Wno-error=deprecated-declarations -fvisibility=hidden -pthread -I. -U_FORTIFY_SOURCE -Ifmt -DBOOST_TEST_DYN_LINK -Wno-overloaded-virtual -DFMT_HEADER_ONLY -DHAVE_XEN -DHAVE_HWLOC -DHAVE_NUMA -DHAVE_LZ4_COMPRESS_DEFAULT
ldflags = -g -Wl,--no-as-needed -fvisibility=hidden -pthread -L /usr/local/lib -lunwind
libs = -laio -lboost_program_options -lboost_system -lboost_filesystem -lstdc++ -lm -lboost_thread -lcryptopp -lrt -lgnutls -lgnutlsxx -llz4 -lprotobuf -ldl -lgcc_s -lunwind -lxenstore -lhwloc -lnuma -lpciaccess -lxml2 -lz -lcares-seastar

reactor.o should include the unwind library

  1. what's the difference with the libunwind and libunwind-devel? i install libunwind by download libunwind source code, then configure && make && make install
    the company's develop machine can't connect to internet and github, so it's difficult to find all the dependency.

@gleb-cloudius
Copy link
Contributor

gleb-cloudius commented Apr 13, 2017 via email

@liudong1983
Copy link
Author

liudong1983 commented Apr 13, 2017

i have solved the problem.
add -L/usr/local/lib -lunwind to ldflags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants