From a04947fc7d7a0b3765e859e769e4acb9a0120db6 Mon Sep 17 00:00:00 2001 From: Mike Winstead Date: Wed, 17 May 2017 18:10:43 -0500 Subject: [PATCH 1/2] Added readme section regarding minimizing output file sizes --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 78397b0..8bab232 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,14 @@ option when embedding into a library project is `ZF_LOG_LIBRARY_PREFIX`. It could be used to decorate zf_log exported symbols to avoid linker conflicts (when that library project is used in other project that is also uses zf_log). +#### Minimizing Output File Size + +As part of zf_log's main to be small, log strings below the current log level +can be compiled out using optimization features in modern compilers. Not all +compilers will be capable of this, but gcc provides this functionality using +the ```-fdata-sections``` and ```-ffunction-sections``` compile flags, the +link flag ```-Wl,--gc-sections```, and size optomization flag ```-Os```. + ### Embedding with CMake Another options is avaibale for projects that are using CMake. Copy From acc37108601778d42378aaa778e42feebf70a0d2 Mon Sep 17 00:00:00 2001 From: Mike Winstead Date: Wed, 17 May 2017 18:14:14 -0500 Subject: [PATCH 2/2] Added remard about doing debug vs release builds for acceptance --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8bab232..bca4f62 100644 --- a/README.md +++ b/README.md @@ -148,10 +148,12 @@ could be used to decorate zf_log exported symbols to avoid linker conflicts #### Minimizing Output File Size As part of zf_log's main to be small, log strings below the current log level -can be compiled out using optimization features in modern compilers. Not all -compilers will be capable of this, but gcc provides this functionality using -the ```-fdata-sections``` and ```-ffunction-sections``` compile flags, the -link flag ```-Wl,--gc-sections```, and size optomization flag ```-Os```. +can be compiled out using optimization features in modern compilers. In +```Debug``` builds, unused strings may not be compiled out and a ```Release``` +build may be necessary. Not all compilers will be capable of optimizing out +unused parts of a program, but gcc provides this functionality using the +```-fdata-sections``` and ```-ffunction-sections``` compile flags, the link flag +```-Wl,--gc-sections```, and size optimization flag ```-Os```. ### Embedding with CMake