Repository navigation
Closed
Labels
Milestone
Description
Envoy build fails when the build system has libunwind installed:
ERROR: /home/vagrant/dev/envoy/source/exe/BUILD:17:1: Linking of rule '//source/exe:envoy-static' failed: Process exited with status 1 [sandboxed].
src/stacktrace_libunwind-inl.h:110: error: undefined reference to '_Ux86_64_getcontext'
src/stacktrace_libunwind-inl.h:114: error: undefined reference to '_ULx86_64_init_local'
src/stacktrace_libunwind-inl.h:118: error: undefined reference to '_ULx86_64_step'
src/stacktrace_libunwind-inl.h:136: error: undefined reference to '_ULx86_64_step'
src/stacktrace_libunwind-inl.h:129: error: undefined reference to '_ULx86_64_get_reg'
src/stacktrace_libunwind-inl.h:110: error: undefined reference to '_Ux86_64_getcontext'
src/stacktrace_libunwind-inl.h:114: error: undefined reference to '_ULx86_64_init_local'
src/stacktrace_libunwind-inl.h:118: error: undefined reference to '_ULx86_64_step'
src/stacktrace_libunwind-inl.h:136: error: undefined reference to '_ULx86_64_step'
src/stacktrace_libunwind-inl.h:129: error: undefined reference to '_ULx86_64_get_reg'
src/stacktrace_libunwind-inl.h:110: error: undefined reference to '_Ux86_64_getcontext'
src/stacktrace_libunwind-inl.h:114: error: undefined reference to '_ULx86_64_init_local'
src/stacktrace_libunwind-inl.h:122: error: undefined reference to '_ULx86_64_get_reg'
src/stacktrace_libunwind-inl.h:141: error: undefined reference to '_ULx86_64_get_reg'
src/stacktrace_libunwind-inl.h:110: error: undefined reference to '_Ux86_64_getcontext'
src/stacktrace_libunwind-inl.h:114: error: undefined reference to '_ULx86_64_init_local'
collect2: error: ld returned 1 exit status
Use --strategy=CppLink=standalone to disable sandboxing for the failing actions.
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.294s, Critical Path: 1.47s
$
tcmalloc uses libunwind if it is found at configure time, I had to do the following to get envoy to link:
diff --git a/ci/build_container/build_recipes/gperftools.sh b/ci/build_container/build_recipes/gperftools.sh
index 78da24c..21867c7 100755
--- a/ci/build_container/build_recipes/gperftools.sh
+++ b/ci/build_container/build_recipes/gperftools.sh
@@ -7,5 +7,5 @@ VERSION=2.5
wget -O gperftools-$VERSION.tar.gz https://github.com/gperftools/gperftools/releases/download/gperftools-$VERSION/gperftools-$VERSION.tar.gz
tar xf gperftools-$VERSION.tar.gz
cd gperftools-$VERSION
-LDFLAGS="-lpthread" ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no --enable-frame-pointers
+LDFLAGS="-lpthread" ./configure --prefix=$THIRDPARTY_BUILD --enable-shared=no --enable-frame-pointers --disable-libunwind
make V=1 install
libunwind is disabled in gperftools by default on ARM and OSX. My reading of the configure.ac is that when frame pointers are available libunwind is not needed. We explicitly enable frame pointers already, so this change should be harmless. With this change envoy now builds both in the docker image and on my VM.
Activity
[-]gperftools depend on libunwind, if available.[/-][+]gperftools depends on libunwind if available and causes envoy build failure.[/+]mattklein123 commentedon Jun 9, 2017
@htuch @dnoe this is related to #834. At this point is there any reason to not just set --disable-libunwind and call both issues good? Things seem to be working pretty well with frame pointers.
htuch commentedon Jun 9, 2017
Well, @alk in #834 recommends switching to libunwind if you want any insight into libraries that are provided by the system/compiler. If we're comfortable not including these for now, we can set
--disable-libunwindand call it done for now. We probably should do this anyway regardless actually, as we have random inconsistent behavior today during the build, the question is do we close out #834 or not.mattklein123 commentedon Jun 9, 2017
I don't have a strong opinion. I guess my vote would be to just set
--disable-libunwindand close both issues for now until someone is trying to debug something that annoys them due to lack of libunwind support.mattklein123 commentedon Jun 9, 2017
@jrajahalme either way can you please do a PR with your patch? We will take it.
jrajahalme commentedon Jun 9, 2017
build: Disable libunwind in gperftools config. (envoyproxy#1071)
build: Disable libunwind in gperftools config. (#1071) (#1077)
mattklein123 commentedon Jun 9, 2017
Fixed by #1077
build(deps): bump the go group across 1 directory with 5 updates (#1071)