Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 90391 | Differences between
and this patch

Collapse All | Expand All

(-)flag-o-matic.eclass.orig (-1 / +20 lines)
Lines 63-68 Link Here
63
# notice: modern automatic specs files will also suppress -fstack-protector-all
63
# notice: modern automatic specs files will also suppress -fstack-protector-all
64
# when only -fno-stack-protector is given
64
# when only -fno-stack-protector is given
65
#
65
#
66
#### has_pic ####
67
# Returns true if the compiler by default or with current CFLAGS
68
# builds position-independent code.
69
#
70
#### has_ssp_all ####
71
# Returns true if the compiler by default or with current CFLAGS
72
# generates stack smash protections for all functions
73
#
74
#### has_ssp ####
75
# Returns true if the compiler by default or with current CFLAGS
76
# generates stack smash protections for most vulnerable functions
77
#
66
78
67
# C[XX]FLAGS that we allow in strip-flags
79
# C[XX]FLAGS that we allow in strip-flags
68
setup-allowed-flags() {
80
setup-allowed-flags() {
Lines 326-332 Link Here
326
	[ "${CFLAGS/-fPIC}" != "${CFLAGS}" ] && return 0
338
	[ "${CFLAGS/-fPIC}" != "${CFLAGS}" ] && return 0
327
	[ "${CFLAGS/-fpic}" != "${CFLAGS}" ] && return 0
339
	[ "${CFLAGS/-fpic}" != "${CFLAGS}" ] && return 0
328
	[ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __PIC__)" ] && return 0
340
	[ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __PIC__)" ] && return 0
329
	test_version_info pie && return 0
330
	return 1
341
	return 1
331
}
342
}
332
343
Lines 340-345 Link Here
340
	return 1
351
	return 1
341
}
352
}
342
353
354
# indicate whether code for SSP is being generated for all functions
355
has_ssp_all() {
356
	# note; this matches only -fstack-protector-all
357
	[ "${CFLAGS/-fstack-protector-all}" != "${CFLAGS}" ] && return 0
358
	[ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __SSP_ALL__)" ] && return 0
359
	return 1
360
}
361
343
# indicate whether code for SSP is being generated
362
# indicate whether code for SSP is being generated
344
has_ssp() {
363
has_ssp() {
345
	# note; this matches both -fstack-protector and -fstack-protector-all
364
	# note; this matches both -fstack-protector and -fstack-protector-all

Return to bug 90391