Skip to contentSkip to conversation

Makefile.inc: Remove -fexceptions from CFLAGS

PATCH In review Bart Van Assche 2 participants 2 messages Aug 16, 2016 – Aug 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile.inc: Remove -fexceptions from CFLAGS

No code in the multipath-tools project calls a C++ function that generates an exception. Hence remove -fexceptions. From the gcc manual:

-fexceptions

Enable exception handling. Generates extra code needed to propagate exceptions. For some targets, this implies GCC generates frame unwind information for all functions, which can produce significant data size overhead, although it does not affect execution. If you do not specify this option, GCC enables it by default for languages like C++ that normally require exception handling, and disables it for languages like C that do not normally require it. However, you may need to enable this option when compiling C code that needs to interoperate properly with exception handlers written in C++. You may also wish to disable this option if you are compiling older C++ programs that don't use exception handling.

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.inc +1 -1
index 0808e64..0631ca2 100644
@@ -61,7 +61,7 @@ LN		= ln -sf
 INSTALL_PROGRAM	= install
 
 OPTFLAGS	= -Wunused -Wstrict-prototypes -O2 -g -pipe -Wformat-security -Wall \
-		  -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
+		  -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4
 
 CFLAGS		= $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
 SHARED_FLAGS	= -shared
Signature · 1 line
2.9.2
#1 lore raw

Merged.
Thanks.

On Tue, Aug 16, 2016 at 9:56 PM, Bart Van Assche <[email protected]

Quoted 47 lines

wrote:

No code in the multipath-tools project calls a C++ function that generates an exception. Hence remove -fexceptions. From the gcc manual:

-fexceptions

Enable exception handling. Generates extra code needed to propagate exceptions. For some targets, this implies GCC generates frame unwind information for all functions, which can produce significant data size overhead, although it does not affect execution. If you do not specify this option, GCC enables it by default for languages like C++ that normally require exception handling, and disables it for languages like C that do not normally require it. However, you may need to enable this option when compiling C code that needs to interoperate properly with exception handlers written in C++. You may also wish to disable this option if you are compiling older C++ programs that don't use exception handling.

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.inc +1 -6
index 0808e64..0631ca2 100644
@@ -61,7 +61,7 @@ LN            = ln -sf
 INSTALL_PROGRAM        = install
 
 OPTFLAGS       = -Wunused -Wstrict-prototypes -O2 -g -pipe
-Wformat-security -Wall \
-                 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4
+                 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4
 
 CFLAGS         = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
-DRUN_DIR=\"${RUN}\"
 SHARED_FLAGS   = -shared
--

2.9.2