forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cmake(): allow setting HOST_CPU for cross-compilation #3327
Merged
Conversation
This file contains 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
dennisameling
force-pushed
the
fix-host-cpu
branch
from
July 19, 2021 11:04
cf7d219
to
66f5374
Compare
Git's regular Makefile mentions that HOST_CPU should be defined when cross-compiling Git: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/Makefile#L438-L439 This is then used to set the GIT_HOST_CPU variable when compiling Git: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/Makefile#L1337-L1341 Then, when the user runs `git version --build-options`, it returns that value: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/help.c#L658 This commit adds the same functionality to the CMake configuration. Users can now set -DHOST_CPU= to set the target architecture. Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
As mentioned in the Makefile and CMakeLists.txt: "When cross-compiling, define HOST_CPU as the canonical name of the CPU on which the built Git will run (for instance "x86_64")" This commit sets the HOST_CPU variable since Git for Windows arm64 is cross-compiled from an amd64 host. Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
dennisameling
force-pushed
the
fix-host-cpu
branch
from
July 19, 2021 11:05
66f5374
to
cc48a7e
Compare
No worries about the macOS failures, I opened Homebrew/homebrew-cask#108819 which will hopefully soon be merged (and should fix this issue). |
Thank you @dennisameling! |
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Jul 19, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 20, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 21, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 21, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 22, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 23, 2021
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Jul 23, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 23, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 24, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 24, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 24, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 26, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 28, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 28, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 29, 2021
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 9, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 9, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 9, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 9, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 9, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 10, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 10, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 10, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 11, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 11, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 11, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 11, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 20, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 20, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 21, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 21, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 21, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 22, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 22, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 22, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 22, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 22, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 22, 2024
cmake(): allow setting HOST_CPU for cross-compilation
dscho
added a commit
that referenced
this pull request
Oct 23, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 25, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 25, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 25, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 30, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 1, 2024
cmake(): allow setting HOST_CPU for cross-compilation
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 6, 2024
cmake(): allow setting HOST_CPU for cross-compilation
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.
Related to #3107
As reported by @rimrul in #3083 (comment),
git version --build-options
returns the wrong CPU when building Git for ARM64 Windows.Git's regular
Makefile
mentions that HOST_CPU should be defined when cross-compiling Git:git/Makefile
Lines 438 to 439 in 37796bc
This is then used to set the GIT_HOST_CPU variable when compiling Git:
git/Makefile
Lines 1337 to 1341 in 37796bc
Then, when the user runs
git version --build-options
, it returns that value:git/help.c
Line 658 in 37796bc
This PR adds the same functionality to the CMake configuration. Users can now set -DHOST_CPU= to set the target architecture.
I split this into 2 separate commits, since
.github/git-artifacts.yml
is Git for Windows-specific and therefore can't be upstreamed.Artifacts run: https://github.com/dennisameling/git/actions/runs/1044960096 (note that this only applies to Git for Windows arm64 since the other architectures are still built using the original Makefile)