diff --git a/HISTORY.rst b/HISTORY.rst index 866b07c0..e89158bf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -48,6 +48,7 @@ PlatformIO Core 5 - Show project dependency licenses when building in the verbose mode - Fixed an issue when `LDF `__ ignores the project `lib_deps `__ while resolving library dependencies (`issue #3598 `_) - Fixed an issue with calling an extra script located outside a project (`issue #4220 `_) + - Fixed an issue when GCC preprocessor was applied to the ".s" assembly files on case-sensitive OS such as Window OS (`issue #3917 `_) * **Integration** diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 49fb0612..439f84a6 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -49,10 +49,10 @@ clivars.AddVariables( DEFAULT_ENV_OPTIONS = dict( tools=[ "ar", - "as", "cc", "c++", "link", + "pioasm", "platformio", "piotarget", "pioplatform", diff --git a/platformio/builder/tools/pioasm.py b/platformio/builder/tools/pioasm.py new file mode 100644 index 00000000..6af96bcd --- /dev/null +++ b/platformio/builder/tools/pioasm.py @@ -0,0 +1,31 @@ +# Copyright (c) 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import absolute_import + +import SCons.Tool.asm # pylint: disable=import-error + +# +# Resolve https://github.com/platformio/platformio-core/issues/3917 +# Avoid forcing .S to bare assembly on Windows OS +# + +if ".S" in SCons.Tool.asm.ASSuffixes: + SCons.Tool.asm.ASSuffixes.remove(".S") +if ".S" not in SCons.Tool.asm.ASPPSuffixes: + SCons.Tool.asm.ASPPSuffixes.append(".S") + + +generate = SCons.Tool.asm.generate +exists = SCons.Tool.asm.exists diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 6f9f4729..a8763567 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -113,10 +113,6 @@ def ProcessProgramDeps(env): env.PrintConfiguration() - # fix ASM handling under non case-sensitive OS - if not Util.case_sensitive_suffixes(".s", ".S"): - env.Replace(AS="$CC", ASCOM="$ASPPCOM") - # process extra flags from board if "BOARD" in env and "build.extra_flags" in env.BoardConfig(): env.ProcessFlags(env.BoardConfig().get("build.extra_flags"))