From 2c7bb9e84fb82ed79a9180dc1ecc9e805d70b765 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Thu, 20 Mar 2008 01:13:28 +0000 Subject: libpayload: Add -Os to the CFLAGS Adding -Os to the CFLAGS gains us about 25% smaller code (give or take). Unfortunately, it exposes a strange issue where strcpy() suddenly goes missing - we think that strcpy() is being provided by libgcc, and that for some reason, -Os changes the beahavior. Oh, well - add a quick strcpy() function and we're good. Signed-off-by: Jordan Crouse Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3175 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/libc/string.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'payloads/libpayload/libc') diff --git a/payloads/libpayload/libc/string.c b/payloads/libpayload/libc/string.c index c9f0603387..f71d1c3af6 100644 --- a/payloads/libpayload/libc/string.c +++ b/payloads/libpayload/libc/string.c @@ -142,6 +142,11 @@ char *strncpy(char *d, const char *s, int n) return d; } +char *strcpy(char *d, const char *s) +{ + return strncpy(d, s, strlen(s)); +} + char *strncat(char *d, const char *s, int n) { char *p = d + strlen(d); -- cgit v1.2.3