diff --git a/HISTORY.rst b/HISTORY.rst index 430fff87..1a18015a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,8 +4,11 @@ Release History 2.2.0 (2015-??-??) ------------------ -* Allow to specify library compatibility with the all platforms/frameworks using - ``*`` symbol in +* Allowed to specify own path to the linker script (ld) using + `build_flags `__ option + (`issue #233 `_) +* Allowed to specify library compatibility with the all platforms/frameworks + using ``*`` symbol in `library.json `__ * Fixed ``stk500v2_command(): command failed`` (`issue #238 `_) diff --git a/docs/projectconf.rst b/docs/projectconf.rst index 8aba9efe..6a39b887 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -226,10 +226,6 @@ processes: * - Format - Scope - Description - * - ``-Wp,option`` - - CPPFLAGS - - Bypass the compiler driver and pass *option* directly through to the - preprocessor * - ``-D name`` - CPPDEFINES - Predefine *name* as a macro, with definition 1. @@ -241,6 +237,10 @@ processes: - CPPDEFINES - Cancel any previous definition of *name*, either built in or provided with a ``-D`` option. + * - ``-Wp,option`` + - CPPFLAGS + - Bypass the compiler driver and pass *option* directly through to the + preprocessor * - ``-Wall`` - CCFLAGS - Turns on all optional warnings which are desirable for normal code. @@ -254,10 +254,18 @@ processes: - CCFLAGS - Process *file* as if ``#include "file"`` appeared as the first line of the primary source file. + * - ``-Idir`` + - CPPPATH + - Add the directory *dir* to the list of directories to be searched + for header files. * - ``-Wa,option`` - ASFLAGS, CCFLAGS - Pass *option* as an option to the assembler. If *option* contains commas, it is split into multiple options at the commas. + * - ``-Wl,option`` + - LINKFLAGS + - Pass *option* as an option to the linker. If *option* contains + commas, it is split into multiple options at the commas. * - ``-llibrary`` - LIBS - Search the *library* named library when linking @@ -265,10 +273,6 @@ processes: - LIBPATH - Add directory *dir* to the list of directories to be searched for ``-l``. - * - ``-Idir`` - - CPPPATH - - Add the directory *dir* to the list of directories to be searched - for header files. This option can be set by global environment variable :ref:`envvar_PLATFORMIO_BUILD_FLAGS`. @@ -278,11 +282,14 @@ Example: .. code-block:: ini [env:specific_defines] - build_flags = -O2 -Dfoo -Dbar=1 + build_flags = -Dfoo -Dbar=1 [env:specific_inclibs] build_flags = -I/opt/include -L/opt/lib -lfoo + [env:specific_ld_script] + build_flags = -Wl,-T/path/to/ld_script.ld + For more detailed information about available flags/options go to: diff --git a/platformio/__init__.py b/platformio/__init__.py index b0fff13e..77112693 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 2, "0.dev0") +VERSION = (2, 2, "0.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 2cd8b44e..79695742 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -35,9 +35,10 @@ def BuildFirmware(env): deplibs = firmenv.BuildDependentLibraries("$PROJECTSRC_DIR") # append specified LD_SCRIPT - if "LDSCRIPT_PATH" in firmenv: + if ("LDSCRIPT_PATH" in firmenv and + not any(["-Wl,-T" in f for f in firmenv['LINKFLAGS']])): firmenv.Append( - LINKFLAGS=["-T", "$LDSCRIPT_PATH"] + LINKFLAGS=["-Wl,-T", "$LDSCRIPT_PATH"] ) # enable "cyclic reference" for linker