From 21f7959f64db7f3309e7f9d0d106abb1ea82f403 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Wed, 20 Feb 2013 16:38:25 +0700 Subject: emcc: Improve handling of -O flag. Previously, while gcc supports -O, emcc would fail. It now interprets -O as -O2, just as gcc does. Additionally, it was only looking at the first character after -O, so nonsense like -O34 would be accepted (and treated as -O3). --- emcc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'emcc') diff --git a/emcc b/emcc index ffce7363..33543d61 100755 --- a/emcc +++ b/emcc @@ -616,7 +616,8 @@ try: for i in range(len(newargs)): newargs[i] = newargs[i].strip() # On Windows Vista (and possibly others), excessive spaces in the command line leak into the items in this array, so trim e.g. 'foo.cpp ' -> 'foo.cpp' if newargs[i].startswith('-O'): - requested_level = newargs[i][2] + # Let -O default to -O2, which is what gcc does. + requested_level = newargs[i][2:] or '2' if requested_level == 's': print >> sys.stderr, 'emcc: warning: -Os is ignored (use -O0, -O1, -O2)' else: -- cgit v1.2.3-18-g5258