Please excuse me if this was a duplicate posting on bazel-discuss, I can't tell if the web interface sent a message or not.
Hi all,
I'm using the following command
```
bazel build -c opt //src:bazel
```
and
```
bazel build -c opt //src:bazel-bin
```
Both produce "LSB shared object". The releases linux binaries work in the environment I'm using (linux host with older glibc libraries), but when using the source built `bazel-bin/src/bazel` something seems not statically linked correctly and I receive missing `GLIBC_<version>` errors. I think this has todo with the final linking of an executable vs shared object when building bazel from source code.
Built from source:
```
$ file bazel
bazel: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=3bb0a79a91a3c8aff414f96a5d8973bdbdf4b54c, not stripped
```
Downloaded from github releases:
```
$ file bazel
bazel: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=c26169f06e65dd020ad1c0ea4b9981759dd68ff0, not stripped
```
I was able to manually add some changes to BUILD files such as `linkstatic=1` / `features=["fully_static_link"]` / `-static -static-libstdc++` on linkeropts, which produced "LSB executable", on some of the cc_binary targets and the resulting binaries produced were LSB executable, but that seems wrong that I would need todo that the BUILD file level. I also ran into other issues where cross linking static and shared objects fails for some external libraries.
I think the short and hopefully simple question is, what flags/commands do I need to use to build a bazel executable similar to the release from source?
--
Adam M. Singer Software Engineer, Scala/Build Team, Twitter, Inc.