-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial pr #1
Open
nickdesaulniers
wants to merge
11
commits into
main
Choose a base branch
from
initial_pr
base: main
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
Initial pr #1
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
781d64c
initial commit
nickdesaulniers e8e6cd9
move kernel header to separate script
nickdesaulniers c97a251
move musl code to separate script
nickdesaulniers c5c907e
build libunwind
nickdesaulniers f6bcf36
libcxxabi
nickdesaulniers 2a4f562
license+readme
nickdesaulniers 9d50aa1
document picture of sysroot
nickdesaulniers 5c95e48
WIP: trying to get libc++ to build
nickdesaulniers 6a08c94
remove bad check that was preventing musl headers from being installed,
nickdesaulniers 9c72741
get libc++ building thanks to @compnerd
nickdesaulniers 2b697bd
fixup libunwind
nickdesaulniers 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 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 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,56 @@ | ||
set -eu | ||
|
||
MUSL_URL=git://git.musl-libc.org/musl | ||
|
||
function update_musl () { | ||
pushd musl | ||
git fetch --depth 1 | ||
git reset --hard origin/master | ||
popd | ||
} | ||
|
||
function fetch_musl () { | ||
git clone --depth=1 $MUSL_URL --branch master --single-branch | ||
} | ||
|
||
function get_or_fetch_musl () { | ||
if [[ -d musl ]]; then | ||
update_musl | ||
else | ||
fetch_musl | ||
fi; | ||
} | ||
|
||
function build_musl () { | ||
# TODO: something better than this...like if we updated musl. | ||
if [[ -d sysroot/usr/local/include ]]; then | ||
if [[ -n "$(find sysroot/usr/local/include -type f | wc -l)" ]]; then | ||
return | ||
fi; | ||
fi; | ||
|
||
BUILTINS=$(readlink -f sysroot/usr/local/lib/linux/libclang_rt.builtins-x86_64.a) | ||
CC=$(which clang) | ||
SYSROOT=$(readlink -f sysroot) | ||
rm -rf musl/build | ||
mkdir -p musl/build | ||
pushd musl/build | ||
LIBCC=$BUILTINS CC=$CC ../configure \ | ||
--prefix=/usr/local/ \ | ||
--host=x86_64-unknown-linux-musl \ | ||
--syslibdir=/usr/local/lib \ | ||
--disable-static | ||
|
||
make -j$(nproc) AR=llvm-ar RANLIB=llvm-ranlib | ||
make DESTDIR=$SYSROOT install-libs install-headers -j$(nproc) | ||
nickdesaulniers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# TODO: hack | ||
pushd $SYSROOT/usr/local/lib | ||
ln -sf libc.so ld-musl-x86_64.so.1 | ||
popd | ||
popd | ||
./test_lib.sh | ||
} | ||
|
||
get_or_fetch_musl | ||
build_musl |
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.
The user can specify
AR=llvm-ar RANLIB=llvm-ranlib
to select it.