Skip to content

Commit

Permalink
Fix invalid detecting of compiler type // Resolve #550
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Mar 1, 2016
1 parent c9505b3 commit 8388359
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ PlatformIO 2.0
* Fixed issue with Project Generator when optional build flags were passed using
system environment variables: `PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`__
or `PLATFORMIO_BUILD_SRC_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-src-flags>`__
* Fixed invalid detecting of compiler type
(`issue #550 <https://github.com/platformio/platformio/issues/550>`_)


2.8.4 (2016-02-17)
Expand Down
7 changes: 4 additions & 3 deletions platformio/builder/tools/piomisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ def GetCompilerType(env):
if result['returncode'] != 0:
return None
output = "".join([result['out'], result['err']]).lower()
for type_ in ("clang", "gcc"):
if type_ in output:
return type_
if "clang" in output and "LLVM" in output:
return "clang"
elif "gcc" in output:
return "gcc"
return None


Expand Down

2 comments on commit 8388359

@aykevl
Copy link

@aykevl aykevl commented on 8388359 Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hitting a problem with this commit right now: the 'clang' check never succeeds. This is because output is cast to lowercase and there is a check for the string "LLVM" (which is in uppercase).

I'm working on a Clang-based platform that doesn't support --start-group and --end-group, but the compiler is always recognized as GCC (not Clang) so -Wl,--start-group and -Wl,--end-group is inserted.

@aykevl
Copy link

@aykevl aykevl commented on 8388359 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a fix: #4897

Please sign in to comment.