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

Add support for arm64 linux. #2333

Merged
merged 5 commits into from
Jan 31, 2023
Merged

Conversation

RedstoneWizard08
Copy link
Contributor

@RedstoneWizard08 RedstoneWizard08 commented Jan 22, 2023

Closes issue #1405

Info:

  • Merges toolchain files into linux.toolchain.cmake
  • Updates build image to use ubuntu and fixes issues with x86-only packages
  • Updates build script
  • Adds general linux/arm64 support to grpc-node

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 22, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: RedstoneWizard08 / name: RedstoneWizard08 (1924d4a)

@murgatroid99
Copy link
Member

I'm concerned about updating the base image to ubuntu:22.04. Historically, we have purposely run builds in an older environment to get compatibility with a wider range of glibc versions.

@RedstoneWizard08
Copy link
Contributor Author

The only reason I did that was to get the dependents to install. I don't know if they're on other versions or operating systems, but I was on Ubuntu 22.04 at the time, so I used that. You can use whatever version or OS you want, just as long as it has the cross compilers.

@murgatroid99
Copy link
Member

OK, here are the options as I see them:

  • You get this to work with Debian Stretch
  • We use this change as is, and if there are issues with glibc compatibility I will revert this change.

@RedstoneWizard08
Copy link
Contributor Author

I'll work on using debian stretch, or some other distro with the equivalent glibc version.

@RedstoneWizard08
Copy link
Contributor Author

The main problem is finding the gcc binaries for debian stretch. I might end up pulling from the ubuntu repo and manually installing them.

@RedstoneWizard08
Copy link
Contributor Author

RedstoneWizard08 commented Jan 30, 2023

@murgatroid99 I have chosen a better third option - using static linking. This allows it to run on hopefully any glibc version (as my research says) and it compiles well with cross. The cross-compilers are unavailable for debian stretch, and they work really well on Ubuntu Jammy. Older Ubuntu versions with older or the same glibc versions (I.E. Artful) don't have cross compilers.

┌──([redacted]@remote)-[~/contrib/grpc-node/artifacts/grpc-tools/v1.12.3]
└─$ file bin/*
bin/grpc_node_plugin: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, BuildID[sha1]=1cce182e104bd076bb0ee1e2ea24f03aa0eb58ad, for GNU/Linux 3.2.0, not stripped
bin/protoc:           ELF 32-bit LSB pie executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=cefb2e76827c1d10602757355765336a017590b2, for GNU/Linux 3.2.0, not stripped
┌──([redacted]@remote)-[~/contrib/grpc-node/artifacts/grpc-tools/v1.12.3]
└─$ ldd bin/*
bin/grpc_node_plugin:
        not a dynamic executable
bin/protoc:
        not a dynamic executable
┌──([redacted]@remote)-[~/contrib/grpc-node/artifacts/grpc-tools/v1.12.3]
└─$

@murgatroid99
Copy link
Member

It looks like the static linking arguments aren't accepted on Windows, and there's a linker error on Macos.

@RedstoneWizard08
Copy link
Contributor Author

@murgatroid99 I just fixed that, hopefully.

Copy link
Member

@murgatroid99 murgatroid99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

@murgatroid99 murgatroid99 merged commit 8fd930b into grpc:master Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants