This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Don't override CFLAGS_FOR_TARGET when optimising for size
- From: Bob Dunlop <bob dot dunlop at xyzzy dot org dot uk>
- To: newlib at sourceware dot org
- Date: Thu, 13 Nov 2014 14:02:06 +0000
- Subject: [PATCH] Don't override CFLAGS_FOR_TARGET when optimising for size
- Authentication-results: sourceware.org; auth=none
Hi,
This patch prevents optmizing for space overriding any other
CFLAGS_FOR_TARGET that may already be set. Found when trying
to set -fno-omit-frame-pointer for compatability with some
in house code.
Simply append the space optimisation flags to the CFLAGS_FOR_TARGET
set rather than replacing.
Tested compiling newlib-2.0.0 for ARM with crosstool-NG-1.20.0 and
GNU Make 3.82.
Same patch for 2.1.0.
--
Bob Dunlop
--- newlib-2.0.0/config/mt-ospace-orig 2014-11-13 12:02:45.463578281 +0000
+++ newlib-2.0.0/config/mt-ospace 2014-11-13 12:03:01.409592374 +0000
@@ -1,3 +1,3 @@
# Build libraries optimizing for space, not speed.
- CFLAGS_FOR_TARGET = -g -Os
- CXXFLAGS_FOR_TARGET = -g -Os
+ CFLAGS_FOR_TARGET += -g -Os
+ CXXFLAGS_FOR_TARGET += -g -Os