sandboxed-api/sandboxed_api
Christian Blichmann befdb09597 Link more complex test cases dynamically
Linking glibc in fully static mode is mostly unsupported. While such binaries
can easily be produced, conflicting symbols will often make them crash at
runtime. This happens because glibc will always (try to) load some dynamically
linked libraries, even when statically linked. This includes things like the
resolver, unicode/locale handling and others.

Internally at Google, this is not a concern due to the way glibc is being built
there. But in order to make all of our tests run in the open-source version of
this code, we need to change strategy a bit.

As a rule of thumb, glibc can safely be linked statically if a program is
resonably simple and does not use any networking of locale dependent
facilities. Calling syscalls directly instead of the corresponding libc
wrappers works as well, of course.

This change adjusts linker flags and sandbox policies to be more compatible
with regular Linux distributions.

Tested:
- `ctest -R '[A-Z].*'` (all SAPI/Sandbox2 tests)
PiperOrigin-RevId: 429025901
Change-Id: I46b677d9eb61080a8fe868002a34a77de287bf2d
2022-02-16 05:59:13 -08:00
..
bazel Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
docs Update references to the new documentation 2021-12-14 09:03:29 -08:00
examples Link more complex test cases dynamically 2022-02-16 05:59:13 -08:00
sandbox2 Link more complex test cases dynamically 2022-02-16 05:59:13 -08:00
tools Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
util Avoid compiler crash with Clang 6.0 2022-02-11 09:09:01 -08:00
BUILD.bazel Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
call.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
client.cc Per-C++ specs main shouldn't be declared with C language linkage 2022-02-16 05:56:25 -08:00
CMakeLists.txt Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
config.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
embed_file.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
embed_file.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
file_toc.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
lenval_core.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
proto_arg.proto Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
proto_helper.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
proto_helper.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
rpcchannel.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
rpcchannel.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
sandbox.cc Delete deprecated ::sandbox2::Sandbox2::GetPid and its remaining call sites. 2022-02-02 09:57:11 -08:00
sandbox.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
sapi_test.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
testing.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
testing.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
transaction.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
transaction.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_abstract.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_abstract.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_array.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_int.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_int.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_lenval.cc Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_lenval.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_proto.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_ptr.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_reg.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_struct.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_type.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
var_void.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
vars.h Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00