Skip to content

Build errors xtensa-lx106-elf-gcc: error: unrecognized command line option '-std=c17' #7481

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

Closed
6 tasks done
TD-er opened this issue Jul 23, 2020 · 13 comments
Closed
6 tasks done

Comments

@TD-er
Copy link
Contributor

TD-er commented Jul 23, 2020

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [latest git hash or date]
  • Development Env: [Platformio]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Generic ESP8266 Module]
  • Flash Mode: [dio]
  • Flash Size: [4MB]
  • lwip Variant: [v2 Lower Memory|Higher Bandwidth]
  • Reset Method: [nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [OTA|SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

Trying to build the 'staging' version of the esp8266/Arduino code and my compiler keeps complaining about not recognizing the -std=c17 flag.

xtensa-lx106-elf-gcc: error: unrecognized command line option '-std=c17'

Tried in PlatformIO several things, like changing the platform version.

The current version I'm having (which is not working):

platform                  = [email protected]
platform_packages         =
	framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
build_flags               = ${esp82xx_2_6_x.build_flags}
                            -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191122
                            -Wno-deprecated-declarations
                            -std=gnu99	
                            -std=c++11
build_unflags             = -std=c17	
                            -std=gnu++17

So my question is, what should be done to make it compile in Windows?
By the way, tried it in Linux and without any extras installed (not tested any) it will also not compile there.

@MarkusAD
Copy link

That would mean its using the wrong compiler. You probably have other releases installed and its finding that compiler first.

@TD-er
Copy link
Contributor Author

TD-er commented Jul 23, 2020

Any idea how to fix that?
My assumption is that it would be included in the toolset that is installed by PlatformIO, as I never installed a compiler specifically.
Also it should be possible to run several compiler versions on the same build machine as I don't want to break anything using the older core lib versions.

@MarkusAD
Copy link

On linux I had remnants of an old arduino-ide install left over in ~/.arduino15 and ~/.arduino15/packages. rm'ing them solved it.

@TD-er
Copy link
Contributor Author

TD-er commented Jul 23, 2020

Well I'm not using Arduino IDE, but PlatformIO, which usually does a good job in separating things per build env declared in the platformio.ini file.

@MarkusAD
Copy link

And Makefiles do that even better for me, Find your conflicting compiler and youll solve your problem

@TD-er
Copy link
Contributor Author

TD-er commented Jul 23, 2020

Strictly speaking, you may be right, but the problem is that it is all installed "automagically" by PlatformIO and even though I may be able to fix it for my specific build environment.
But that's going to cause dozens of reported issues of users of my project that are unable to compile it out of the box.
So I want it to be fixed in the toolchain, hence this issue.

@MarkusAD
Copy link

That would indicate a platformIO issue then. Maybe ask there since the latest git master and releases here are working fine and have nothing to do with any "staging" releases.

@TD-er
Copy link
Contributor Author

TD-er commented Jul 23, 2020

Well something has changed here, as it was working well and some merge to the "master" branch included some build flags what made it cause to no longer build.

It could very well be PlatformIO related, but I am simply not sure.
So as it got "broken" by some changes here, that's where I first start.

@MarkusAD
Copy link

The merge was switching to gcc-10 here, which works fine if you use the correct compiler.

@TD-er TD-er closed this as completed Jul 23, 2020
@MarkusAD
Copy link

Guess you got pointed in the right direction eh?

@TD-er
Copy link
Contributor Author

TD-er commented Jul 23, 2020

Not sure, I opened an issue at the PlatformIO repo: platformio/platform-espressif8266#224

So we'll see if I got redirected again to the right repo as that happens quite often with these kind of issues. :(

@MarkusAD
Copy link

Sounds to me like platformIO just needs gcc-10 installed. Hope it works out.

@mathertel
Copy link
Contributor

After deleting the esp8266 board package using the Board manager there were still files in my folder
C:\Users<me>\AppData\Local\Arduino15\packages.
After deleting these files the compiler warning disappeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants