Skip to content

Conversation

@stephanosio
Copy link
Member

This commit adds a new C++ compiler property `nostdincxx` which
specifies the C++ compiler flag for excluding the C++ standard library
include directory from the include paths.

Signed-off-by: Stephanos Ioannidis <[email protected]>

Fixes #36644.

@stephanosio
Copy link
Member Author

stephanosio commented Sep 11, 2021

@evgeniy-paltsev @abrodkin Does ARC MWDT have something like -nostdinc++ from GCC? If so, we should specify the nostdincxx property for the MWDT as well.

@stephanosio stephanosio added area: C++ bug The issue is a bug, or the PR is fixing a bug labels Sep 11, 2021
@github-actions github-actions bot added the area: Samples Samples label Sep 11, 2021
Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

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

LGTM

@cfriedt
Copy link
Member

cfriedt commented Sep 12, 2021

@tejlmand - can you take a look?

@cfriedt
Copy link
Member

cfriedt commented Sep 18, 2021

@nashif - this is a fairly straight-forward PR that mainly touches the build system. Are you able to ack?

@evgeniy-paltsev
Copy link
Contributor

Does ARC MWDT have something like -nostdinc++ from GCC? If so, we should specify the nostdincxx property for the MWDT as well.

@stephanosio I guess we do similar thing for MWDT but in a slightly different way:
cmake/compiler/arcmwdt/target.cmake

if(CONFIG_ARCMWDT_LIBC AND CONFIG_LIB_CPLUSPLUS)
  list(APPEND NOSTDINC ${TOOLCHAIN_HOME}/arc/lib/src/c++/inc)
endif()

foreach(isystem_include_dir ${NOSTDINC})
  list(APPEND isystem_include_flags -isystem "\"${isystem_include_dir}\"")
endforeac

Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

The compiler flags should simply specify flags, not decide whether they should be used or not.

This commit adds a new C++ compiler property `nostdincxx` which
specifies the C++ compiler flag for excluding the C++ standard library
include directory from the include paths.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit adds the `nostdincxx` C++ compiler property for GCC, which
is specified when the C++ standard library (`CONFIG_LIB_CPLUSPLUS`) is
disabled.

Signed-off-by: Stephanos Ioannidis <[email protected]>
The TensorFlow Lite module makes use of the features provided by the
standard C++ library (e.g. `#include <functional>`), so the standard
C++ library config must be enabled for it.

This used to work without `CONFIG_LIB_CPLUSPLUS=y` due to the bug
described in the issue zephyrproject-rtos#36644.

Signed-off-by: Stephanos Ioannidis <[email protected]>
Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

thanks. good to get things like this cleaned up.

@nashif nashif merged commit 9d7c9ff into zephyrproject-rtos:main Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Build System area: C++ area: Samples Samples bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toolchain C++ headers can be included when libstdc++ is not selected

5 participants