Problem building envoy on fedora 26: /usr/bin/ld.gold: error: cannot find -lstdc++

457 views
Skip to first unread message

Gary Brown

unread,
Aug 25, 2017, 9:36:24 AM8/25/17
to envoy-users
Hi

I have been able to build envoy using the docker approach - but when I try using the direct approach with bazel I get the following error:

ERROR: .../envoy/source/exe/BUILD:17:1: Linking of rule '//source/exe:envoy-static' failed (Exit 1).
/usr/bin/ld.gold: error: cannot find -lstdc++

followed by many undefined reference errors related to std.

I've checked and libstdc++ is installed:

[root@localhost envoy]# dnf info libstdc++
Failed to synchronize cache for repo 'dockerrepo', disabling.
Last metadata expiration check: 0:14:27 ago on Fri 25 Aug 2017 14:14:12 BST.
Installed Packages
Name         : libstdc++
Version      : 7.1.1
Release      : 3.fc26
Arch         : x86_64
Size         : 1.9 M
Source       : gcc-7.1.1-3.fc26.src.rpm
Repo         : @System
From repo    : @commandline
Summary      : GNU Standard C++ Library
URL          : http://gcc.gnu.org
License      : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Description  : The libstdc++ package contains a rewritten standard compliant GCC Standard
             : C++ Library.

Available Packages
Name         : libstdc++
Version      : 7.1.1
Release      : 3.fc26
Arch         : i686
Size         : 493 k
Source       : gcc-7.1.1-3.fc26.src.rpm
Repo         : fedora
Summary      : GNU Standard C++ Library
URL          : http://gcc.gnu.org
License      : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Description  : The libstdc++ package contains a rewritten standard compliant GCC Standard
             : C++ Library.


Using 'locate' I found a few locations as well as others related to docker overlays etc:

/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++.so
/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++fs.a
/usr/lib/gcc/x86_64-redhat-linux/7/32/libstdc++.a
/usr/lib/gcc/x86_64-redhat-linux/7/32/libstdc++.so
/usr/lib/gcc/x86_64-redhat-linux/7/32/libstdc++fs.a
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.24

I tried setting LD_LIBRARY_PATH to /usr/lib64 and /usr/lib/gcc/x86_64-redhat-linux/7 but without any success.

Anyone else had this problem and can provide tips on how to fix?

Thanks in advance.

Matt Klein

unread,
Aug 25, 2017, 10:46:59 AM8/25/17
to Gary Brown, vba...@redhat.com, envoy-users
+vbatts who I think has builds working on EL7 and Fedora.

--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users+unsubscribe@googlegroups.com.
To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/c39fff92-15c9-4bb5-a307-581cd433aee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Klein
Software Engineer
mkl...@lyft.com

Vincent Batts

unread,
Aug 25, 2017, 10:58:35 AM8/25/17
to Matt Klein, Gary Brown, envoy-users
it's a static compile and libstdc++ only provides the shared object. You'll need libstdc++-static

For reference, here's the *.spec https://github.com/vbatts/copr-build-envoy/blob/master/envoy.spec to build the rpms.
Or if you just want to install the binary you can `dnf copr enable -y vbatts/envoy && dnf install -y envoy`

vb

To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users...@googlegroups.com.

To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/c39fff92-15c9-4bb5-a307-581cd433aee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gary Brown

unread,
Aug 25, 2017, 11:26:15 AM8/25/17
to Vincent Batts, Matt Klein, envoy-users
Thanks Vincent - the static lib worked!

To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users+unsubscribe@googlegroups.com.

To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/c39fff92-15c9-4bb5-a307-581cd433aee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages