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 Feb 24, 2024
2 parents 0dd4dbd + 471702a commit 3dd2602
Show file tree
Hide file tree
Showing 122 changed files with 2,131 additions and 464 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/abidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pip abigail-tools
pip install -U xbstrap pyexpect meson
pip install --break-system-packages -U xbstrap pyexpect meson
- name: Checkout base branch
if: ${{ github.base_ref }}
Expand Down
41 changes: 36 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pexpect python3-pip netbase
pip install -U xbstrap pyexpect meson
pip install --break-system-packages -U xbstrap pyexpect meson
- name: Prepare directories
run: |
mkdir src/
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
compile-sysdeps:
strategy:
matrix:
sysdeps: [dripos, lemon, aero, ironclad, lyre, keyronex]
sysdeps: [dripos, lemon, aero, ironclad, lyre, keyronex, managarm]
name: Compile sysdeps
runs-on: ubuntu-22.04
container:
Expand All @@ -64,11 +64,42 @@ jobs:
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pip
pip install -U xbstrap meson
pip install --break-system-packages -U xbstrap meson
- if: ${{ matrix.sysdeps == 'managarm' }}
name: Checkout bootstrap-managarm
uses: actions/checkout@v2
with:
repository: 'managarm/bootstrap-managarm'
path: src/
- name: Checkout
uses: actions/checkout@v2
with:
path: src/mlibc/
- if: ${{ matrix.sysdeps == 'managarm' }}
name: Set up managarm subprojects directory
run: |
mkdir -p src/mlibc/subprojects build
(
cd build
xbstrap init ../src
xbstrap regenerate libdrm
)
- if: ${{ matrix.sysdeps == 'managarm' }}
name: Clone managarm/managarm
uses: actions/checkout@v4
with:
repository: 'managarm/managarm'
path: 'src/mlibc/subprojects/managarm'
- if: ${{ matrix.sysdeps == 'managarm' }}
name: Clone managarm/bragi
uses: actions/checkout@v4
with:
repository: 'managarm/bragi'
path: 'src/mlibc/subprojects/bragi'
- if: ${{ matrix.sysdeps == 'managarm' }}
name: Install bragi
run: |
pip install --break-system-packages -U bragi
- name: Set up linux kernel headers
run: |
mkdir -p build/mlibc/
Expand All @@ -81,8 +112,8 @@ jobs:
- name: Compile sysdeps
run: |
meson setup \
"-Dc_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized']" \
"-Dcpp_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized']" \
"-Dc_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized', '-D__${{matrix.sysdeps}}__']" \
"-Dcpp_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized', '-D__${{matrix.sysdeps}}__']" \
"-Dbuild_tests=true" \
"-Db_sanitize=undefined" \
"-Dlinux_kernel_headers=$(pwd)/packages/linux-headers/usr/include" \
Expand Down
1 change: 1 addition & 0 deletions abis/ironclad/statvfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct statvfs {
unsigned long f_fsid;
unsigned long f_flag;
unsigned long f_namemax;
char f_basetype[80];
};

#endif /* _ABIBITS_STATVFS_H */
Expand Down
3 changes: 3 additions & 0 deletions abis/ironclad/termios.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ typedef unsigned int tcflag_t;
#define IXOFF 0x0200
#define IXON 0x0400
#define PARMRK 0x0800
#define ECHOCTL 0001000
#define IMAXBEL 0020000
#define ECHOKE 0004000

// bitwise flags for c_oflag in struct termios
#define OPOST 0x0001
Expand Down
2 changes: 1 addition & 1 deletion abis/linux/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@


// This is mlibc-specific.
#define EIEIO 1524152434
#define EIEIO 4095

#endif // _ABIBITS_ERRNO_H
8 changes: 8 additions & 0 deletions abis/linux/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <bits/posix/in_addr_t.h>
#include <bits/posix/in_port_t.h>
#include <abi-bits/socket.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -158,6 +159,8 @@ struct group_source_req {
#define IP_MULTICAST_LOOP 34
#define IP_ADD_MEMBERSHIP 35
#define IP_DROP_MEMBERSHIP 36
#define IP_UNBLOCK_SOURCE 37
#define IP_BLOCK_SOURCE 38
#define IP_ADD_SOURCE_MEMBERSHIP 39
#define IP_DROP_SOURCE_MEMBERSHIP 40
#define IP_UNICAST_IF 50
Expand All @@ -177,6 +180,9 @@ struct group_source_req {
#define IPV6_RECVHOPLIMIT 51
#define IPV6_HOPLIMIT 52

#define IPV6_RECVTCLASS 66
#define IPV6_TCLASS 67

#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP

Expand All @@ -187,6 +193,8 @@ struct group_source_req {
#define IP_PMTUDISC_INTERFACE 4
#define IP_PMTUDISC_OMIT 5

#define MCAST_BLOCK_SOURCE 43
#define MCAST_UNBLOCK_SOURCE 44
#define MCAST_JOIN_SOURCE_GROUP 46
#define MCAST_LEAVE_SOURCE_GROUP 47

Expand Down
2 changes: 2 additions & 0 deletions abis/linux/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
#define SIOCGIFINDEX 0x8933
#define SIOCATMARK 0x8905
#define SIOCGIFHWADDR 0x8927
#define SIOCGIFBRDADDR 0x8919
#define SIOCGIFNETMASK 0x891B

#endif /* _ABIBITS_IOCTLS_H */
4 changes: 4 additions & 0 deletions abis/linux/shm.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
extern "C" {
#endif

#include <unistd.h>

struct shm_info {
int used_ids;
unsigned long shm_tot;
Expand All @@ -14,6 +16,8 @@ struct shm_info {
unsigned long swap_successes;
};

#define SHMLBA (getpagesize())

#ifdef __cplusplus
}
#endif
Expand Down
13 changes: 12 additions & 1 deletion abis/linux/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
#include <abi-bits/uid_t.h>
#include <bits/size_t.h>

#define POLL_IN 1
#define POLL_OUT 2
#define POLL_MSG 3
#define POLL_ERR 4
#define POLL_PRI 5
#define POLL_HUP 6

union sigval {
int sival_int;
void *sival_ptr;
Expand Down Expand Up @@ -162,6 +169,7 @@ typedef struct __stack {
#define SIGEV_SIGNAL 0
#define SIGEV_NONE 1
#define SIGEV_THREAD 2
#define SIGEV_THREAD_ID 4

#define SEGV_MAPERR 1
#define SEGV_ACCERR 2
Expand Down Expand Up @@ -242,12 +250,15 @@ typedef struct __stack {
#define NGREG 23
#endif

#include <bits/threads.h>

struct sigevent {
union sigval sigev_value;
int sigev_notify;
int sigev_signo;
void (*sigev_notify_function)(union sigval);
// MISSING: sigev_notify_attributes
struct __mlibc_threadattr *sigev_notify_attributes;
pid_t sigev_notify_thread_id;
};

struct sigaction {
Expand Down
4 changes: 4 additions & 0 deletions abis/linux/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
#define S_ISGID 02000
#define S_ISVTX 01000

#define S_IREAD S_IRUSR
#define S_IWRITE S_IWUSR
#define S_IEXEC S_IXUSR

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
25 changes: 25 additions & 0 deletions abis/linux/vm-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@
#define MAP_FIXED 0x10
#define MAP_ANON 0x20
#define MAP_ANONYMOUS 0x20
#define MAP_GROWSDOWN 0x100
#define MAP_DENYWRITE 0x800
#define MAP_EXECUTABLE 0x1000
#define MAP_LOCKED 0x2000
#define MAP_NORESERVE 0x4000
#define MAP_POPULATE 0x8000
#define MAP_NONBLOCK 0x10000
#define MAP_STACK 0x20000
#define MAP_HUGETLB 0x40000
#define MAP_SYNC 0x80000
#define MAP_FIXED_NOREPLACE 0x100000

#define MS_ASYNC 0x01
Expand All @@ -35,11 +44,27 @@
#define MADV_WILLNEED 3
#define MADV_DONTNEED 4
#define MADV_FREE 8
#define MADV_REMOVE 9
#define MADV_DONTFORK 10
#define MADV_DOFORK 11
#define MADV_MERGEABLE 12
#define MADV_UNMERGEABLE 13
#define MADV_HUGEPAGE 14
#define MADV_NOHUGEPAGE 15
#define MADV_DONTDUMP 16
#define MADV_DODUMP 17
#define MADV_WIPEONFORK 18
#define MADV_KEEPONFORK 19
#define MADV_COLD 20
#define MADV_PAGEOUT 21
#define MADV_HWPOISON 100
#define MADV_SOFT_OFFLINE 101

#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2

#define MFD_CLOEXEC 1U
#define MFD_ALLOW_SEALING 2U
#define MFD_HUGETLB 4U

#endif // _ABIBITS_VM_FLAGS_H
35 changes: 35 additions & 0 deletions abis/lyre/statvfs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef _ABIBITS_STATVFS_H
#define _ABIBITS_STATVFS_H

#include <abi-bits/fsblkcnt_t.h>
#include <abi-bits/fsfilcnt_t.h>

#define ST_RDONLY 1
#define ST_NOSUID 2
#define ST_MANDLOCK 64

#define FSTYPSZ 16

// On Linux, this struct is not directly used by the kernel.
struct statvfs {
unsigned long f_bsize;
unsigned long f_frsize;
fsblkcnt_t f_blocks;
fsblkcnt_t f_bfree;
fsblkcnt_t f_bavail;

fsfilcnt_t f_files;
fsfilcnt_t f_ffree;
fsfilcnt_t f_favail;

unsigned long f_fsid;
char f_basetype[FSTYPSZ];

unsigned long f_flag;
unsigned long f_namemax;
char f_fstr[32];
unsigned long f_filler[16];
};

#endif /* _ABIBITS_STATVFS_H */

12 changes: 12 additions & 0 deletions ci/managarm.cross-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[binaries]
c = 'x86_64-linux-mlibc-gcc'
cpp = 'x86_64-linux-mlibc-g++'

[properties]
needs_exe_wrapper = true

[host_machine]
system = 'managarm'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
6 changes: 6 additions & 0 deletions dummy-libs/libssp/src/dummy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// We build an empty libsso because some packages expect -lssp
// The actual ssp functions are provided by libc.

extern "C" void __mlibc_libssp_dummy(void) { }

6 changes: 6 additions & 0 deletions dummy-libs/libssp_nonshared/src/dummy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// We build an empty libsso because some packages expect -lssp_nonshared
// The actual ssp functions are provided by libc.

extern "C" void __mlibc_libssp_nonshared_dummy(void) { }

Loading

0 comments on commit 3dd2602

Please sign in to comment.