[Buildroot] [RFC PATCH] package/clang: force release CFLAGS/CXX_FLAGS

Alex Bennée <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
The default toolchain.mk sets:

 set(CMAKE_C_FLAGS "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
    -D_FILE_OFFSET_BITS=64 -Og -g2 -D_FORTIFY_SOURCE=1" CACHE STRING
    "Buildroot CFLAGS")

despite what ever setting BR2_DEBUG may have. However when building
libclang this is fairly pathological for the build time as witnessed
by hangs while building. To avoid this explicitly set
CMAKE_[C|CXX]_FLAGS so we don't take the default.

Signed-off-by: Alex Bennée <[email protected]>
---
 package/llvm-project/clang/clang.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/llvm-project/clang/clang.mk b/package/llvm-project/clang/clang.mk
index b650b8afd5..29a710c737 100644
--- a/package/llvm-project/clang/clang.mk
+++ b/package/llvm-project/clang/clang.mk
@@ -41,6 +41,9 @@ CLANG_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF
 HOST_CLANG_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release
 CLANG_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release
 
+HOST_CLANG_CONF_OPTS += -DCMAKE_C_FLAGS="-O2 -g0" -DCMAKE_CXX_FLAGS="-O2 -g0"
+CLANG_CONF_OPTS += -DCMAKE_C_FLAGS="-O2 -g0" -DCMAKE_CXX_FLAGS="-O2 -g0"
+
 CLANG_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1
 
 # We need to build tools because libclang is a tool
-- 
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.