-
-
Notifications
You must be signed in to change notification settings - Fork 164
add cryptix sysdeps - adjusted based on marv's guidelines #1451
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
base: master
Are you sure you want to change the base?
Conversation
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.
I did a quick first pass. It might be nice to squash the commits and to reword them to match the commit message style we generally use.
Once these sysdeps are reviewed, I will enable GHA for this sysdep before merging.
@@ -0,0 +1,11 @@ | |||
sysdep_supported_options = { | |||
'posix': true, | |||
'linux': true, |
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.
AFAICT the linux option seems to be incompatible with this PR - enabling this option requires providing linux kernel headers, while parts of this PR directly re-implement things they would provide.
'vfs.cpp', | ||
) | ||
|
||
rtld_dso_sources += common_sources |
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.
Are you sure these should only go into the dso sources?
size_t len = strlen(message); | ||
|
||
long nwritten = 0; | ||
do_log(MLIBC_SIG, sizeof(MLIBC_SIG)); |
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.
If you have a writev equivalent, it might be useful to use it here.
return 0; | ||
} | ||
|
||
#pragma region |
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.
Where are these pragmas supported? AFAICT this is not listed by GCC or clang anywhere, but it doesn't give warnings because we use -Wno-unknown-pragmas
.
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.
They are originally an MSVC extension but GCC >= 13 supports them and Clang since like 3.0 or something like that (+ they are only editor hints anyway to make the block of code between them foldable so they are ignored by the compilers).
@@ -0,0 +1,3 @@ | |||
#!/bin/sh |
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.
This looks like it shouldn't be checked in - we already have a helper script.
int sys_anon_allocate(size_t size, void **pointer); | ||
} | ||
|
||
LibraryGuard::LibraryGuard() { |
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 here instead of just using the init_libc
constructor?
mov %rsp, %rdi | ||
mov $main, %rsi | ||
call __mlibc_entry | ||
.section .note.GNU-stack,"",%progbitst |
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.
You might want to use GNU_STACK_NOTE
from the mlibc-asm/helpers.h
header.
No description provided.