@sir

test.cr (musl libc)

puts "Hello World"

0s real, 183 syscalls, 867.2KiB for stripped binary

so, better than go, which is something
@sir crystal build test.cr

crystal build --static test.cr

obviously the latter fails on glibc because glibc is a trashfire
@sir

non-static musl (26 syscalls)

1 arch_prctl
1 clock_gettime
1 execve
1 exit_group
1 getcwd
1 membarrier
1 pipe
1 set_tid_address
1 sigaltstack
1 write
2 brk
2 getrandom
2 ioctl
2 madvise
3 clone
3 fstat
4 close
4 read
8 futex
10 mprotect
10 rt_sigaction
11 fcntl
11 open
13 rt_sigprocmask
22 mmap
64 mremap

static musl (24 syscalls)

1 arch_prctl
1 clock_gettime
1 close
1 execve
1 exit_group
1 getcwd
1 open
1 pipe
1 read
1 set_tid_address
1 sigaltstack
1 write
2 getrandom
2 ioctl
2 madvise
3 brk
3 clone
5 mprotect
8 fcntl
8 futex
10 mmap
10 rt_sigaction
13 rt_sigprocmask
64 mremap
@sir

868.0K ./test
580.0K /lib/ld-musl-x86_64.so.1
4.0K /usr/lib/libpcre.so.1
4.0K /usr/lib/libevent-2.1.so.7
76.0K /usr/lib/libgcc_s.so.1
580.0K /lib/ld-musl-x86_64.so.1

2.1MiB

@sir @steph sorry to hop in thread like that, system rookie wanting to know if syscall actually are Linux kernel stuff or more baremetal stuff to the cpu?

I know they go trough kernels but wondered this

Follow

@Miaourt @sir @steph "yes"

syscalls are generally done via a cpu instruction, but it's a request for the kernel to do something

Sign in to participate in the conversation
Cybrespace

Cybrespace is an instance of Mastodon, a social network based on open web protocols and free, open-source software. It is decentralized like e-mail.