Skip to content

Commit 11f4715

Browse files
make printf functions be chosen by linker
Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
1 parent b2831c1 commit 11f4715

File tree

19 files changed

+64
-39
lines changed

19 files changed

+64
-39
lines changed

docs/static/printf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ What's the deal with printf?
77
----------------------------
88

99
The `printf` and related functions (`sprintf`, `vsprintf`, etc.) are based on a relatively `small implementation <https://github.com/CE-Programming/toolchain/blob/master/src/std/shared/nanoprintf.c>`_.
10-
However, they contribute around 7.5KiB to the resultant program.
10+
However, they contribute around 8 KiB to the resultant program.
1111
It is highly recommended to not use `printf` and related functions at all because of this.
1212
If you insist on using these functions, this page details how to do so in the next section.
1313

src/crt/bshl.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
if PREFER_OS_CRT
77

8-
__bshl := 000100h
8+
__bshl := 000100h
99

1010
else
1111

src/crt/iand.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
if PREFER_OS_CRT
77

8-
__iand := 000134h
8+
__iand := 000134h
99

1010
else
1111

src/crt/idvrmu.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
if PREFER_OS_CRT
77

8-
__idvrmu := 000144h
8+
__idvrmu := 000144h
99

1010
else
1111

src/crt/imulu.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
if PREFER_OS_CRT
77

8-
__imuls := 000154h
9-
__imulu := 000158h
8+
__imuls := 000154h
9+
__imulu := 000158h
1010

1111
else
1212

src/crt/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include $(CURDIR)/../common.mk
1919
BUILD_SRC := $(patsubst %,build/%.src,$(wildcard *.c *.cpp))
2020

2121
EZCFLAGS := -S -ffreestanding -Wall -Wextra -Oz
22-
EZCFLAGS += -D_EZ80 -DHAS_PRINTF -isystem ../libc/include -mllvm -profile-guided-section-prefix=false
22+
EZCFLAGS += -D_EZ80 -isystem ../libc/include -mllvm -profile-guided-section-prefix=false
2323
EZCXXFLAGS := $(EZCFLAGS) -fno-exceptions -fno-rtti
2424
EZCXXFLAGS += -isystem ../libc/include/c++
2525

src/libc/acos.c

Whitespace-only changes.

src/libc/acos.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
if PREFER_OS_LIBC
77

8-
_acosf := 022100h
9-
_acos := _acosf
8+
_acosf := 022100h
9+
_acos := _acosf
1010

1111
else
1212

src/libc/atof.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
if PREFER_OS_LIBC
77

8-
_atoff := 022110h
9-
_atof := _atoff
8+
_atoff := 022110h
9+
_atof := _atoff
1010

1111
else
1212

src/libc/ceil.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
if PREFER_OS_LIBC
77

8-
_ceilf := 022114h
9-
_ceil := _ceilf
8+
_ceilf := 022114h
9+
_ceil := _ceilf
1010

1111
else
1212

0 commit comments

Comments
 (0)