diff mbox

newlib2 and CFLAGS_FOR_TARGET

Message ID 20141114105222.GA7143@xyzzy.org.uk
State Accepted, archived
Headers show

Commit Message

Bob Dunlop Nov. 14, 2014, 10:52 a.m. UTC
Hi,

I've been having problems passing CFLAGS_FOR_TARGET to newlib-2.0 
and 2.1 builds.  Basically selecting optimising for space was
overriding any other flags.

This patch placed in crosstool-ng-1.20.0/patches/newlib/2.0.0/ and
2.1.0/ prevents the override, appending the space optimising flags
to any existing settings.

Tested compiling newlib-2.0.0 for ARM with crosstool-NG-1.20.0 and
GNU Make 3.82.

This is basically a bug in newlibs configuration code not crosstool-NG
and I have reported this on their mailing list as well.

Comments

Bob Dunlop Dec. 5, 2014, 9:43 a.m. UTC | #1
Please review me

I've pushed this upstream (to gcc eventually) and it has been accepted
for future versions.  The change remains valid for existing versions.
Bryan Hundven Dec. 5, 2014, 9:52 a.m. UTC | #2
Bob,

On Fri, Dec 5, 2014 at 1:43 AM, Bob Dunlop <bob.dunlop@xyzzy.org.uk> wrote:
> Please review me
>
> I've pushed this upstream (to gcc eventually) and it has been accepted
> for future versions.  The change remains valid for existing versions.
> --
>         Bob Dunlop
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

Interesting, this patch does not cleanly apply:

-----------------------------------------------------------------------
Applying patch #410766 using 'git am -s'
Description: newlib2 and CFLAGS_FOR_TARGET
Applying: newlib2 and CFLAGS_FOR_TARGET
error: config/mt-ospace: does not exist in index
Patch failed at 0001 newlib2 and CFLAGS_FOR_TARGET
The copy of the patch that failed is found in:
   /home/bryan/crosstool-ng/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
-----------------------------------------------------------------------

If you can update the patch(s) as it should be in crosstool-ng/... In
other words, you add the patch to the right places, git add the files,
git commit (with signoff), and git send-email -cc crossgcc at
sourceware dot org --to bryanhundven at gmail dot com

Otherwise, if I commit it, then you loose on that stats for the
contribution (I get another commit :) ).

-Bryan

--
For unsubscribe information see http://sourceware.org/lists.html#faq
diff mbox

Patch

--- 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