[apparmor] [patch] parser: fix partial compilation of C++ files

Steve Beattie steve at nxnw.org
Mon Sep 22 22:44:04 UTC 2014


With the move to C++-ification of the parser, the parser's makefile was
not updated to take into account .cc files when deriving object files.
This would result in the final linking compilation of the parser binary
including all of the .cc files in its command line, rather than the ,o
files. This patch fixes the issue as well as an additional typo in the
dependency list for af_unix.o that was not triggered because af_unix.o
was not being built independently.

Signed-off-by: Steve Beattie <steve at nxnw.org>
---
 parser/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: b/parser/Makefile
===================================================================
--- a/parser/Makefile
+++ b/parser/Makefile
@@ -86,7 +86,7 @@ HDRS = parser.h parser_include.h immunix
        rule.h common_optarg.h signal.h ptrace.h network.h af_rule.h af_unix.h
 TOOLS = apparmor_parser
 
-OBJECTS = $(SRCS:.c=.o)
+OBJECTS = $(patsubst %.cc, %.o, $(SRCS:.c=.o))
 
 AAREDIR= libapparmor_re
 AAREOBJECT = ${AAREDIR}/libapparmor_re.a
@@ -258,7 +258,7 @@ network.o: network.c network.h parser.h
 af_rule.o: af_rule.cc af_rule.h network.h parser.h profile.h immunix.h parser_yacc.h rule.h $(APPARMOR_H)
 	$(CXX) $(EXTRA_CFLAGS) -c -o $@ $<
 
-af_unix.o: af_unix.cc af_unix.h network.h af_rule.h parser.h profile.h immunix.h parser_y $(APPARMOR_H)
+af_unix.o: af_unix.cc af_unix.h network.h af_rule.h parser.h profile.h immunix.h parser_yacc.h $(APPARMOR_H)
 	$(CXX) $(EXTRA_CFLAGS) -c -o $@ $<
 
 profile.o: profile.cc profile.h parser.h network.h

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140922/025a8f4c/attachment-0001.pgp>


More information about the AppArmor mailing list