Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: aarch64 target failing #155

Open
gfrankliu opened this issue Oct 15, 2023 · 2 comments
Open

[Bug]: aarch64 target failing #155

gfrankliu opened this issue Oct 15, 2023 · 2 comments
Labels
bug Something isn't working untriaged Requires traige

Comments

@gfrankliu
Copy link

What happened?

Compilation failed when targeting aarch64. See below error:

SUBCOMMAND: # @com_google_absl//absl/strings:cord_internal [action 'Compiling absl/strings/internal/cord_rep_btree_reader.cc', configuration: 176b5d5df169c5e83a68b4875b22e319078ba78a34afd48f69d1f7629630226d, execution platform: @local_config_platform//:host]
(cd /home/gfrankliu/.cache/bazel/_bazel_gfrankliu/48efe75e9cdaaaf5b7f7393802f01694/execroot/com_github_grpc_grpc && \
  exec env - \
    BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \
    GRPC_BAZEL_RUNTIME=1 \
    PATH=/home/gfrankliu/.local/bin:/home/gfrankliu/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/gfrankliu/go/bin \
    PWD=/proc/self/cwd \
  external/gcc_toolchain_aarch64/bin/gcc -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF bazel-out/k8-fastbuild/bin/external/com_google_absl/absl/strings/_objs/cord_internal/cord_rep_btree_reader.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/external/com_google_absl/absl/strings/_objs/cord_internal/cord_rep_btree_reader.pic.o' -fPIC '-DBAZEL_CURRENT_REPOSITORY="com_google_absl"' -iquote external/com_google_absl -iquote bazel-out/k8-fastbuild/bin/external/com_google_absl -Wno-typedef-redefinition -DGRPC_BAZEL_BUILD '-std=c++14' -Wall -Wextra -Wcast-qual -Wconversion-null -Wformat-security -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -DNOMINMAX --sysroot external/sysroot_aarch64 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-fdiagnostics-color=always' -nostdinc -nostdinc++ -Bexternal/gcc_toolchain_aarch64/bin -isystemexternal/sysroot_aarch64//aarch64-linux/include/c++/10.3.0 -isystemexternal/sysroot_aarch64//aarch64-linux/include/c++/10.3.0/aarch64-linux -isystemexternal/sysroot_aarch64//lib/gcc/aarch64-linux/10.3.0/include-fixed -isystemexternal/sysroot_aarch64//lib/gcc/aarch64-linux/10.3.0/include -isystemexternal/sysroot_aarch64//usr/include -c external/com_google_absl/absl/strings/internal/cord_rep_btree_reader.cc -o bazel-out/k8-fastbuild/bin/external/com_google_absl/absl/strings/_objs/cord_internal/cord_rep_btree_reader.pic.o)
# Configuration: 176b5d5df169c5e83a68b4875b22e319078ba78a34afd48f69d1f7629630226d
# Execution platform: @local_config_platform//:host
ERROR: /home/gfrankliu/.cache/bazel/_bazel_gfrankliu/48efe75e9cdaaaf5b7f7393802f01694/external/com_google_absl/absl/random/internal/BUILD.bazel:337:11: Compiling absl/random/internal/randen_hwaes.cc failed: (Exit 1): gcc failed: error executing command (from target @com_google_absl//absl/random/internal:randen_hwaes_impl) external/gcc_toolchain_aarch64/bin/gcc -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 50 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
aarch64-linux-gcc.br_real: error: unrecognized command-line option '-maes'
aarch64-linux-gcc.br_real: error: unrecognized command-line option '-msse4.1'
Target //:promise failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 52.470s, Critical Path: 2.08s
INFO: 146 processes: 24 internal, 122 linux-sandbox.
FAILED: Build did NOT complete successfully

Version

Development (host) and target OS/architectures:

Output of bazel --version:

INFO: Running bazel wrapper (see //tools/bazel for details), bazel version 6.3.2 will be used instead of system-wide bazel installation.
bazel 6.3.2

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

See below "How to reproduce" section for the WORKSPACE

Language(s) and/or frameworks involved:

cc/gprc

How to reproduce

git clone https://github.com/grpc/grpc.git

cd grpc

cat >> WORKSPACE << EOF

# aspect-build
http_archive(
    name = "aspect_gcc_toolchain",
    sha256 = "3341394b1376fb96a87ac3ca01c582f7f18e7dc5e16e8cf40880a31dd7ac0e1e",
    strip_prefix = "gcc-toolchain-0.4.2",
    url = "https://github.com/aspect-build/gcc-toolchain/archive/refs/tags/0.4.2.tar.gz",
)

load("@aspect_gcc_toolchain//toolchain:defs.bzl", "gcc_register_toolchain", "ARCHS")

gcc_register_toolchain(
    name = "gcc_toolchain_aarch64",
    sysroot_variant = "aarch64",
    target_arch = ARCHS.aarch64,
)

gcc_register_toolchain(
    name = "gcc_toolchain_x86_64",
    sysroot_variant = "x86_64",
    target_arch = ARCHS.x86_64,
)
EOF

cat >> .bazelrc << EOF
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build --incompatible_enable_cc_toolchain_resolution
build --reuse_sandbox_directories
EOF

bazel build //:promise -s --platforms=@aspect_gcc_toolchain//platforms:aarch64_linux


### Any other information?

_No response_
@gfrankliu gfrankliu added the bug Something isn't working label Oct 15, 2023
@github-actions github-actions bot added the untriaged Requires traige label Oct 15, 2023
@gfrankliu
Copy link
Author

BTW, x84_64 target works fine: bazel build //:promise --platforms=@aspect_gcc_toolchain//platforms:x86_64_linux

@gfrankliu
Copy link
Author

Looks like that is a bug with absl that doesn't support "platforms". I opened a ticket there abseil/abseil-cpp#1573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Requires traige
Projects
None yet
Development

No branches or pull requests

1 participant