From a5d38f0b14f9f9d7cd13f8a0df5bbef9a5802a02 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 16 Jul 2021 10:32:33 +0800 Subject: [PATCH] README.md: recommend -Og instead of -O0 per https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html > -Og > Optimize debugging experience. -Og should be the optimization level of > choice for the standard edit-compile-debug cycle, offering a reasonable > level of optimization while maintaining fast compilation and a good > debugging experience. It is a better choice than -O0 for producing > debuggable code because some compiler passes that collect debug > information are disabled at -O0. so instead of using -O0, for better developer experience, -Og is recommended. Signed-off-by: Kefu Chai --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e996e1935000b..a9fe954636294 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Another example below is building with debugging and alternate locations for a couple of external dependencies: cmake -DLEVELDB_PREFIX="/opt/hyperleveldb" \ - -DCMAKE_INSTALL_PREFIX=/opt/ceph -DCMAKE_C_FLAGS="-O0 -g3 -gdwarf-4" \ + -DCMAKE_INSTALL_PREFIX=/opt/ceph -DCMAKE_C_FLAGS="-Og -g3 -gdwarf-4" \ .. To view an exhaustive list of -D options, you can invoke `cmake` with: -- 2.39.5