Elektrine lite

← Feed

@etchedpixels@mastodon.social

Post #2569261

2026-01-28 17:12 UTC

@dalias@hachyderm.io @keithp@fosstodon.org Fuzix (standard C library, 8085 CPU, not even a fancy optimizing compiler) base text data bss size hex filename 100 10c5 5c 318 5177 1439 a.out gcc on 6809 or HC11 is way way smaller but it turns out gcc seems to know to swap the printf call magically for something else in this case.

Replies (1)

  • @keithp@fosstodon.org 2026-01-28 17:17

    @etchedpixels@mastodon.social @dalias@hachyderm.io yeah, gcc converts printf("hello world\n") into puts("hello world"); That's one of the numerous optimizations present in "hosted" mode, which is why I always tell people to get rid of -ffreestanding when building with a full C library. Btw, on armhf, hello world is way smaller than on x86_64: $ size test-hello-armhf text data bss dec hex filename 1520 76 4624 6220 184c test-hello-armhf

    Open ##2569263