summaryrefslogtreecommitdiff
path: root/py/py.mk
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-07-23 14:39:21 -0700
committerGitHub <noreply@github.com>2020-07-23 14:39:21 -0700
commit060ab8a1f030730b1b7d7fc000143c908ab844e1 (patch)
tree553077dbd3bcad8af80cedd35e255fe93d747b51 /py/py.mk
parent6a46fd5b91d92609cf33eb93f1c4e24632451d25 (diff)
parentf43834aba2ed9f8f69d961a6554bc81ecaa98f08 (diff)
Merge pull request #3194 from tannewt/gcc10
Prep for GCC10
Diffstat (limited to 'py/py.mk')
-rw-r--r--py/py.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/py.mk b/py/py.mk
index 3cb505920..3e1d7989f 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -346,6 +346,11 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/
$(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h
+# Standard C functions like memset need to be compiled with special flags so
+# the compiler does not optimise these functions in terms of themselves.
+CFLAGS_BUILTIN ?= -ffreestanding -fno-builtin -fno-lto
+$(BUILD)/lib/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN)
+
# Force nlr code to always be compiled with space-saving optimisation so
# that the function preludes are of a minimal and predictable form.
$(PY_BUILD)/nlr%.o: CFLAGS += -Os