Skip to content

envoy 1.22.2 build failed: reloc-info.cc failed: (Exit 1): clang failed #21674

@eoregua

Description

@eoregua

Hi,

The build of envoy 1.22.2 is failing:

[2,985 / 6,923] Compiling src/torque/torque-parser.cc; 11s processwrapper-sandbox ... (4 actions running)
[4,394 / 9,011] Compiling external/v8/noicu/torque-generated/src/builtins/frames-tq-csa.cc; 5s processwrapper-sandbox ... (4 actions running)
[4,453 / 9,011] Compiling external/v8/noicu/torque-generated/src/builtins/promise-abstract-operations-tq-csa.cc; 9s processwrapper-sandbox ... (4 actions running)
[4,509 / 9,011] Compiling external/v8/noicu/torque-generated/src/builtins/base-tq-csa.cc; 17s processwrapper-sandbox ... (4 actions running)
ERROR: /root/.cache/bazel/_bazel_root/221703495c2e97a5482194eda3ea2f8b/external/v8/BUILD.bazel:3364:11: Compiling src/codegen/reloc-info.cc failed: (Exit 1): clang failed: error executing command /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 78 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:109:38: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
  static int input_offset() { return offsetof(Deoptimizer, input_); }
                                     ^                     ~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:111:12: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
    return offsetof(Deoptimizer, output_count_);
           ^                     ~~~~~~~~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:113:39: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
  static int output_offset() { return offsetof(Deoptimizer, output_); }
                                      ^                     ~~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:116:12: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
    return offsetof(Deoptimizer, caller_frame_top_);
           ^                     ~~~~~~~~~~~~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
4 errors generated.
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 538.529s, Critical Path: 49.13s
INFO: 4522 processes: 2673 internal, 1 local, 1847 processwrapper-sandbox, 1 worker.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
Removing intermediate container e0887d1ca55f
The command '/bin/sh -c git checkout ${ENVOY_VERSION} &&        sed -i 's/"-Wno-maybe-uninitialized"/"-Wno-uninitialized"/' bazel/envoy_internal.bzl &&        CC=clang CXX=clang++ bazel build --define tcmalloc=gperftools --fission=no -c opt //source/exe:envoy-static &&	strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy' returned a non-zero code: 1

DockerFile used for the build:

RUN wget -q -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.7.4/bazelisk-linux-amd64 && \
--
  | chmod 755 /usr/local/bin/bazel && \
  | zypper addrepo --no-check --no-gpgcheck --refresh http://download.opensuse.org/distribution/leap/15.3/repo/oss/ offical-sles \
  | && zypper install --auto-agree-with-licenses --no-confirm \
  | gcc9 \
  | gcc9-c++ \
  | lbzip2 \
  | && zypper clean --all \
  | && ln -s /usr/bin/gcc-9 /usr/bin/gcc \
  | && ln -s /usr/bin/g++-9 /usr/bin/g++ \
  | && ln -s /usr/bin/g++-9 /usr/bin/c++ \
  | && ln -s /usr/bin/gcc-9 /usr/bin/cc \
  | && ln -s /usr/bin/cpp-9 /usr/bin/cpp \
  | && wget -q  https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz \
  | && tar -xf clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz
  |  
  | WORKDIR /clang+llvm-12.0.0-x86_64-linux-sles12.4
  | RUN cp -rf bin/* /usr/bin/ \
  | && cp -rf lib/* /usr/lib/ \
  | && cp -rf share/* /usr/share/ \
  | && rm /clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz \
  | && rm -rf /clang+llvm-12.0.0-x86_64-linux-sles12.4
  | WORKDIR /
  | RUN git clone https://github.com/llvm/llvm-project.git
  | WORKDIR /llvm-project/
  | RUN git checkout llvmorg-12.0.0
  |  
  | WORKDIR /llvm-project/build/
  | RUN cmake -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi"  -Wno-error=deprecated -G "Unix Makefiles" ../llvm \
  | && make cxx \
  | && make install-cxx install-cxxabi \
  | && cp -rf /usr/local/lib/* /usr/lib/ \
  | && cp -rf /usr/local/include/* /usr/include/
  |  
  | # Seems, libncurses needs to be installed after installing parts of llvm-project
  | #
  | RUN zypper install --auto-agree-with-licenses --no-confirm libncurses5 \
  | && zypper clean --all
  | WORKDIR /tmp
  | RUN	git clone https://"${GERRIT_USERNAME}:${GERRIT_PASSWORD}"@gerrit.ericsson.se/a/3pp/foss/github.com/envoyproxy/envoy
  | #RUN git clone https://github.com/envoyproxy/envoy.git
  | WORKDIR /tmp/envoy
  | RUN	git checkout ${ENVOY_VERSION} &&\
  | sed -i 's/"-Wno-maybe-uninitialized"/"-Wno-uninitialized"/' bazel/envoy_internal.bzl &&\
  | CC=clang CXX=clang++ bazel build --define tcmalloc=gperftools --fission=no -c opt //source/exe:envoy-static &&\
  | strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy

Any change required for the build with envoy 1.22.2?
The build was working using the same dockerfile with envoy 1.22.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildquestionQuestions that are neither investigations, bugs, nor enhancementsstalestalebot believes this issue/PR has not been touched recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions