1 # $NetBSD: ssp.mk,v 1.2.18.1 2019/06/10 22:07:04 christos Exp $ 2 3 .if ${USE_SSP:Uno} == "yes" 4 COPTS.kern_ssp.c+= -fno-stack-protector -D__SSP__ 5 .endif 6 7 # for multi-cpu machines, cpu_hatch() straddles the init of 8 # __stack_chk_guard, so ensure stack protection is disabled 9 .if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" 10 COPTS.cpu.c+= -fno-stack-protector 11 .endif 12 13 COPTS.subr_kleak.c+= -fno-stack-protector 14 COPTS.subr_kcov.c+= -fno-stack-protector 15 16 # The following files use alloca(3) or variable array allocations. 17 # Their full name is noted as documentation. 18 VARSTACK= \ 19 arch/xen/i386/gdt.c \ 20 dev/ic/aic79xx.c \ 21 dev/ic/aic7xxx.c \ 22 dev/usb/xhci.c \ 23 dev/ofw/ofw_subr.c \ 24 kern/uipc_socket.c \ 25 miscfs/genfs/genfs_vnops.c \ 26 nfs/nfs_bio.c \ 27 uvm/uvm_bio.c \ 28 uvm/uvm_pager.c \ 29 30 .for __varstack in ${VARSTACK} 31 COPTS.${__varstack:T} += -Wno-stack-protector 32 .endfor 33