From fb362d85819bb0f2be6fa5eea7594270c4ced483 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 20 Jan 2019 23:37:42 -0800 Subject: libcxx,compiler-rt: Append to CXX along with TARGET_CXXFLAGS to carry -stdlib flag Since TARGET_CXXFLAGS does not get passed into all packages Signed-off-by: Khem Raj --- README.md | 8 +++++--- recipes-devtools/clang/compiler-rt_git.bb | 6 +++--- recipes-devtools/clang/libcxx_git.bb | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 924f95f..2d7dc1a 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,16 @@ Note that by default libstdc++ will remain the default C++ standard library, how libc++ to be the default one then set ```python -TARGET_CXXFLAGS_append_toolchain-clang ?= " -stdlib=libc++ " +CXX_append_toolchain-clang = " -stdlib=libc++ " +TARGET_CXXFLAGS_append_toolchain-clang = " -stdlib=libc++ " ``` in local.conf. You can select libc++ per package too by writing bbappends for them containing ```python -TARGET_CXXFLAGS_append_toolchain-clang = " -stdlib=libc++ " +CXX_append_toolchain-clang_pn- = " -stdlib=libc++ " +TARGET_CXXFLAGS_append_toolchain-clang_pn- = " -stdlib=libc++ " ``` # Building @@ -82,7 +84,7 @@ and OE will start using gcc to cross compile that recipe. And if a component does not build with libc++, you can add it to conf/nonclangable.inc e.g. ```shell -TARGET_CXXFLAGS_remove_pn-_toolchain-clang = " -stdlib=libc++ " +CXX_remove_pn-_toolchain-clang = " -stdlib=libc++ " ``` # Dependencies diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index 68655e3..2cfbf71 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb @@ -15,9 +15,9 @@ inherit cmake pkgconfig pythonnative LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=f981c4637a4cd67915ac527b3ead3a59; \ " -BASEDEPENDS_remove_toolchain-clang_class-target = "compiler-rt" -BASEDEPENDS_remove_toolchain-clang_class-target = "libcxx" -TARGET_CXXFLAGS_remove_toolchain-clang = " -stdlib=libc++ " +BASEDEPENDS_remove_toolchain-clang_class-target = "compiler-rt libcxx" +CXX_remove_toolchain-clang = "-stdlib=libc++" +TARGET_CXXFLAGS_remove_toolchain-clang = "-stdlib=libc++" TUNE_CCARGS_remove = "-no-integrated-as" DEPENDS += "ninja-native" DEPENDS_append_class-nativesdk = " clang-native" diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index a90cd2f..28ea5eb 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -13,7 +13,8 @@ inherit cmake pythonnative DEPENDS += "ninja-native" BASEDEPENDS_remove_toolchain-clang = "libcxx" -TARGET_CXXFLAGS_remove_toolchain-clang = " -stdlib=libc++ " +CXX_remove_toolchain-clang = "-stdlib=libc++" +TARGET_CXXFLAGS_remove_toolchain-clang = "-stdlib=libc++" PACKAGECONFIG ??= "unwind" PACKAGECONFIG_powerpc = "" -- cgit v1.2.3-54-g00ecf