Skip to content

Commit

Permalink
Merge branch 'managarm:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy-Python-Programmer authored Jan 19, 2024
2 parents 562e18a + b562768 commit 0dd4dbd
Show file tree
Hide file tree
Showing 226 changed files with 5,582 additions and 775 deletions.
80 changes: 53 additions & 27 deletions .github/workflows/abidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ on:
jobs:
run-abidiff:
name: Compare ABIs
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container:
image: ghcr.io/managarm/mlibc-crossers:latest
defaults:
run:
shell: bash
steps:
- name: Install prerequisites
run: |
sudo apt-get install ninja-build g++-10 abigail-tools
sudo pip3 install setuptools
sudo pip3 install meson xbstrap
apt-get update
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pip abigail-tools
pip install -U xbstrap pyexpect meson
- name: Checkout base branch
if: ${{ github.base_ref }}
Expand Down Expand Up @@ -56,48 +63,67 @@ jobs:
- name: Set up linux kernel headers
run: |
mkdir -p linux-headers-base/{src,build}
cp mlibc-base/ci/bootstrap.yml linux-headers-base/src/
(
cd linux-headers-base/build
xbstrap init ../src
xbstrap install linux-headers
)
mkdir -p linux-headers-branch/{src,build}
cp mlibc-branch/ci/bootstrap.yml linux-headers-branch/src/
(
cd linux-headers-branch/build
xbstrap init ../src
xbstrap install linux-headers
)
cat > linux-headers-base/build/bootstrap-site.yml << EOF
define_options:
arch: ${{matrix.arch}}
EOF
cp linux-headers-base/build/bootstrap-site.yml linux-headers-branch/build/bootstrap-site.yml
set -x
mkdir -p linux-headers-base/{src,build}
cp mlibc-base/ci/bootstrap.yml linux-headers-base/src/
(
cd linux-headers-base/build
xbstrap init ../src
xbstrap install linux-headers
)
mkdir -p linux-headers-branch/{src,build}
cp mlibc-branch/ci/bootstrap.yml linux-headers-branch/src/
(
cd linux-headers-branch/build
xbstrap init ../src
xbstrap install linux-headers
)
cat > linux-headers-base/build/bootstrap-site.yml << EOF
define_options:
arch: ${{matrix.arch}}
EOF
cp linux-headers-base/build/bootstrap-site.yml linux-headers-branch/build/bootstrap-site.yml
- name: Build and install both copies
run: |
set -xe
export C=gcc-10 CXX=g++-10
mkdir root-base root-branch
cat > linux-x86_64.cross-file <<-EOF
[binaries]
c = ['x86_64-linux-mlibc-gcc']
cpp = ['x86_64-linux-mlibc-g++']
[host_machine]
system = 'linux'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
EOF
(
cd mlibc-branch
meson --buildtype=debugoptimized -Dlinux_kernel_headers=$GITHUB_WORKSPACE/linux-headers-branch/build/packages/linux-headers/usr/include build
meson setup \
--cross-file=../linux-x86_64.cross-file \
--buildtype=debugoptimized \
-Dlinux_kernel_headers=$GITHUB_WORKSPACE/linux-headers-branch/build/packages/linux-headers/usr/include \
build
ninja -C build
DESTDIR="$GITHUB_WORKSPACE/root-branch" ninja -C build install
)
(
cd mlibc-base
# defaults to all features, linux build
meson --buildtype=debugoptimized -Dlinux_kernel_headers=$GITHUB_WORKSPACE/linux-headers-base/build/packages/linux-headers/usr/include build
meson setup \
--cross-file=../linux-x86_64.cross-file \
--buildtype=debugoptimized \
-Dlinux_kernel_headers=$GITHUB_WORKSPACE/linux-headers-branch/build/packages/linux-headers/usr/include \
build
ninja -C build
DESTDIR="$GITHUB_WORKSPACE/root-base" ninja -C build install
)
- name: Compare
run: |
# TODO(arsen): does this require handling for version suffixes?
set -e +x
exec 2>&1 # work around GHA foolishly decoupling stdout and stderr
exitcode=0
git -C mlibc-branch show -s --format=%s | grep -q abi-break || \
Expand Down
42 changes: 19 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ jobs:
build-mlibc:
strategy:
matrix:
arch: [x86_64, riscv64, aarch64]
arch: [x86_64, riscv64, aarch64, x86]
builds: [mlibc, mlibc-static, mlibc-shared, mlibc-ansi-only, mlibc-headers-only]
name: Build mlibc
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: ghcr.io/managarm/mlibc-crossers:latest
steps:
- name: Install prerequisites
# Note: the default jsonschema is too old.
# xbstrap should fix this by demanding a recent version.
run: |
sudo apt-get update
sudo apt-get install ninja-build g++-10 g++-10-riscv64-linux-gnu g++-10-aarch64-linux-gnu qemu-user
sudo pip3 install setuptools
sudo pip3 install -U jsonschema
sudo pip3 install meson xbstrap
sudo pip3 install pyexpect
apt-get update
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pexpect python3-pip netbase
pip install -U xbstrap pyexpect meson
- name: Prepare directories
run: |
mkdir src/
Expand Down Expand Up @@ -49,26 +48,23 @@ jobs:
- name: Test mlibc
run: 'meson test -v -C pkg-builds/${{matrix.builds}}'
working-directory: build/
- name: Build GCC
if: ${{matrix.builds == 'mlibc' && matrix.arch == 'x86_64'}}
run: 'xbstrap install-tool gcc'
working-directory: build/

compile-sysdeps:
strategy:
matrix:
sysdeps: [dripos, lemon, aero, ironclad, lyre, keyronex]
name: Compile sysdeps
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: ghcr.io/managarm/mlibc-crossers:latest
steps:
- name: Install prerequisites
# Note: the default jsonschema is too old.
# xbstrap should fix this by demanding a recent version.
run: |
sudo apt-get install ninja-build g++-10
sudo pip3 install setuptools
sudo pip3 install -U jsonschema
sudo pip3 install meson xbstrap
apt-get update
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pip
pip install -U xbstrap meson
- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -85,8 +81,8 @@ jobs:
- name: Compile sysdeps
run: |
meson setup \
"-Dc_args=['-fno-stack-protector', '-U__linux__']" \
"-Dcpp_args=['-fno-stack-protector', '-U__linux__']" \
"-Dc_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized']" \
"-Dcpp_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized']" \
"-Dbuild_tests=true" \
"-Db_sanitize=undefined" \
"-Dlinux_kernel_headers=$(pwd)/packages/linux-headers/usr/include" \
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/detect-missing-mlibc-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Detect missing mlibc-config.h

on: [push, pull_request]

jobs:
find-misuse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: chmod +x ./scripts/check-options-header-include.sh && ./scripts/check-options-header-include.sh
20 changes: 16 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
Copyright 2015-2022 mlibc Contributors
Copyright (C) 2015-2024 mlibc Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions abis/ironclad/access.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef _ABIBITS_ACCESS_H
#define _ABIBITS_ACCESS_H

#define F_OK 1
#define R_OK 2
#define W_OK 4
#define X_OK 8

#endif // _ABIBITS_ACCESS_H
7 changes: 7 additions & 0 deletions abis/ironclad/blkcnt_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef _ABIBITS_BLKCNT_T_H
#define _ABIBITS_BLKCNT_T_H

// TODO: use int64_t?
typedef long blkcnt_t;

#endif // _ABIBITS_BLKCNT_T_H
8 changes: 8 additions & 0 deletions abis/ironclad/blksize_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef _ABIBITS_BLKSIZE_T_H
#define _ABIBITS_BLKSIZE_T_H

// TODO: use int64_t?
typedef long blksize_t;

#endif // _ABIBITS_BLKSIZE_T_H

7 changes: 7 additions & 0 deletions abis/ironclad/clockid_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef _ABIBITS_CLOCKID_T_H
#define _ABIBITS_CLOCKID_T_H

typedef long clockid_t;

#endif /* _ABIBITS_CLOCKID_T_H */

6 changes: 6 additions & 0 deletions abis/ironclad/dev_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _ABIBITS_DEV_T_H
#define _ABIBITS_DEV_T_H

typedef unsigned long dev_t;

#endif // _ABIBITS_DEV_T_H
6 changes: 6 additions & 0 deletions abis/ironclad/epoll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _ABIBITS_EPOLL_H
#define _ABIBITS_EPOLL_H

#define EPOLL_CLOEXEC 1

#endif // _ABIBITS_EPOLL_H
Loading

0 comments on commit 0dd4dbd

Please sign in to comment.