Add macOS (Apple Silicon) Docker build script#53
Open
noafroboy wants to merge 3 commits intoopen64-compiler:developfrom
Open
Add macOS (Apple Silicon) Docker build script#53noafroboy wants to merge 3 commits intoopen64-compiler:developfrom
noafroboy wants to merge 3 commits intoopen64-compiler:developfrom
Conversation
Add build-open64-docker.sh, a fully automated script that builds Open64 from source on macOS (Apple Silicon) using Docker with Rosetta emulation. The script handles: - Pre-generating targ_info files natively on ARM64 (avoids Rosetta segfaults in the x86_64 host-tool generators) - Auto-detecting available cores and RAM for optimal Docker allocation - Installing all build dependencies (Ubuntu 20.04, LLVM 11) - Configuring with --disable-jfe and building with system GCC for runtime libraries Also add a "Building on macOS" section to the README pointing to the script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update build-open64-docker.sh with fixes from end-to-end testing: - Add 'build' target to step 5 make command so it only compiles the compiler, not runtime libs (which crash under Rosetta with BUILD_COMPILER=SELF) - Add 'set -o pipefail' to step 4 so configure failures aren't silently swallowed by the pipe to tail - Fix targ_info generation: add -DTARG_X8664, compile intermediate .o files, and link GENERATED_OBJS incrementally (matching what the real build system does) Update README to reference the build script in-repo instead of via an external fork URL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove gcc-multilib/g++-multilib from apt-get install (not needed for a 64-bit-only build) - Pass --disable-multilib to configure, which also forwards it to the bundled GCC via AC_CONFIG_SUBDIRS - Remove --host/--target flags (no longer needed once the x86_64 to i686 downgrade is removed upstream) - Remove make lib2 (32-bit runtime libraries not built with multilib disabled) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build-open64-docker.sh: a fully automated build script for compiling Open64 inside Docker on macOS with Apple SiliconWhat the script does
The script runs a complete Open64 build in two Docker containers:
ARM64 container (native): builds and runs the
targ_infogenerators (isa_gen,targ_si_gen, etc.) to produce pre-generated headers. These generators segfault under Rosetta x86_64 emulation, so they must run natively.x86_64 container (Rosetta): runs the full configure + build using the pre-generated
targ_infofiles. Runtime libraries are built withLIB_BUILD_COMPILER=GNUto avoid using the freshly-builtopencc, which also crashes under Rosetta.The script auto-detects CPU cores and RAM, installs all dependencies (LLVM/Clang 11, build tools) inside the container, and caches pre-generated files for faster reruns.
Dependencies
This script works best with the following companion PRs (which fix build issues on modern Linux):
--disable-jfeconfigure flagBUILD_COMPILER=GNUPREGENERATED_TARG_INFOfor cross-compilationTest plan
./build-open64-docker.shcompletes all 6 stepsopenccbinary exists:docker exec open64-build ls /build/osprey/targdir/driver/opencc🤖 Generated with Claude Code