boylesg:
In fact if some one can supply me with some explanations for
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
This allows you to add extra flags to the compiler calls. Let's take compiler.cpp.extra_flags as an example. If you do a search of platform.txt for compiler.cpp.extra_flags you will find the definition above and also in recipe.cpp.o.pattern. So what happens is that {compiler.cpp.extra_flags} in the recipe is replaced by whatever you put after the equals sign in the definition at line 57. Super simple right? OK, now it gets a little more complicated. If you read the comment:
These can be overridden in platform.local.txt
so actually the intended usage for those properties is to allow someone like you to add extra flags without needing to modify platform.txt. So if you create a file named platform.local.txt in the same folder as platform.txt and add the line:
compiler.cpp.extra_flags="-Lfoo/bar"
then {compiler.cpp.extra_flags} in recipe.cpp.o.pattern will be replaced with "-Lfoo/bar". The purpose of the empty definitions in platform.txt is actually just to ensure that those properties are always defined. Those definitions in platform.txt are not really intended to be modified but of course you can do so if you like, it just means that every time you update to a new version of the ESP32 core you will need to remember what modifications you made to platform.txt and port those over to the new platform.txt. It's much more simple to just copy your platform.local.txt over and never touch platform.txt so you don't risk accidentally messing it up. There is also the possibility of overriding some of these properties from boards.txt so that you can have flags specific to a certain board selection or custom Tools menu selections.
boylesg:
What do these mean?
Exactly what they say. They are properties that allow you to add extra flags to the recipes.
boylesg:
Do I put my -L flag on "compiler.c.extra_flags"?
On compiler.c.elf.extra_flags?
On compiler.cpp.extra_flags?
It all depends on which recipe you want the flags added to. This would all be completely obvious if you just took a few seconds to to a search through platform.txt for the property names. If you add it to the compiler.c.extra_flags then it will be used in recipe.c.o.pattern and recipe.S.o.pattern (however the latter is due to a typo and I have submitted a PR to fix this. If you add it to compiler.c.elf.extra_flags then it will be used in recipe.c.combine.pattern.
boylesg:
On all of them?
That's generally the purpose of build.extra_flags but of course you can do a search of the file to see which recipes that property is used in.
boylesg:
What is .S?
assembly language
boylesg:
What is .ar?
archive
boylesg:
What is the difference between "elf.extra_flags" and "extra_flags"?
Do a search of platform.txt for any property name and it will be clear.
boylesg:
What is the correct syntax?
-L "......"?
-L"......."?
-L{.......}?
L "......"?
L"....."?
"-L.....". The quotes are only necessary for paths that have a space in them but it's a good habit to get into regardless.
boylesg:
None of this file looks like standard looking unix gcc command line stuff - it all looks rather Arduino IDE specific to me.
An example
-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
Other than {compiler.warning_flags}, those are just the standard, well documented flags. {compiler.warning_flags} is a little bit tricky because this property can be configured via File > Preferences > Compiler warnings. The options are defined starting at line 16:
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall -Werror=all
compiler.warning_flags.all=-Wall -Werror=all -Wextra
So if you set File > Preferences > Compiler warnings to None then {compiler.warning_flags} is replaced by -w. if you set File > Preferences > Compiler warnings to All then {compiler.warning_flags} is replaced by -Wall -Werror=all -Wextra.
boylesg:
And "compiler.c.extra_flags" does not even appear in Arduino-IDE-1.5-3rd-party-Hardware-specification
Yes, as I already mentioned, that stuff needs to be documented. Unfortunately the author of the code didn't take the time to do so and it's much more difficult for anyone else to do so via deciphering the source code or trial and error reverse engineering how it works.