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

Stops ARM from compiling 64-bit only C++ SingleJar #3382

Closed
wants to merge 1 commit into from

Conversation

aloisklink
Copy link
Contributor

The C++ implementation of SingleJar only works for 64-bit platforms, as
it uses memory mapped files. Attempting to compile this on a 32-bit
platform gives the following error from src/tools/singlejar/mapped_file.h:

src/tools/singlejar/mapped_file.h:40:2: error: #error This code for 64bit Unix.
#error This code for 64 bit Unix.

As ARM is usually 32-bit (and I believe even the aarch64 64-bit ARM is still using
the ARM 32-bit compiler when compiling bazel, see
src/main/java/com/google/devtools/build/lib/util/CPU.java and
tools/cpp/lib_cc_configure.bzl), forcing bazel to use the SingleJar_deploy.jar java implementation of SingleJar fixes this issue.

I suspect 32-bit Unix has the same issue, which could be fixed by adding the same configuration for piii, but I don't have a 32-bit x86 system to test it on. But if anyone is here by Googling the above error code, try replacing all the arm references in this pull request with piii!

The C++ implementation of SingleJar only works for 64-bit platforms, as
it uses memory mapped files. Attempting to compile this on a 32-bit
platform gives the following error:

src/tools/singlejar/mapped_file.h:40:2: error: #error This code for 64bit Unix.
 #error This code for 64 bit Unix.

As ARM is usually 32-bit (and even the aarch64 64-bit ARM is still using
the ARM 32-bit compiler when compiling bazel, see
src/main/java/com/google/devtools/build/lib/util/CPU.java and
tools/cpp/lib_cc_configure.bzl), this allows bazel to be compiled on ARM
chips, by forcing bazel to  use the Java implementation of SingleJar.
@bazel-io
Copy link
Member

Can one of the admins verify this patch?

@aehlig
Copy link
Contributor

aehlig commented Jul 18, 2017

Over to the singlejar owners.

@dslomov
Copy link
Contributor

dslomov commented Jul 24, 2017

I'll merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants