Per-source CFLAGS again

David Xu davidxu at freebsd.org
Mon Sep 20 05:56:00 UTC 2010


David Schultz wrote:
> The reason I proposed the feature was so that we could compile the
> parts of libc that come from a third party (namely, gdtoa) with
> different warning flags than the rest of libc.  It was not
> committed because someone else proposed a simpler way to get make
> to use different flags for gdtoa.
> 
> I suppose it wouldn't hurt to commit it it's needed for something
> else, but I think Marcel also had some philosophical objections to
> the proposal.

This time, the compiler's function is required to generate some
stack unwinding info, it is not compiler's warning flag.
without modification to sys.mk:
I have to hack the libc's Makefile, but obviously, CWARNFLAGS is not
the right place.

Index: Makefile
===================================================================
--- Makefile	
+++ Makefile	
@@ -145,3 +145,5 @@
  SSP_CFLAGS:=	${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/}
  # Disable stack protection for SSP symbols.
  SSP_CFLAGS:=	${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/}
+# Generate stack unwinding table for cancellation points
+CWARNFLAGS:= 
${.IMPSRC:Ncancelpoints_*:C/^.+$/${CWARNFLAGS}/:C/^$/-fexceptions 
${CWARNFLAGS}/}



More information about the freebsd-arch mailing list