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

Seth Arnold seth.arnold at canonical.com
Mon Sep 22 23:44:21 UTC 2014


On Mon, Sep 22, 2014 at 03:44:04PM -0700, Steve Beattie wrote:
> 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>

Oof. Nice catch.

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> ---
>  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/



> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140922/a087015d/attachment.pgp>


More information about the AppArmor mailing list