u/Accomplished-Use405

Minimizing output size

Minimizing output size

I've looked at stackoverflow answers from 10 years ago (https://irq5.io/2019/09/30/generating-small-static-binaries/ , https://stackoverflow.com/questions/33597523/why-is-smallest-compiled-exe-i-can-make-with-gcc-is-67kb/76705747#76705747 , https://stackoverflow.com/questions/6771905/how-to-decrease-the-size-of-generated-binaries , https://stackoverflow.com/questions/15314581/g-compiler-flag-to-minimize-binary-size , etc).

In all of the links on top, people were able to get sub-KB file sizes. However, no matter how much I copy and try their code, I cannot get any less then 8-9KB without assembly and upx.

Is there a reason these hacks do not work anymore?

I am on x86_64 Linux-7.2.8, gcc is 16.2.1.

Example:

$ cat t.c
#include <sys/syscall.h>
#include <unistd.h>
void _start() { syscall(SYS_exit, 0); }
$ gcc -Os -nostartfiles -static -s -Wl,--build-id=none t.c && strip a.out
$ l a.out
-rwxr-xr-x 1 name name 8.8K Oct  6 20:25 a.out

# The same code produced only 800 B in https://irq5.io/2019/09/30/generating-small-static-binaries/
u/Accomplished-Use405 — 9 days ago
▲ 2 r/stm32+1 crossposts

Minimal circuit stm32wb

Previously, when I purchased Espressif MCUs (e.g., esp32-c3, not board), it was easy to find and build minimal circuit - just few resistors.

Is it the same with pure stm32 chips, specifically stm32wb09ke? And how can I find these minimal schemes in docs?

reddit.com
u/Accomplished-Use405 — 4 months ago