Commit graph

1 commit

Author SHA1 Message Date
Mikhail Novosyolov
a76b281eb8 Fix building with glibc from rosa2016.1
Removed patch fixed it in one place, but now the same fix is required in another place,
make a more generic solution (borrow it from systemd)
(XXX is mixing LGPL with Apache 2.0 OK here..?)

The error was the following:

```
[16040/48909] CXX obj/mojo/core/impl_for_embedder/channel_linux.o
FAILED: obj/mojo/core/impl_for_embedder/channel_linux.o
/opt/llvm12/bin/clang++ -MMD -MF obj/mojo/core/impl_for_embedder/channel_linux.o.d -DMOJO_SYSTEM_IMPL_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-13-init-6429-g0e92cbd6-2\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=8fa87946779682841e21e2da977eccfb6cb3bded -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers -m64 -march=x86-64 -msse3 -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/ignores.txt -fsanitize=cfi-icall -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wshadow -O2 -fdata-sections -ffunction-sections -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DPROTOBUF_ALLOW_DEPRECATED=1 -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../mojo/core/channel_linux.cc -o obj/mojo/core/impl_for_embedder/channel_linux.o
../../mojo/core/channel_linux.cc:109:29: error: use of undeclared identifier 'F_SEAL_SEAL'
constexpr int kMemFDSeals = F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW;
                            ^
../../mojo/core/channel_linux.cc:109:43: error: use of undeclared identifier 'F_SEAL_SHRINK'
constexpr int kMemFDSeals = F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW;
                                          ^
../../mojo/core/channel_linux.cc:109:59: error: use of undeclared identifier 'F_SEAL_GROW'
constexpr int kMemFDSeals = F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW;
                                                          ^
../../mojo/core/channel_linux.cc:153:23: error: use of undeclared identifier 'F_ADD_SEALS'
  if (fcntl(fd.get(), F_ADD_SEALS, kMemFDSeals) < 0) {
                      ^
../../mojo/core/channel_linux.cc:165:32: error: use of undeclared identifier 'F_GET_SEALS'
  if ((seals = fcntl(fd.get(), F_GET_SEALS)) < 0) {
                               ^
5 errors generated.
```
2021-06-05 13:53:00 +03:00