Check-in [033a6f4cd4]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:A bit more work to ensure that some flags are preserved until the right stage
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:033a6f4cd4de6a5de1820aa89123aa913a405921
User & Date: rkeene 2019-05-10 17:08:56
Context
2019-05-10
17:08
A bit more work to ensure that some flags are preserved until the right stage Leaf check-in: 033a6f4cd4 user: rkeene tags: trunk
2019-05-09
23:10
Make sure when overwriting files we have permission to do so check-in: 019ff6c17d user: rkeene tags: trunk
Changes

Changes to build-cc.

   315    315   
   316    316   	if [ -f "${ADDONS_TARBALL}" ]; then
   317    317   		bzip2 -dc "${ADDONS_TARBALL}" | "${TAR:-tar}" --keep-old-files -xf - >/dev/null 2>/dev/null
   318    318   		fixPerms='true'
   319    319   	fi
   320    320   
   321    321   	if [ "${fixPerms}" = 'true' ]; then
   322         -		find . -type d -exec chmod u+rx '{}' ';'
   323         -		find . -type f -exec chmod u+r '{}' ';'
          322  +		find . -type d -exec chmod u+rwx '{}' ';'
          323  +		find . -type f -exec chmod u+rw '{}' ';'
   324    324   	fi
   325    325   )
   326    326   
   327         -### Set use_multilib authoritatively if possible
   328         -if [ -f "${CCDIR}/${CCNAME}/multilib" ]; then
   329         -	use_multilib="$(cat "${CCDIR}/${CCNAME}/multilib")"
   330         -	rm -f "${CCDIR}/${CCNAME}/multilib"
   331         -fi
   332         -
   333         -### Set C compiler flags from tarball
   334         -if [ -f "${CCDIR}/${CCNAME}/BUILD_CC_GCC_CONFIGURE_EXTRA" ]; then
   335         -	add="$(cat "${CCDIR}/${CCNAME}/BUILD_CC_GCC_CONFIGURE_EXTRA")"
   336         -
   337         -	#### Ensure these flags aren't malicious
   338         -	##### XXX: TODO: Build the extra flags as an array for safety
   339         -	if ! echo "${add}" | grep '[;|<>]' >/dev/null; then
   340         -		BUILD_CC_GCC_CONFIGURE_EXTRA="${BUILD_CC_GCC_CONFIGURE_EXTRA} ${add}"
   341         -	fi
   342         -	
   343         -	rm -f "${CCDIR}/${CCNAME}/BUILD_CC_GCC_CONFIGURE_EXTRA"
   344         -fi
   345         -
   346    327   ## Determine stage of build process
   347    328   STAGE="$2"
   348    329   
   349    330   ### If we have a platform tarball and a stage has not been specified, assume we are at stage 2
   350    331   if [ -z "${STAGE}" ]; then
   351    332   	if [ -f "${PLATFORM_TARBALL}" ]; then
   352    333   		STAGE="stage2"
................................................................................
   360    341   fi
   361    342   
   362    343   ### Normalize stage names
   363    344   if [ "${STAGE}" != "stage1" ]; then
   364    345   	STAGE="stage2"
   365    346   fi
   366    347   export STAGE
          348  +
          349  +### Set use_multilib authoritatively if possible
          350  +if [ -f "${CCDIR}/${CCNAME}/multilib" ]; then
          351  +	use_multilib="$(cat "${CCDIR}/${CCNAME}/multilib")"
          352  +
          353  +	if [ "${STAGE}" = 'stage2' ]; then
          354  +		rm -f "${CCDIR}/${CCNAME}/multilib"
          355  +	fi
          356  +fi
          357  +
          358  +### Set C compiler flags from tarball
          359  +if [ -f "${CCDIR}/${CCNAME}/BUILD_CC_GCC_CONFIGURE_EXTRA" ]; then
          360  +	add="$(cat "${CCDIR}/${CCNAME}/BUILD_CC_GCC_CONFIGURE_EXTRA")"
          361  +
          362  +	#### Ensure these flags aren't malicious
          363  +	##### XXX: TODO: Build the extra flags as an array for safety
          364  +	if ! echo "${add}" | grep '[;|<>]' >/dev/null; then
          365  +		BUILD_CC_GCC_CONFIGURE_EXTRA="${BUILD_CC_GCC_CONFIGURE_EXTRA} ${add}"
          366  +	fi
          367  +	
          368  +	if [ "${STAGE}" = 'stage2' ]; then
          369  +		rm -f "${CCDIR}/${CCNAME}/BUILD_CC_GCC_CONFIGURE_EXTRA"
          370  +	fi
          371  +fi
   367    372   
   368    373   # Determine flags for this build, to pass to sub-scripts
   369    374   FLAGS=''
   370    375   if [ "${use_multilib}" = '1' ]; then
   371    376   	FLAGS="${FLAGS} multilib"
   372    377   fi
   373    378