Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 231555 Details for
Bug 318171
[TRACKER] Merge SSP and >=gcc 4.4 hardened to the tree.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Needed change for >=gcc 4.4 hardened support.
toolchain.eclass.patch (text/plain), 7.65 KB, created by
Magnus Granberg
on 2010-05-15 12:27:14 UTC
(
hide
)
Description:
Needed change for >=gcc 4.4 hardened support.
Filename:
MIME Type:
Creator:
Magnus Granberg
Created:
2010-05-15 12:27:14 UTC
Size:
7.65 KB
patch
obsolete
>2010-05-15 Magnus Granberg <zorry@gentoo.org> > > * eclass/toolchain.eclass > SLOT+IUSE logic: Add USE nossp if SPECS_VER defined > get_gcc_src_uri(): Add zorry to devspec Move PIE_CORE Remove nopie > hardened_gcc_works(): Add nopie check if >=gcc 4.3.2 Add [[ -n ${SPECS_VER} ]] to check PP_VER line > Add nossp check if >=gcc 4.3.2 > want_pie(): Add check for (PIE_VER && SPECS_VER) and (-hardened && nopie && PIE_VER) if >=gcc 4.3.2 > want_minispecs(): Add check for (use nopie && use nossp), use vanilla, ! want_pie, > (! hardened_gcc_works pie && ! hardened_gcc_works ssp) and print a warnings. > gcc_pkg_setup(): Call want_minispecs so we get hardened warings before unpack > gcc-compiler_src_unpack(): make_gcc_hard() don't fail with want_minispecs > gcc-compiler-configure(): Set esp to disable, all, nopie or nossp depend on the support and USE-flags > gcc_src_compile(): Make setup_minispecs_gcc_build_specs() depend on <=gcc 4.4.3 > gcc-compiler_src_install(): Add want_minispecs to hardened create_gcc_env_entry part > want_minispecs need ${WORKDIR}"/specs/*.specs > Move copy_minispecs_gcc_specs to hardened create_gcc_env_entry part > >--- a/eclass/toolchain.eclass 2010-04-25 17:47:56.000000000 +0200 >+++ b/eclass/toolchain.eclass 2010-04-29 00:29:27.000000000 +0200 >@@ -143,6 +143,7 @@ > IUSE="${IUSE} altivec build fortran nls nocxx" > [[ -n ${PIE_VER} ]] && IUSE="${IUSE} nopie" > [[ -n ${PP_VER} ]] && IUSE="${IUSE} nossp" >+ [[ -n ${SPECS_VER} ]] && IUSE="${IUSE} nossp" > [[ -n ${HTB_VER} ]] && IUSE="${IUSE} boundschecking" > [[ -n ${D_VER} ]] && IUSE="${IUSE} d" > >@@ -278,7 +279,7 @@ > # > gentoo_urls() { > local devspace="HTTP~lv/GCC/URI HTTP~eradicator/gcc/URI HTTP~vapier/dist/URI >- HTTP~halcy0n/patches/URI" >+ HTTP~halcy0n/patches/URI HTTP~zorry/patches/gcc/URI" > devspace=${devspace//HTTP/http:\/\/dev.gentoo.org\/} > echo mirror://gentoo/$1 ${devspace//URI/$1} > } >@@ -290,9 +291,6 @@ > export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} > export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} > >- [[ -n ${PIE_VER} ]] && \ >- PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} >- > # Set where to download gcc itself depending on whether we're using a > # prerelease, snapshot, or release tarball. > if [[ -n ${PRERELEASE} ]] ; then >@@ -334,11 +332,12 @@ > > # strawberry pie, Cappuccino and a Gauloises (it's a good thing) > [[ -n ${PIE_VER} ]] && \ >- GCC_SRC_URI="${GCC_SRC_URI} !nopie? ( $(gentoo_urls ${PIE_CORE}) )" >- >+ PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} && \ >+ GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls ${PIE_CORE})" >+ > # gcc minispec for the hardened gcc 4 compiler > [[ -n ${SPECS_VER} ]] && \ >- GCC_SRC_URI="${GCC_SRC_URI} !nopie? ( $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2) )" >+ GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2)" > > # gcc bounds checking patch > if [[ -n ${HTB_VER} ]] ; then >@@ -392,6 +393,7 @@ > [[ ${CTARGET} == *-freebsd* ]] && return 1 > > want_pie || return 1 >+ tc_version_is_at_least 4.3.2 && use nopie && return 1 > hardened_gcc_is_stable pie && return 0 > if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then > hardened_gcc_check_unsupported pie && return 1 >@@ -400,7 +400,8 @@ > fi > return 1 > elif [[ $1 == "ssp" ]] ; then >- [[ -z ${PP_VER} ]] && return 1 >+ [[ -n ${PP_VER} ]] || [[ -n ${SPECS_VER} ]] || return 1 >+ tc_version_is_at_least 4.3.2 && use nossp && return 1 > hardened_gcc_is_stable ssp && return 0 > if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then > hardened_gcc_check_unsupported ssp && return 1 >@@ -490,7 +490,12 @@ > return 1 > } > want_boundschecking() { _want_stuff HTB_VER boundschecking ; } >-want_pie() { _want_stuff PIE_VER !nopie ; } >+want_pie() { >+ ! use hardened && [[ -n ${PIE_VER} ]] && use nopie && return 1 >+ [[ -n ${PIE_VER} ]] && [[ -n ${SPECS_VER} ]] && return 0 >+ tc_version_is_at_least 4.3.2 && return 1 >+ _want_stuff PIE_VER !nopie >+} > want_ssp() { _want_stuff PP_VER !nossp ; } > > want_split_specs() { >@@ -498,11 +503,19 @@ > } > want_minispecs() { > if tc_version_is_at_least 4.3.2 && use hardened ; then >- if [[ -n ${SPECS_VER} ]] ; then >- return 0 >+ if ! want_pie ; then >+ ewarn "PIE_VER or SPECS_VER is not defiend in the GCC ebuild." >+ elif use vanilla ; then >+ ewarn "You will not get hardened features if you have the vanilla USE-flag." >+ elif use nopie && use nossp ; then >+ ewarn "You will not get hardened features if you have the nopie and nossp USE-flag." >+ elif ! hardened_gcc_works pie && ! hardened_gcc_works ssp && ! use nopie ; then >+ ewarn "Your $(tc-arch) arch is not supported." > else >- die "For Hardened to work you need the minispecs files" >+ return 0 > fi >+ ewarn "Hope you know what you are doing. Hardened will not work." >+ return 0 > fi > return 1 > } >@@ -1010,7 +1030,7 @@ > # the necessary support > want_pie && use hardened && glibc_have_pie > >- if use hardened && ! want_minispecs ; then >+ if use hardened ; then > einfo "updating configuration to build hardened GCC" > make_gcc_hard || die "failed to make gcc hard" > fi >@@ -1201,6 +1233,19 @@ > confgcc="${confgcc} --disable-libssp" > fi > >+ # If we want hardened support with the newer pie-patchset for >=gcc 4.4.3 >+ if tc_version_is_at_least 4.4.3 && want_minispecs && ! use vanilla ; then >+ if hardened_gcc_works ; then >+ confgcc="${confgcc} --enable-esp=all" >+ elif ! hardened_gcc_works pie && hardened_gcc_works ssp ; then >+ confgcc="${confgcc} --enable-esp=nopie" >+ elif ! hardened_gcc_works ssp && hardened_gcc_works pie ; then >+ confgcc="${confgcc} --enable-esp=nossp" >+ else >+ confgcc="${confgcc} --disable-esp" >+ fi >+ fi >+ > if tc_version_is_at_least "4.2" ; then > confgcc="${confgcc} $(use_enable openmp libgomp)" > fi >@@ -1682,8 +1715,8 @@ > einfo "CFLAGS=\"${CFLAGS}\"" > einfo "CXXFLAGS=\"${CXXFLAGS}\"" > >- # For hardened gcc 4 for build the hardened specs file to use when building gcc >- setup_minispecs_gcc_build_specs >+ # For hardened gcc 4.3 piepatches to build the hardened specs file to use when building gcc >+ ! tc_version_is_at_least 4.4.3 && setup_minispecs_gcc_build_specs > > # Build in a separate build tree > mkdir -p "${WORKDIR}"/build >@@ -1791,11 +1826,13 @@ > dodir /etc/env.d/gcc > create_gcc_env_entry > >- if want_split_specs ; then >+ if want_split_specs || want_minispecs ; then > if use hardened ; then > create_gcc_env_entry vanilla > fi >- ! use hardened && hardened_gcc_works && create_gcc_env_entry hardened >+ if ! use hardened && hardened_gcc_works && want_split_specs ; then >+ create_gcc_env_entry hardened >+ fi > if hardened_gcc_works || hardened_gcc_works pie ; then > create_gcc_env_entry hardenednossp > fi >@@ -1805,14 +1840,14 @@ > create_gcc_env_entry hardenednopiessp > > insinto ${LIBPATH} >- doins "${WORKDIR}"/build/*.specs || die "failed to install specs" >- fi >- # Setup the gcc_env_entry for hardened gcc 4 with minispecs >- if want_minispecs ; then >- if hardened_gcc_works pie ; then >- create_gcc_env_entry hardenednopie >+ if want_split_specs ; then >+ doins "${WORKDIR}"/build/*.specs || die "failed to install specs" > fi >- create_gcc_env_entry vanilla >+ if want_minispecs ; then >+ doins "${WORKDIR}"/specs/*.specs || die "failed to install specs" >+ fi >+ # For gcc 4.3 piepatches >+ ! tc_version_is_at_least 4.4.3 && copy_minispecs_gcc_specs > fi > # Make sure we dont have stuff lying around that > # can nuke multiple versions of gcc >@@ -1918,9 +1950,6 @@ > # Create config files for eselect-compiler > create_eselect_conf > >- # Cpoy the needed minispec for hardened gcc 4 >- copy_minispecs_gcc_specs >- > # Move pretty-printers to gdb datadir to shut ldconfig up > gdbdir=/usr/share/gdb/auto-load > for module in $(find "${D}" -iname "*-gdb.py" -print); do
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 318171
:
230049
|
230063
|
230065
|
230067
|
230089
|
231461
|
231555
|
233051
|
233053