From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gvvrm-0000kr-2k for ptxdist@pengutronix.de; Tue, 19 Feb 2019 04:14:42 +0100 Received: by mail-ot1-x335.google.com with SMTP id b3so31879903otp.4 for ; Mon, 18 Feb 2019 19:14:40 -0800 (PST) MIME-Version: 1.0 References: <201902181056.56824.jbe@pengutronix.de> <201902181150.33488.jbe@pengutronix.de> In-Reply-To: <201902181150.33488.jbe@pengutronix.de> From: "Chin You Wen (WMSC-HW)" Date: Tue, 19 Feb 2019 11:14:29 +0800 Message-ID: Subject: Re: [ptxdist] Append Make Options to Compile Stage of Rule File List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: multipart/mixed; boundary="===============2002412898==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: Juergen Borleis Cc: ptxdist@pengutronix.de --===============2002412898== Content-Type: multipart/alternative; boundary="000000000000365a43058236a467" --000000000000365a43058236a467 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi J=C3=BCrgen, You were right about the specifying the CFLAGS variable in your first reply. It didn't work at first because I commented a line like below, and subsequent lines are not being parsed properly. LIBSEPOL_MAKE_OPT :=3D \ # -Wno-error=3Dshadow "CFLAGS=3D-Wno-error=3Dshadow" Also I will fix these non-trivial warnings. Thanks for your help! Regards, You Wen On Mon, Feb 18, 2019 at 6:50 PM Juergen Borleis wrote: > Hi You Wen, > > On Monday 18 February 2019 11:29:31 Chin You Wen (WMSC-HW) wrote: > > I tried that and also with some variations such as "CFLAGS+=3D-Wno-erro= r" > > but nothing changes in the compiler output. I am compiling for > > Phycore-AM335x SOM, if that matters. > > Okay, without: > > ------------------------ > target: libsepol.compile > ------------------------ > > make[1]: Entering directory '[...]/platform-v7a/build-target/libsepol_2.8= ' > make -C src > make[2]: Entering directory > '[...]/platform-v7a/build-target/libsepol_2.8/src' > arm-v7a-linux-gnueabihf-gcc -Werror -Wall -W -Wundef -Wshadow > -Wmissing-format-attribute -O2 -I. -I../include -D_GNU_SOURCE > -I../cil/include -fPIC -c -o assertion.o assertion.c > arm-v7a-linux-gnueabihf-gcc -Werror -Wall -W -Wundef -Wshadow > -Wmissing-format-attribute -O2 -I. -I../include -D_GNU_SOURCE > -I../cil/include -fPIC -c -o avrule_block.o avrule_block.c > [...] > arm-v7a-linux-gnueabihf-gcc -Werror -Wall -W -Wundef -Wshadow > -Wmissing-format-attribute -O2 -I. -I../include -D_GNU_SOURCE > -I../cil/include -fPIC -c -o mls.o mls.c > In file included from ibpkeys.c:4:0: > ibpkeys.c: In function 'sepol_ibpkey_query': > ibpkeys.c:179:14: error: format '%lx' expects argument of type 'long > unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned > int}' [-Werror=3Dformat=3D] > debug.h:36:330: note: in definition of macro 'msg_write' > ibpkeys.c:179:2: note: in expansion of macro 'ERR' > ibpkeys.c: In function 'sepol_ibpkey_modify': > ibpkeys.c:206:14: error: format '%lx' expects argument of type 'long > unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned > int}' [-Werror=3Dformat=3D] > debug.h:36:330: note: in definition of macro 'msg_write' > ibpkeys.c:206:2: note: in expansion of macro 'ERR' > cc1: all warnings being treated as errors > ICECC[25965] 2019-02-18 11:38:50: Compiled on 10.1.0.69 > Makefile:76: recipe for target 'ibpkeys.o' failed > > And with > > LIBSEPOL_MAKE_OPT :=3D \ > "CFLAGS=3D-Wno-error=3Dshadow" > > in the libsepol.make rule file: > > ------------------------ > target: libsepol.compile > ------------------------ > > make[1]: Entering directory '[...]/platform-v7a/build-target/libsepol_2.8= ' > make -C src > make[2]: Entering directory > '[...]/platform-v7a/build-target/libsepol_2.8/src' > arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include > -D_GNU_SOURCE -I../cil/include -fPIC -c -o assertion.o assertion.c > arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include > -D_GNU_SOURCE -I../cil/include -fPIC -c -o avrule_block.o avrule_block.c > arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include > -D_GNU_SOURCE -I../cil/include -fPIC -c -o avtab.o avtab.c > arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include > -D_GNU_SOURCE -I../cil/include -fPIC -c -o boolean_record.o boolean_recor= d.c > [...] > arm-v7a-linux-gnueabihf-ar rcs libsepol.a assertion.o avrule_block.o > avtab.o boolean_record.o booleans.o conditional.o constraint.o context.o > context_record.o debug.o ebitmap.o expand.o genbools.o genusers.o handle.= o > hashtab.o hierarchy.o ibendport_record.o ibendports.o ibpkey_record.o > ibpkeys.o iface_record.o > interfaces.o kernel_to_cil.o kernel_to_common.o kernel_to_conf.o link.o > mls.o module.o module_to_cil.o node_record.o nodes.o polcaps.o policydb.o > policydb_convert.o policydb_public.o port_record.o ports.o roles.o > services.o sidtab.o symtab.o user_record.o users.o util.o > write.o ../cil/src/cil.o ../cil/src/cil_binary.o > ../cil/src/cil_build_ast.o ../cil/src/cil_copy_ast.o ../cil/src/cil_find.= o > ../cil/src/cil_fqn.o ../cil/src/cil_lexer.o ../cil/src/cil_list.o > ../cil/src/cil_log.o ../cil/src/cil_mem.o ../cil/src/cil_parser.o > ../cil/src/cil_policy.o ../cil/src/cil_post.o ../cil/src/cil_reset_ast.o > ../cil/src/cil_resolve_ast.o ../cil/src/cil_stack.o > ../cil/src/cil_strpool.o ../cil/src/cil_symtab.o ../cil/src/cil_tree.o > ../cil/src/cil_verify.o > arm-v7a-linux-gnueabihf-ranlib libsepol.a > ln -sf libsepol.so.1 libsepol.so > make[2]: Leaving directory > '[...]/platform-v7a/build-target/libsepol_2.8/src' > make -C utils > make[2]: Entering directory > '[...]/platform-v7a/build-target/libsepol_2.8/utils' > arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I../include -L../src > chkcon.c -lsepol -o chkcon > make[2]: Leaving directory > '[...]/platform-v7a/build-target/libsepol_2.8/utils' > make[1]: Leaving directory '[...]/platform-v7a/build-target/libsepol_2.8' > finished target libsepol.compile > > It works as expected (and removes all options from the Makefile, which > isn't > a good idea). Maybe this would be better: > > LIBSEPOL_MAKE_OPT :=3D \ > CFLAGS=3D"-Wall -Wextra -W -Wundef -Wshadow > -Wmissing-format-attribute -O2" > > Regards, > J=C3=BCrgen > > BTW: You should fix the warnings. They are serious. > > -- > Pengutronix e.K. | Juergen Borleis > | > Industrial Linux Solutions | http://www.pengutronix.de/ > | > --=20 Regards, You Wen --000000000000365a43058236a467 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi J=C3=BCrgen,

=
You were right about the specifying the CFLAGS variable in your = first reply. It didn't work at first because I commented a line like be= low, and subsequent lines are not being parsed properly.=C2=A0
LIBSEPOL_MAKE_OPT :=3D \
# -Wno-error=3Dshadow=C2=A0=C2=A0=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 "CFLAGS=3D-Wno-error=3Dshadow"=C2=A0= =C2=A0

Also I will fix these non-trivial war= nings. Thanks for your help!

Regards,
Yo= u Wen
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2= =A0

On Mon, Feb 18, 2019 at 6:50 PM Juergen Borleis &l= t;jbe@pengutronix.de> wrote:
Hi You Wen,

On Monday 18 February 2019 11:29:31 Chin You Wen (WMSC-HW) wrote:
> I tried that and also with some variations such as "CFLAGS+=3D-Wn= o-error"
> but nothing changes in the compiler output. I am compiling for
> Phycore-AM335x SOM, if that matters.

Okay, without:

------------------------
target: libsepol.compile
------------------------

make[1]: Entering directory '[...]/platform-v7a/build-target/libsepol_2= .8'
make -C src
make[2]: Entering directory '[...]/platform-v7a/build-target/libsepol_2= .8/src'
arm-v7a-linux-gnueabihf-gcc -Werror -Wall -W -Wundef -Wshadow -Wmissing-for= mat-attribute -O2 -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c = -o assertion.o assertion.c
arm-v7a-linux-gnueabihf-gcc -Werror -Wall -W -Wundef -Wshadow -Wmissing-for= mat-attribute -O2 -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c = -o avrule_block.o avrule_block.c
[...]
arm-v7a-linux-gnueabihf-gcc -Werror -Wall -W -Wundef -Wshadow -Wmissing-for= mat-attribute -O2 -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c = -o mls.o mls.c
In file included from ibpkeys.c:4:0:
ibpkeys.c: In function 'sepol_ibpkey_query':
ibpkeys.c:179:14: error: format '%lx' expects argument of type '= ;long unsigned int', but argument 4 has type 'uint64_t {aka long lo= ng unsigned int}' [-Werror=3Dformat=3D]
debug.h:36:330: note: in definition of macro 'msg_write'
ibpkeys.c:179:2: note: in expansion of macro 'ERR'
ibpkeys.c: In function 'sepol_ibpkey_modify':
ibpkeys.c:206:14: error: format '%lx' expects argument of type '= ;long unsigned int', but argument 4 has type 'uint64_t {aka long lo= ng unsigned int}' [-Werror=3Dformat=3D]
debug.h:36:330: note: in definition of macro 'msg_write'
ibpkeys.c:206:2: note: in expansion of macro 'ERR'
cc1: all warnings being treated as errors
ICECC[25965] 2019-02-18 11:38:50: Compiled on 10.1.0.69
Makefile:76: recipe for target 'ibpkeys.o' failed

And with

LIBSEPOL_MAKE_OPT :=3D \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "CFLAGS=3D-Wno= -error=3Dshadow"

in the libsepol.make rule file:

------------------------
target: libsepol.compile
------------------------

make[1]: Entering directory '[...]/platform-v7a/build-target/libsepol_2= .8'
make -C src
make[2]: Entering directory '[...]/platform-v7a/build-target/libsepol_2= .8/src'
arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include -D_GNU_SOU= RCE -I../cil/include -fPIC -c -o assertion.o assertion.c
arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include -D_GNU_SOU= RCE -I../cil/include -fPIC -c -o avrule_block.o avrule_block.c
arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include -D_GNU_SOU= RCE -I../cil/include -fPIC -c -o avtab.o avtab.c
arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I. -I../include -D_GNU_SOU= RCE -I../cil/include -fPIC -c -o boolean_record.o boolean_record.c
[...]
arm-v7a-linux-gnueabihf-ar rcs libsepol.a assertion.o avrule_block.o avtab.= o boolean_record.o booleans.o conditional.o constraint.o context.o context_= record.o debug.o ebitmap.o expand.o genbools.o genusers.o handle.o hashtab.= o hierarchy.o ibendport_record.o ibendports.o ibpkey_record.o ibpkeys.o ifa= ce_record.o
interfaces.o kernel_to_cil.o kernel_to_common.o kernel_to_conf.o link.o mls= .o module.o module_to_cil.o node_record.o nodes.o polcaps.o policydb.o poli= cydb_convert.o policydb_public.o port_record.o ports.o roles.o services.o s= idtab.o symtab.o user_record.o users.o util.o
write.o ../cil/src/cil.o ../cil/src/cil_binary.o ../cil/src/cil_build_ast.o= ../cil/src/cil_copy_ast.o ../cil/src/cil_find.o ../cil/src/cil_fqn.o ../ci= l/src/cil_lexer.o ../cil/src/cil_list.o ../cil/src/cil_log.o ../cil/src/cil= _mem.o ../cil/src/cil_parser.o ../cil/src/cil_policy.o ../cil/src/cil_post.= o ../cil/src/cil_reset_ast.o ../cil/src/cil_resolve_ast.o ../cil/src/cil_st= ack.o ../cil/src/cil_strpool.o ../cil/src/cil_symtab.o ../cil/src/cil_tree.= o ../cil/src/cil_verify.o
arm-v7a-linux-gnueabihf-ranlib libsepol.a
ln -sf libsepol.so.1 libsepol.so
make[2]: Leaving directory '[...]/platform-v7a/build-target/libsepol_2.= 8/src'
make -C utils
make[2]: Entering directory '[...]/platform-v7a/build-target/libsepol_2= .8/utils'
arm-v7a-linux-gnueabihf-gcc -Wno-error=3Dshadow -I../include=C2=A0 -L../src= =C2=A0 chkcon.c=C2=A0 -lsepol -o chkcon
make[2]: Leaving directory '[...]/platform-v7a/build-target/libsepol_2.= 8/utils'
make[1]: Leaving directory '[...]/platform-v7a/build-target/libsepol_2.= 8'
finished target libsepol.compile

It works as expected (and removes all options from the Makefile, which isn&= #39;t
a good idea). Maybe this would be better:

LIBSEPOL_MAKE_OPT :=3D \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CFLAGS=3D"-Wal= l -Wextra -W -Wundef -Wshadow -Wmissing-format-attribute -O2"

Regards,
J=C3=BCrgen

BTW: You should fix the warnings. They are serious.

--
Pengutronix e.K. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0| Juergen Borleis =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
Industrial Linux Solutions =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0| http://www.pengutronix.de/ =C2=A0|


--
Regards,
You Wen=
--000000000000365a43058236a467-- --===============2002412898== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KcHR4ZGlzdCBt YWlsaW5nIGxpc3QKcHR4ZGlzdEBwZW5ndXRyb25peC5kZQ== --===============2002412898==--