This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Setting CFLAGS values in sysdeps makefiles


There are lots of instances of CFLAGS for particular source files being 
set, or appended to, in sysdeps makefiles.

Whether this works, however, depends on the location of inclusion of the 
sysdeps makefile (via "include ../Rules") in the relevant subdirectory's 
makefile, if that system-independent makefile also sets CFLAGS for the 
relevant source file.

I'd like to put -Wno-inline in CFLAGS-waitid.c in 
ports/sysdeps/unix/sysv/linux/mips/mips32/Makefile - there are -Winline 
warnings because of an inline function in sysdeps/unix/sysv/linux/waitid.c 
that uses a five-argument syscall, where the syscall macro uses alloca to 
force a frame pointer and so prevents the function from being inlined, 
causing -Winline warnings; in this case, using -Wno-inline seems cleaner 
to me than duplicating waitid.c without the "inline".

But posix/Makefile sets CFLAGS-waitid.c itself, with "=" not "+=", so 
"CFLAGS-waitid.c += -Wno-inline" in the sysdeps makefile has no effect, 
given that posix/Makefile includes Rules above the CFLAGS-* definitions.

To make this sort of thing work, should the CFLAGS-* settings in 
posix/Makefile be made to use "+=", or should they be moved higher up the 
file, or the Rules inclusion moved down, or would some other approach be 
best?  And is there any general rule for what order the contents of the 
subdirectory Makefile (including the "include ../Makeconfig" and "include 
../Rules") should go in?

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]