--- gcc-config 2003-04-15 18:02:06.000000000 -0700 +++ gcc-config 2003-04-15 18:01:52.000000000 -0700 @@ -103,6 +103,7 @@ AWK="$(find_path gawk)" GREP="$(find_path grep)" FIND="$(find_path find)" + STAT="$(find_path stat)" CHMOD="$(find_path chmod)" TOUCH="$(find_path touch)" ENV_UPDATE="$(find_path env-update)" @@ -184,6 +185,8 @@ # Add our custom LDPATH echo "LDPATH=\"${MY_LDPATH}\"" >> /etc/env.d/05gcc + CC_PATH=${PATH} + # Make sure we do not recreate /lib/cpp and /usr/bin/cc ... # echo "DISABLE_GEN_GCC_WRAPPERS=\"yes\"" >> /etc/env.d/05gcc @@ -200,6 +203,16 @@ ${RM} -f "/usr/bin/${x}" ${CP} -f /usr/lib/gcc-config/wrapper "/usr/bin/${x}" + # reset the permisions in case umask is too strict + # use the permission of the final binary if it exists (gcc, ...) + # or of the wrapper if it doesn't (cc, ...) + if [ -f "${CC_PATH}/${x}" ]; then + X_PERM=`${STAT} -c %a ${CC_PATH}/${x}` + else + X_PERM=`${STAT} -c %a /usr/lib/gcc-config/wrapper` + fi + ${CHMOD} ${X_PERM} "/usr/bin/${x}" + if [ "${OLD_CC_COMP}" != "${CC_COMP}" ] then ${TOUCH} -m "/usr/bin/${x}"