Subject: Building without SSP (was: CVS commit: src/include (_FORTIFY_SOURCE))
To: None <current-users@NetBSD.org>
From: Bernd Ernesti <veego@NetBSD.org>
List: current-users
Date: 08/04/2007 19:11:43
[Moved from source-changes]

On Fri, Aug 03, 2007 at 01:40:03AM +0000, Geoff Wing wrote:
> Krister Walfridsson <kristerw@netbsd.org> typed:
> : Module Name:	src
> : Committed By:	kristerw
> : Date:		Thu Aug  2 21:49:10 UTC 2007
> :
> : Modified Files:
> : 	src/include: stdio.h string.h strings.h unistd.h
> :
> : Log Message:
> : Do not include SSP files unless _FORTIFY_SOURCE > 0.
> 
> If the aim is to completely not include SSP stuff, then you need to do
> more in libc, otherwise this won't work.

You mean a build fails like this now?

/src/lib/libc/ssp/fgets_chk.c:53: warning: no previous prototype for '__fgets_chk'

Applying your patch fixed this.

IMHO this should be commited and I would like to do it by the next weekend if
nobody objects.

Bernd

> Regards,
> Geoff
> 
> --- lib/libc/Makefile.org	2007-05-30 15:44:54.000000000 +1000
> +++ lib/libc/Makefile	2007-08-03 11:30:49.000000000 +1000
> @@ -74,7 +74,9 @@
>  .include "${.CURDIR}/regex/Makefile.inc"
>  .include "${.CURDIR}/resolv/Makefile.inc"
>  .include "${.CURDIR}/rpc/Makefile.inc"
> +.if defined(${_FORTIFY_SOURCE}) && ${_FORTIFY_SOURCE} > 0
>  .include "${.CURDIR}/ssp/Makefile.inc"
> +.endif
>  .include "${.CURDIR}/stdio/Makefile.inc"
>  .include "${.CURDIR}/stdlib/Makefile.inc"
>  .include "${.CURDIR}/string/Makefile.inc"