by moonlighter on 2/26/21, 5:44 PM with 11 comments
by dang on 2/26/21, 10:08 PM
Cosmopolitan Libc: build-once run-anywhere C library - https://news.ycombinator.com/item?id=25556286 - Dec 2020 (166 comments)
and the current related thread is still high on the front page—long may it reign:
Show HN: Redbean – Single-file distributable web server - https://news.ycombinator.com/item?id=26271117 - Feb 2021 (182 comments)
There are also these related threads:
Actually Portable Executable - https://news.ycombinator.com/item?id=26273960 - Feb 2021 (133 comments)
αcτµαlly pδrταblε εxεcµταblε - https://news.ycombinator.com/item?id=24256883 - Aug 2020 (286 comments)
How Fat Does a Fat Binary Need to Be? - https://news.ycombinator.com/item?id=26103769 - Feb 2021 (68 comments)
Others?
by guenthert on 2/26/21, 8:04 PM
It would have been awfully nice to state the version of the compiler and the flags being used. With gcc 10 on Linux/AMD64, libc 4.15.0, I get with '-Os':
--8<--
strlcpy:
.LFB5:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rdi, %rbp
movq %rsi, %rdi
pushq %rbx
.cfi_def_cfa_offset 24
.cfi_offset 3, -24
movq %rdx, %rbx
subq $24, %rsp
.cfi_def_cfa_offset 48
movq %rsi, 8(%rsp)
call strlen
testq %rbx, %rbx
movq 8(%rsp), %rsi
je .L1
leaq -1(%rbx), %rdx
movq %rbp, %rdi
cmpq %rax, %rdx
cmova %rax, %rdx
movq %rdx, %rcx
movq %rdx, %rcx
rep movsb
movb $0, 0(%rbp,%rd
.L1ubq $24, %rsp
.cfi_def_cfa_offset 48
movq %rsi, 8(%rsp)
call strlen
testq %rbx, %rbx
movq 8(%rsp), %rsi
je .L1
leaq -1(%rbx), %rdx
movq %rbp, %rdi
cmpq %rax, %rdx
cmova %rax, %rdx
movq %rdx, %rcx
cmova %rax, %rdx
movq %rdx, %rcx
addq $24, %rsp
.cfi_def_cfa_offset 24
popq %rbx
.cfi_def_cfa_offset 16
popq %rbp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
-->8--
Which doesn't seem so bad.by lostmsu on 2/26/21, 10:02 PM
by musicale on 2/26/21, 8:37 PM
by gbrown_ on 2/26/21, 9:16 PM
by Gys on 2/26/21, 8:28 PM
by d33lio on 2/26/21, 9:22 PM