]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: fix PIE build flags
authorMathias Krause <Mathias.Krause@secunet.com>
Wed, 20 Jan 2010 14:39:13 +0000 (17:39 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 20 Jan 2010 14:39:13 +0000 (17:39 +0300)
Because the final executables are built as position independent
executables (PIE) -- when configure has detected compiler supported for
PIE -- the objects in the library archive must be built in that way,
too. Otherwise the runtime linker has to do unneccesary relocation for
each start of the program. Even worse, the programs won't even be able
to start on a (hardened) kernel that doesn't allow those relocations to
happen by preventing making the .text segment writable (PaX's MPROTECT
feature comes to mind). The attached patch fixes this issue by adding
the appropriate flags to the Makefile.am.

lib/Makefile.am

index 315e919beec226763fdf550ec867123cab60e607..6264878e2c3036c71afea2caa5566ee303f89b3f 100644 (file)
@@ -14,6 +14,9 @@ libzebra_la_SOURCES = \
        zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c privs.c \
        sigevent.c pqueue.c jhash.c memtypes.c workqueue.c
 
+AM_CFLAGS = $(PICFLAGS)
+AM_LDFLAGS = $(PILDFLAGS)
+
 BUILT_SOURCES = memtypes.h route_types.h
 
 libzebra_la_DEPENDENCIES = @LIB_REGEX@