forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 150
Win64 LLP64 ABI support with cross-compiler tooling #630
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
Open
xdqi
wants to merge
7
commits into
lkl:master
Choose a base branch
from
xdqi:lkl-win64
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
86ce55a
lkl: add cross-compiler wrapper, custom linker, and jmp_buf
xdqi baaf3c6
lkl: add --image-base=0x10000 for Win64 PE builds
xdqi b202b7b
lkl: fix LLP64 ABI with __lkl_long_t typedef for Win64
xdqi b951be6
lkl: add SPDX tag to gcc wrapper and fix coding style
xdqi af3b0e9
lkl: rename __lkl_long_t/__lkl_ulong_t to lkl_long_t/lkl_ulong_t
xdqi 2a90ef7
lkl: include lkl_long.h in lkl.h for lkl_long_t definition
xdqi fec8f7a
lkl: update i686-w64-mingw32 binutils for mingw32 PE support
xdqi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| x86_64-w64-mingw32-gcc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
| # Shim: routes kernel code to cygwin cross-gcc, user-space to mingw-gcc. | ||
| # Cygwin-gcc: LP64 (long=64-bit), direct PE/COFF output, no Wine needed. | ||
| # Mingw-gcc: LLP64 (long=32-bit), standard Win64 libraries. | ||
| # The LKL API header uses __lkl_long_t (always 64-bit) to bridge the difference. | ||
| REAL_MINGW_GCC="/usr/bin/x86_64-w64-mingw32-gcc" | ||
| CYGWIN_GCC="/usr/bin/x86_64-pc-cygwin-gcc" | ||
| LKL_BIN_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
|
||
| # Kernel code → cygwin-gcc (LP64) | ||
| for arg in "$@"; do | ||
| if [[ "$arg" == "-D__KERNEL__" ]]; then | ||
| exec "$CYGWIN_GCC" "$@" | ||
| fi | ||
| done | ||
|
|
||
| # User-space: use mingw-gcc with patched ld via specs | ||
| SPECS="$LKL_BIN_DIR/.lkl-linker.specs" | ||
| if [[ ! -f "$SPECS" ]]; then | ||
| printf '*linker:\n%s/x86_64-w64-mingw32-ld\n' "$LKL_BIN_DIR" > "$SPECS" | ||
| fi | ||
| exec "$REAL_MINGW_GCC" -specs="$SPECS" "$@" |
|
xdqi marked this conversation as resolved.
|
Binary file not shown.
Binary file not shown.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used to make my old Cygwin GCC 11 happy. We can remove it if we maintain our own newer Cygwin cross compiler.