Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

创建lib64文件夹 #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/glibc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: glibc

on:
push:
tags:
- "v*"

jobs:
meta:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set_tag.outputs.tag }}
prerelease: ${{ steps.set_pre.outputs.prerelease }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: temp
show-progress: false

- name: Fetch history
if: ${{ !startsWith(github.ref, 'refs/pull/') }}
run: |
git init
cp $GITHUB_WORKSPACE/temp/.git/config ./.git
rm -rf $GITHUB_WORKSPACE/temp
# git config remote.origin.fetch '+refs/*:refs/*'
git fetch --filter=tree:0 # --update-head-ok
git reset --hard origin/$(git branch --show-current) || true
git checkout ${{ github.ref_name }}

- name: Set tag
id: set_tag
run: |
${{ startsWith(github.ref, 'refs/pull/') && 'cd temp' || '' }}
echo tag=$(git describe --tags --match "v*" ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT
exit ${PIPESTATUS[0]}

- name: Judge pre-release
id: set_pre
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
if [[ '${{ steps.set_tag.outputs.tag }}' =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo prerelease=false | tee -a $GITHUB_OUTPUT
else
echo prerelease=true | tee -a $GITHUB_OUTPUT
fi

- name: Generate changelog
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
this_tag=${{ steps.set_tag.outputs.tag }}
if [[ '${{ steps.set_pre.outputs.prerelease }}' != 'false' ]]; then
last_tag=$(git describe --tags --match "v*" --abbrev=0 --exclude='${{ steps.set_tag.outputs.tag }}')
else
last_tag=$(git describe --tags --match "v*" --abbrev=0 --exclude='${{ steps.set_tag.outputs.tag }}' --exclude='*-*')
fi
echo >> CHANGELOG.md
echo "**Full Changelog**: [$last_tag -> $this_tag](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/${last_tag}...${this_tag})" >> CHANGELOG.md

- name: Upload changelog to Github
uses: actions/upload-artifact@v4
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
name: changelog
path: CHANGELOG.md

build:
needs: meta
runs-on: ubuntu-latest
strategy:
matrix:
# arch: [x86_64,riscv64,aarch64]
arch: [x86_64]
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
export ARCH=${{matrix.arch}}
bash ./install_deps.sh
- name: Configure
run: |
export ARCH=${{matrix.arch}}
bash ./default_configure.sh
- name: Build
run: |
cd build
make -j $(nproc)
make install DESTDIR=$GITHUB_WORKSPACE/install -j $(nproc)
- name: Package glibc
run: |
mkdir -p release
cd install && ls -ahl && tar czvf $GITHUB_WORKSPACE/release/glibc-${{matrix.arch}}-${{ needs.meta.outputs.tag }}.tar.gz .
- name: Upload to Github
uses: actions/upload-artifact@v4
with:
name: glibc-${{matrix.arch}}
path: |
release/*.tar.gz
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [meta, build]
runs-on: ubuntu-latest
steps:
- name: Download glibc from Github
uses: actions/download-artifact@v4
with:
path: assets

- name: Cleanup files
run: |
mv -vf assets/changelog/* .
cd assets
find . -type f | while read f; do mv -fvt . $f; done

- name: Release to Github
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
files: |
assets/*
prerelease: ${{ needs.meta.outputs.prerelease != 'false' }}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ core
/linuxthreads_db
/rtkaio
*.pyc
build
install
release
19 changes: 19 additions & 0 deletions default_configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
mkdir -p build
mkdir -p install
if [ -z "$ARCH" ] || [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "riscv64" ] && [ "$ARCH" != "aarch64" ]; then
echo "No ARCH specified, use x86_64 as default"
export ARCH="x86_64"
fi
if [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "riscv64" ] || [ "$ARCH" == "aarch64" ]; then
export TRIPLET=${ARCH}-linux-gnu
fi
export BUILD=`uname -m`
cd build
../configure \
--prefix=/ \
--host=${TRIPLET} \
--build=${BUILD}-linux-gnu \
CC="${TRIPLET}-gcc -m64" \
CXX="${TRIPLET}-g++ -m64" \
CFLAGS="-O2" \
CXXFLAGS="-O2"
8 changes: 8 additions & 0 deletions dragonos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bash install_deps.sh
bash default_configure.sh
cd build
make -j $(nproc)
DESTDIR=$DADK_CURRENT_BUILD_DIR make install -j $(nproc)

mkdir -p $DADK_CURRENT_BUILD_DIR/lib64
cp $DADK_CURRENT_BUILD_DIR/lib/* $DADK_CURRENT_BUILD_DIR/lib64
17 changes: 17 additions & 0 deletions install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sudo apt-get install -y make gdb
sudo apt-get install -y texinfo gawk bison sed
sudo apt-get install -y python3-dev python-is-python3
if [ -z "$ARCH" ] || [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "riscv" ] && [ "$ARCH" != "aarch64" ]; then
echo "No ARCH specified, use x86_64 as default"
export ARCH="x86_64"
fi

if [ "$ARCH" == "riscv" ] || [ "$ARCH" == "aarch64" ]; then
export TRIPLET=${ARCH}-linux-gnu
fi

if [ "$ARCH" == "x86_64" ] ; then
export TRIPLET=x86-64-linux-gnu
fi

sudo apt-get install -y gcc-${TRIPLET}