Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_unflags does not apply to linker commands #698

Closed
1 task
lerneaenhydra opened this issue Jun 16, 2016 · 2 comments
Closed
1 task

build_unflags does not apply to linker commands #698

lerneaenhydra opened this issue Jun 16, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@lerneaenhydra
Copy link

lerneaenhydra commented Jun 16, 2016

What kind of issue is this?

  • Bug report. If you’ve found a bug, please provide information below.

Configuration

Operating system: Linux stm32dev-VirtualBox 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:25:16 UTC 2016 i686 athlon i686 GNU/Linux

PlatformIO Version (platformio --version): PlatformIO, version 2.10.1

Description of problem

The build_unflags directive does not apply to the generated linker command. For example, when using the ststm32 platform the default flags '-nostartfiles' and '-nostdlib' are not removed when the configuration file contains 'build_unflags= -nostdlib -nostartfiles'

Steps to Reproduce

Compile any project using a platformio.ini file containing;
[env:disco_f407vg]
platform = ststm32
framework = spl
board = disco_f407vg
build_unflags = -nostdlib -nostartfiles

Actual Results

the following linker command is generated
arm-none-eabi-gcc -o .pioenvs/disco_f407vg/firmware.elf -Os -Wl,--gc-sections,--relax -mthumb -mcpu=cortex-m4 **-nostartfiles -nostdlib** -Wl,-T"stm32f405x6.ld" .pioenvs/disco_f407vg/src/backend/cbuf.o .pioenvs/disco_f407vg/src/backend/dsp_wrapper.o .pioenvs/disco_f407vg/src/backend/hw/board.o .pioenvs/disco_f407vg/src/backend/hw/headphone.o .pioenvs/disco_f407vg/src/backend/hw/microphone.o .pioenvs/disco_f407vg/src/backend/hw/stm32f4_discovery.o .pioenvs/disco_f407vg/src/backend/hw/stm32f4_discovery_audio_codec.o .pioenvs/disco_f407vg/src/backend/hw/stm32f4xx_it.o .pioenvs/disco_f407vg/src/backend/hw/system_stm32f4xx.o .pioenvs/disco_f407vg/src/backend/printf.o .pioenvs/disco_f407vg/src/backend/systime/systime.o .pioenvs/disco_f407vg/src/main.o -L/home/stm32dev/.platformio/packages/ldscripts -Llib_ext -L.pioenvs/disco_f407vg -Wl,--start-group -lc -lgcc -lm -lstdc++ -lnosys -lPDMFilter_GCC -larm_cortexM4l_math .pioenvs/disco_f407vg/libFrameworkCMSISVariant.a .pioenvs/disco_f407vg/libFrameworkSPL.a -Wl,--end-group

Expected Results

The above linker command without the -nostartfiles -nostdlib flags.

@ivankravets ivankravets self-assigned this Jun 16, 2016
@ivankravets ivankravets added this to the 2.10.4 milestone Jun 16, 2016
@ivankravets
Copy link
Member

ivankravets commented Jun 16, 2016

https://community.platformio.org/t/build-unflags-broken/392/13

[env:frdm_k64f]
platform = freescalekinetis
framework = mbed
board = frdm_k64f
build_unflags = -fno-rtti

I already put the env.ProcessUnFlags(env.get("BUILD_UNFLAGS")) after the framework script in platformio.py, but it´s still broken.

@ivankravets
Copy link
Member

ivankravets added a commit that referenced this issue Jun 19, 2016
* develop:
  Use env.Flatten to manipulate with CPPDEFINES
  Update name of the OpenEnergyMonitor board // Resolve #699
  Fix PyLint warning
  Remove duplicated flags // Issue #698
  Disable dependancy info
  Revert back previous LINKFLAGS
  Better removing unnecessary flags using ``build_unflags`` option // Resolve #698
  Fix unnecessary uppercase for target includes
ivankravets added a commit that referenced this issue Jul 6, 2016
* develop: (27 commits)
  Update boards list
  Add Arduino M0 as a separate board
  Update history
  Update microchippic32 platform and boards
  Fix PyLint warning
  Keep user changes for ".gitignore" file when re-generate/update project data
  Documented uploading of EEPROM data
  Push 2.11.1.dev1
  Automatically install dependent upload tools // Issue #472
  Split source files to HEADERS and SOURCES when generate project for Qt Creator IDE // Resolve #713
  Improve project generator for CLion IDE
  Fix missing trailing ``\`` for the source files list when generate project for Qt Creator IDE // Resolve #711
  * Fix missed ``--boot`` flag for the firmware uploader for ATSAM3X8E Cortex-M3 MCU based boards (Arduino Due, etc) // Resolve #710
  Initial support for Arduino M0/Tian boards // Issue #472
  Update project template for Qt Creator // Issue #711
  Fix missed --boot flag for sam3x uploader // Issue # 710
  Auto-remove project cache when PlatformIO is upgraded
  Version bump to 2.11.0 (issues #472, #520, #614, #620, #685, #698, #699)
  Update history
  Update espressif platform according to the new framework version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants