Skip to content

Conversation

Vitriol1744
Copy link

No description provided.

Copy link
Member

@no92 no92 left a 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,
Copy link
Member

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
Copy link
Member

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));
Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor

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
Copy link
Member

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() {
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants