Skip to content

llvm: include path fixes#6606

Merged
miri64 merged 2 commits intoRIOT-OS:masterfrom
jnohlgard:pr/llvm-include-fixes
Feb 16, 2017
Merged

llvm: include path fixes#6606
miri64 merged 2 commits intoRIOT-OS:masterfrom
jnohlgard:pr/llvm-include-fixes

Conversation

@jnohlgard
Copy link
Copy Markdown
Member

This PR contains two changes to the include path handling when building with LLVM/Clang:

  • Only use GCC include paths if cross compiling
  • Place newlib includes before other system includes

The first part makes native use the system default headers instead of trying to use GCC headers for the host system when GCC is installed alongside Clang.
The second part ensures that Newlib headers can override the GCC headers when building with Clang. In particular, Clang-3.9.1 seems to choke when building the unit tests for atomic when using the stdatomic.h from GCC-6.3.0. Newlib contains another version of stdatomic.h (which in turn seems to stem from FreeBSD) which works with both GCC and Clang, and even the old GCC-4.6 (msp430).

@jnohlgard jnohlgard added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: build system Area: Build system labels Feb 14, 2017
@jnohlgard jnohlgard added this to the Release 2017.04 milestone Feb 14, 2017

# Newlib includes should go after GCC includes.
export INCLUDES += $(NEWLIB_INCLUDES)
export INCLUDES := $(NEWLIB_INCLUDES) $(INCLUDES)
Copy link
Copy Markdown
Member

@smlng smlng Feb 15, 2017

Choose a reason for hiding this comment

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

the comment above says, that order should be reversed? So either correct here or the comment, and explain w reasoning for certain order.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just (re)read your description and you want to have newlib before other includes, hence please adapt comment

Copy link
Copy Markdown
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

Please fix comment as suggested, otherwise ACK. Is needed to get LLVM toolchain support, see #6600

@jnohlgard
Copy link
Copy Markdown
Member Author

jnohlgard commented Feb 16, 2017 via email

Joakim Nohlgård added 2 commits February 16, 2017 16:28
@jnohlgard jnohlgard force-pushed the pr/llvm-include-fixes branch from 320ed96 to 9830912 Compare February 16, 2017 15:28
@jnohlgard
Copy link
Copy Markdown
Member Author

Updated comment to explain why Newlib headers should go first (amended edit)

@smlng smlng added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 16, 2017
@smlng
Copy link
Copy Markdown
Member

smlng commented Feb 16, 2017

lets wait for a final check by Murdock, afterwards ACK and GO!

@miri64 miri64 merged commit 8c34c6b into RIOT-OS:master Feb 16, 2017
@jnohlgard jnohlgard deleted the pr/llvm-include-fixes branch February 20, 2017 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants