Allow to specify own path to the linker script (ld) using build_flags option // Resolve #233

This commit is contained in:
Ivan Kravets
2015-06-19 13:43:30 +03:00
parent 91563b01d2
commit 8e95bfb464
4 changed files with 25 additions and 14 deletions

View File

@ -4,8 +4,11 @@ Release History
2.2.0 (2015-??-??) 2.2.0 (2015-??-??)
------------------ ------------------
* Allow to specify library compatibility with the all platforms/frameworks using * Allowed to specify own path to the linker script (ld) using
``*`` symbol in `build_flags <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`__ option
(`issue #233 <https://github.com/platformio/platformio/issues/233>`_)
* Allowed to specify library compatibility with the all platforms/frameworks
using ``*`` symbol in
`library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__ `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
* Fixed ``stk500v2_command(): command failed`` * Fixed ``stk500v2_command(): command failed``
(`issue #238 <https://github.com/platformio/platformio/issues/238>`_) (`issue #238 <https://github.com/platformio/platformio/issues/238>`_)

View File

@ -226,10 +226,6 @@ processes:
* - Format * - Format
- Scope - Scope
- Description - Description
* - ``-Wp,option``
- CPPFLAGS
- Bypass the compiler driver and pass *option* directly through to the
preprocessor
* - ``-D name`` * - ``-D name``
- CPPDEFINES - CPPDEFINES
- Predefine *name* as a macro, with definition 1. - Predefine *name* as a macro, with definition 1.
@ -241,6 +237,10 @@ processes:
- CPPDEFINES - CPPDEFINES
- Cancel any previous definition of *name*, either built in or provided - Cancel any previous definition of *name*, either built in or provided
with a ``-D`` option. with a ``-D`` option.
* - ``-Wp,option``
- CPPFLAGS
- Bypass the compiler driver and pass *option* directly through to the
preprocessor
* - ``-Wall`` * - ``-Wall``
- CCFLAGS - CCFLAGS
- Turns on all optional warnings which are desirable for normal code. - Turns on all optional warnings which are desirable for normal code.
@ -254,10 +254,18 @@ processes:
- CCFLAGS - CCFLAGS
- Process *file* as if ``#include "file"`` appeared as the first line of - Process *file* as if ``#include "file"`` appeared as the first line of
the primary source file. the primary source file.
* - ``-Idir``
- CPPPATH
- Add the directory *dir* to the list of directories to be searched
for header files.
* - ``-Wa,option`` * - ``-Wa,option``
- ASFLAGS, CCFLAGS - ASFLAGS, CCFLAGS
- Pass *option* as an option to the assembler. If *option* contains - Pass *option* as an option to the assembler. If *option* contains
commas, it is split into multiple options at the commas. 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`` * - ``-llibrary``
- LIBS - LIBS
- Search the *library* named library when linking - Search the *library* named library when linking
@ -265,10 +273,6 @@ processes:
- LIBPATH - LIBPATH
- Add directory *dir* to the list of directories to be searched for - Add directory *dir* to the list of directories to be searched for
``-l``. ``-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 This option can be set by global environment variable
:ref:`envvar_PLATFORMIO_BUILD_FLAGS`. :ref:`envvar_PLATFORMIO_BUILD_FLAGS`.
@ -278,11 +282,14 @@ Example:
.. code-block:: ini .. code-block:: ini
[env:specific_defines] [env:specific_defines]
build_flags = -O2 -Dfoo -Dbar=1 build_flags = -Dfoo -Dbar=1
[env:specific_inclibs] [env:specific_inclibs]
build_flags = -I/opt/include -L/opt/lib -lfoo 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: For more detailed information about available flags/options go to:

View File

@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com> # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details. # See LICENSE for details.
VERSION = (2, 2, "0.dev0") VERSION = (2, 2, "0.dev1")
__version__ = ".".join([str(s) for s in VERSION]) __version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio" __title__ = "platformio"

View File

@ -35,9 +35,10 @@ def BuildFirmware(env):
deplibs = firmenv.BuildDependentLibraries("$PROJECTSRC_DIR") deplibs = firmenv.BuildDependentLibraries("$PROJECTSRC_DIR")
# append specified LD_SCRIPT # 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( firmenv.Append(
LINKFLAGS=["-T", "$LDSCRIPT_PATH"] LINKFLAGS=["-Wl,-T", "$LDSCRIPT_PATH"]
) )
# enable "cyclic reference" for linker # enable "cyclic reference" for linker