Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 0bfa75530 -> 5c5a987ef


MYNEWT-365 newt can't handle files with spaces

This ticket's sister commit changed newt in a way that breaks
compatibility with the core repo.  This commit makes the core repo
compatible with newt again.

Newt no longer invokes /bin/sh to execute external commands.  Instead,
it now uses the Go exec library to fork+exec child processes.

NOTE: This commit breaks backwards-compatibility with the Mynewt core
repo.  Specifically, the compiler.yml definitions indicated command line
options as a space-delimited sequence of strings in the path settings.
E.g., the Cortex M4 assembler specified the following path:

    compiler.path.as: arm-none-eabi-gcc -x assembler-with-cpp

This compiler definition has now been changed to the following:

    compiler.path.as: arm-none-eabi-gcc
    compiler.as.flags: [-x, assembler-with-cpp]

We could have maintained backwards-compatibility by splitting paths on
spaces and interpreting secondary tokens as command-line options.
However, this approach prevents us from specifying a compiler path
that actually contains spaces.  I think paths with spaces is not
uncommon (e.g., "/Applications/GNU ARM Eclipse/...")

In addition, some packages' cflags contained shell-escaped strings
(e.g., backslash-quote).  These escapes had to be removed now that the
flags aren't passing through the shell.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/5c5a987e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/5c5a987e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/5c5a987e

Branch: refs/heads/develop
Commit: 5c5a987ef72ae9b3eb682f19d7d0bdc85f7e500c
Parents: 0bfa755
Author: Christopher Collins <ccoll...@apache.org>
Authored: Thu Dec 1 11:47:23 2016 -0800
Committer: Christopher Collins <ccoll...@apache.org>
Committed: Thu Dec 1 11:47:23 2016 -0800

----------------------------------------------------------------------
 compiler/arm-none-eabi-m0/compiler.yml | 4 +++-
 compiler/arm-none-eabi-m4/compiler.yml | 6 ++++--
 compiler/mips/compiler.yml             | 4 +++-
 compiler/sim-mips/compiler.yml         | 3 ++-
 compiler/sim/compiler.yml              | 5 +++--
 crypto/mbedtls/pkg.yml                 | 2 +-
 6 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5c5a987e/compiler/arm-none-eabi-m0/compiler.yml
----------------------------------------------------------------------
diff --git a/compiler/arm-none-eabi-m0/compiler.yml 
b/compiler/arm-none-eabi-m0/compiler.yml
index 15bb043..4c2369b 100644
--- a/compiler/arm-none-eabi-m0/compiler.yml
+++ b/compiler/arm-none-eabi-m0/compiler.yml
@@ -20,7 +20,7 @@
 compiler.path.cc: arm-none-eabi-gcc
 compiler.path.cpp: arm-none-eabi-g++
 compiler.path.archive: arm-none-eabi-ar
-compiler.path.as: arm-none-eabi-gcc -x assembler-with-cpp
+compiler.path.as: arm-none-eabi-gcc
 compiler.path.objdump: arm-none-eabi-objdump
 compiler.path.objsize: arm-none-eabi-size
 compiler.path.objcopy: arm-none-eabi-objcopy
@@ -29,6 +29,8 @@ compiler.flags.default: -mcpu=cortex-m0 -mthumb-interwork 
-mthumb -Wall -Werror
 compiler.flags.optimized: [compiler.flags.default, -Os -ggdb]
 compiler.flags.debug: [compiler.flags.default, -O1 -ggdb]
 
+compiler.as.flags: [-x, assembler-with-cpp]
+
 compiler.ld.flags: -static -specs=nosys.specs -lgcc -Wl,--gc-sections
 compiler.ld.resolve_circular_deps: true
 compiler.ld.mapfile: true

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5c5a987e/compiler/arm-none-eabi-m4/compiler.yml
----------------------------------------------------------------------
diff --git a/compiler/arm-none-eabi-m4/compiler.yml 
b/compiler/arm-none-eabi-m4/compiler.yml
index 66fc094..eaf5eb9 100644
--- a/compiler/arm-none-eabi-m4/compiler.yml
+++ b/compiler/arm-none-eabi-m4/compiler.yml
@@ -18,9 +18,9 @@
 #
 
 compiler.path.cc: arm-none-eabi-gcc
-compiler.path.cpp: arm-none-eabi-g++ -x c++
+compiler.path.cpp: arm-none-eabi-g++
 compiler.path.archive: arm-none-eabi-ar
-compiler.path.as: arm-none-eabi-gcc -x assembler-with-cpp
+compiler.path.as: arm-none-eabi-gcc
 compiler.path.objdump: arm-none-eabi-objdump
 compiler.path.objsize: arm-none-eabi-size
 compiler.path.objcopy: arm-none-eabi-objcopy
@@ -30,6 +30,8 @@ compiler.flags.default: [compiler.flags.base, -O1 -ggdb]
 compiler.flags.optimized: [compiler.flags.base, -Os -ggdb]
 compiler.flags.debug: [compiler.flags.base, -O1 -ggdb]
 
+compiler.as.flags: [-x, assembler-with-cpp]
+
 compiler.ld.flags: -static -specs=nosys.specs -lgcc -Wl,--gc-sections
 compiler.ld.resolve_circular_deps: true
 compiler.ld.mapfile: true

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5c5a987e/compiler/mips/compiler.yml
----------------------------------------------------------------------
diff --git a/compiler/mips/compiler.yml b/compiler/mips/compiler.yml
index 1c48fd1..6b451f9 100644
--- a/compiler/mips/compiler.yml
+++ b/compiler/mips/compiler.yml
@@ -18,7 +18,7 @@
 #
 
 compiler.path.cc: "mips-mti-elf-gcc"
-compiler.path.as: "mips-mti-elf-gcc -x assembler-with-cpp"
+compiler.path.as: "mips-mti-elf-gcc"
 compiler.path.archive: "mips-mti-elf-ar"
 compiler.path.objdump: "mips-mti-elf-objdump"
 compiler.path.objsize: "mips-mti-elf-size"
@@ -29,6 +29,8 @@ compiler.flags.default: [compiler.flags.base, -O2, -g]
 compiler.flags.optimized: [compiler.flags.base, -Os, -g]
 compiler.flags.debug: [compiler.flags.base, -g3]
 
+compiler.as.flags: [-x, assembler-with-cpp]
+
 compiler.ld.flags: -Wl,-defsym,__app_start=0x80000000
 compiler.ld.resolve_circular_deps: true
 compiler.ld.mapfile: true

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5c5a987e/compiler/sim-mips/compiler.yml
----------------------------------------------------------------------
diff --git a/compiler/sim-mips/compiler.yml b/compiler/sim-mips/compiler.yml
index ebfdd97..9aff76e 100644
--- a/compiler/sim-mips/compiler.yml
+++ b/compiler/sim-mips/compiler.yml
@@ -19,7 +19,7 @@
 
 # Default.
 compiler.path.cc: "mips-mti-linux-gnu-gcc"
-compiler.path.as: "mips-mti-linux-gnu-gcc -x assembler-with-cpp"
+compiler.path.as: "mips-mti-linux-gnu-gcc"
 compiler.path.archive: "mips-mti-linux-gnu-ar"
 compiler.path.objdump: "mips-mti-linux-gnu-objdump"
 compiler.path.objsize: "mips-mti-linux-gnu-size"
@@ -30,6 +30,7 @@ compiler.ld.resolve_circular_deps: true
 
 compiler.flags.default: [compiler.flags.base, -O1]
 compiler.flags.debug: [compiler.flags.base, -O0]
+compiler.as.flags: [-x, assembler-with-cpp]
 compiler.ld.mapfile: false
 
 # Linux.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5c5a987e/compiler/sim/compiler.yml
----------------------------------------------------------------------
diff --git a/compiler/sim/compiler.yml b/compiler/sim/compiler.yml
index d667496..1fddf4b 100644
--- a/compiler/sim/compiler.yml
+++ b/compiler/sim/compiler.yml
@@ -20,7 +20,7 @@
 # Default.
 compiler.path.cc: "gcc"
 compiler.path.cpp: "g++"
-compiler.path.as: "gcc -x assembler-with-cpp"
+compiler.path.as: "gcc"
 compiler.path.archive: "ar"
 compiler.path.objdump: "objdump"
 compiler.path.objsize: "size"
@@ -31,6 +31,7 @@ compiler.ld.resolve_circular_deps: true
 
 compiler.flags.default: [compiler.flags.base, -O1]
 compiler.flags.debug: [compiler.flags.base, -O0]
+compiler.as.flags: [-x, assembler-with-cpp]
 compiler.ld.mapfile: false
 compiler.ld.binfile: false
 
@@ -41,7 +42,7 @@ compiler.ld.flags.LINUX: -lutil
 
 # OS X.
 compiler.path.cc.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5"
-compiler.path.as.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5 -x assembler-with-cpp"
+compiler.path.as.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5"
 compiler.path.objdump.DARWIN.OVERWRITE: "gobjdump"
 compiler.path.objcopy.DARWIN.OVERWRITE: "gobjcopy"
 compiler.flags.base.DARWIN: >

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5c5a987e/crypto/mbedtls/pkg.yml
----------------------------------------------------------------------
diff --git a/crypto/mbedtls/pkg.yml b/crypto/mbedtls/pkg.yml
index f59026d..97b9f2c 100644
--- a/crypto/mbedtls/pkg.yml
+++ b/crypto/mbedtls/pkg.yml
@@ -25,5 +25,5 @@ pkg.keywords:
     - ssl
     - tls
 
-pkg.cflags: '-DMBEDTLS_USER_CONFIG_FILE=\"mbedtls/config_mynewt.h\"'
+pkg.cflags: '-DMBEDTLS_USER_CONFIG_FILE="mbedtls/config_mynewt.h"'
 pkg.cflags.TEST: -DTEST

Reply via email to