diff options
author | Matt Turner <mattst88@gmail.com> | 2012-02-09 11:27:11 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2012-02-09 11:27:11 -0500 |
commit | 584fb8b6b062ddec45aa2997f1981c5a74fcda70 (patch) | |
tree | 8be2e26805e4983c12e1e1dba09135b273596bb5 | |
parent | Remove x11-drivers/xf86-video-ati (diff) | |
download | loongson-584fb8b6b062ddec45aa2997f1981c5a74fcda70.tar.gz loongson-584fb8b6b062ddec45aa2997f1981c5a74fcda70.tar.bz2 loongson-584fb8b6b062ddec45aa2997f1981c5a74fcda70.zip |
Remove sys-devel/binutils
binutils-2.20.1-loongson2f.patch is included in at least 2.21.1.
binutils-mips-tls.patch is not in 2.22 but I'm not sure that the patch
is correct, nor have I experienced any problems without it.
Remove the outdated copy of cvs.eclass that was copied for binutils-9999
as well.
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | eclass/cvs.eclass | 606 | ||||
-rw-r--r-- | sys-devel/binutils/Manifest | 6 | ||||
-rw-r--r-- | sys-devel/binutils/binutils-2.20.1-r1.ebuild | 15 | ||||
-rw-r--r-- | sys-devel/binutils/binutils-9999.ebuild | 10 | ||||
-rw-r--r-- | sys-devel/binutils/files/binutils-2.20.1-loongson2f.patch | 505 | ||||
-rw-r--r-- | sys-devel/binutils/files/binutils-mips-tls.patch | 11 |
6 files changed, 0 insertions, 1153 deletions
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass deleted file mode 100644 index b6790cf..0000000 --- a/eclass/cvs.eclass +++ /dev/null @@ -1,606 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.74 2010/08/22 20:50:52 vapier Exp $ - -# @ECLASS: cvs.eclass -# @MAINTAINER: -# vapier@gentoo.org (and anyone who wants to help) -# @BLURB: This eclass provides generic cvs fetching functions -# @DESCRIPTION: -# This eclass provides the generic cvs fetching functions. To use this from an -# ebuild, set the ECLASS VARIABLES as specified below in your ebuild before -# inheriting. Then either leave the default src_unpack or extend over -# cvs_src_unpack. If you find that you need to call the cvs_* functions -# directly, I'd be interested to hear about it. - -inherit eutils - -# TODO: - -# Implement more auth types (gserver?, kserver?) - -# Support additional remote shells with `ext' authentication (does -# anyone actually need to use it with anything other than SSH?) - - -# Users shouldn't change these settings! The ebuild/eclass inheriting -# this eclass will take care of that. If you want to set the global -# KDE cvs ebuilds' settings, see the comments in kde-source.eclass. - -# @ECLASS-VARIABLE: ECVS_CVS_COMMAND -# @DESCRIPTION: -# CVS command to run -# -# You can set, for example, "cvs -t" for extensive debug information -# on the cvs connection. The default of "cvs -q -f -z4" means to be -# quiet, to disregard the ~/.cvsrc config file and to use maximum -# compression. -[[ -z ${ECVS_CVS_COMMAND} ]] && ECVS_CVS_COMMAND="cvs ${ECVS_CVS_OPTIONS} ${ECVS_CVS_COMPRESS}" - -# @ECLASS-VARIABLE: ECVS_CVS_COMPRESS -# @DESCRIPTION: -# Set the compression level. -[[ -z ${ECVS_CVS_COMPRESS} ]] && ECVS_CVS_COMPRESS="-z1" - -# @ECLASS-VARIABLE: ECVS_CVS_OPTIONS -# @DESCRIPTION: -# Additional options to the cvs commands. -[[ -z ${ECVS_CVS_OPTIONS} ]] && ECVS_CVS_OPTIONS="-q -f" - -# @ECLASS-VARIABLE: ECVS_UP_OPTS -# @DESCRIPTION: -# CVS options given after the cvs update command. Don't remove "-dP" or things -# won't work. -[ -z "$ECVS_UP_OPTS" ] && ECVS_UP_OPTS="-dP" - -# @ECLASS-VARIABLE: ECVS_CO_OPTS -# @DESCRIPTION: -# CVS options given after the cvs checkout command. -[ -z "$ECVS_CO_OPTS" ] && ECVS_CO_OPTS="" - -# @ECLASS-VARIABLE: ECVS_OFFLINE -# @DESCRIPTION: -# Set this variable to a non-empty value to disable the automatic updating of -# a CVS source tree. This is intended to be set outside the cvs source -# tree by users. -: ${ECVS_OFFLINE:=${ESCM_OFFLINE}} - -# @ECLASS-VARIABLE: ECVS_LOCAL -# @DEFAULT_UNSET -# @DESCRIPTION: -# If this is set, the CVS module will be fetched non-recursively. -# Refer to the information in the CVS man page regarding the -l -# command option (not the -l global option). - -# @ECLASS-VARIABLE: ECVS_LOCALNAME -# @DEFAULT_UNSET -# @DESCRIPTION: -# Local name of checkout directory -# -# This is useful if the module on the server is called something -# common like 'driver' or is nested deep in a tree, and you don't like -# useless empty directories. -# -# WARNING: Set this only from within ebuilds! If set in your shell or -# some such, things will break because the ebuild won't expect it and -# have e.g. a wrong $S setting. - -# @ECLASS-VARIABLE: ECVS_CO_DIR -# @DEFAULT_UNSET -# @DESCRIPTION: -# The name of the directory actually checked out. -# -# This is useful when server doesn't allow -d option of co, e.g. binutils -# After the module is checked out, we will "mv ECVS_CO_DIR ECVS_LOCALNAME" - -# @ECLASS-VARIABLE: ECVS_TOP_DIR -# @DESCRIPTION: -# The directory under which CVS modules are checked out. -[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src" - -# @ECLASS-VARIABLE: ECVS_SERVER -# @DESCRIPTION: -# CVS path -# -# The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde". -# Remove the other parts of the full CVSROOT, which might look like -# ":pserver:anonymous@anoncvs.kde.org:/home/kde"; this is generated -# using other settings also. -# -# Set this to "offline" to disable fetching (i.e. to assume the module -# is already checked out in ECVS_TOP_DIR). -[ -z "$ECVS_SERVER" ] && ECVS_SERVER="offline" - -# @ECLASS-VARIABLE: ECVS_MODULE -# @REQUIRED -# @DESCRIPTION: -# The name of the CVS module to be fetched -# -# This must be set when cvs_src_unpack is called. This can include -# several directory levels, i.e. "foo/bar/baz" - -#[ -z "$ECVS_MODULE" ] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue" - -# @ECLASS-VARIABLE: ECVS_BRANCH -# @DEFAULT_UNSET -# @DESCRIPTION: -# The name of the branch/tag to use -# -# The default is "HEAD". The following default _will_ reset your -# branch checkout to head if used. - -#[ -z "$ECVS_BRANCH" ] && ECVS_BRANCH="HEAD" - -# @ECLASS-VARIABLE: ECVS_AUTH -# @DESCRIPTION: -# Authentication method to use -# -# Possible values are "pserver" and "ext". If `ext' authentication is -# used, the remote shell to use can be specified in CVS_RSH (SSH is -# used by default). Currently, the only supported remote shell for -# `ext' authentication is SSH. -# -# Armando Di Cianno <fafhrd@gentoo.org> 2004/09/27 -# - Added "no" as a server type, which uses no AUTH method, nor -# does it login -# e.g. -# "cvs -danoncvs@savannah.gnu.org:/cvsroot/backbone co System" -# ( from gnustep-apps/textedit ) -[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver" - -# @ECLASS-VARIABLE: ECVS_USER -# @DESCRIPTION: -# Username to use for authentication on the remote server. -[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" - -# @ECLASS-VARIABLE: ECVS_PASS -# @DESCRIPTION: -# Password to use for authentication on the remote server -[ -z "$ECVS_PASS" ] && ECVS_PASS="" - -# @ECLASS-VARIABLE: ECVS_SSH_HOST_KEY -# @DEFAULT_UNSET -# @DESCRIPTION: -# If SSH is used for `ext' authentication, use this variable to -# specify the host key of the remote server. The format of the value -# should be the same format that is used for the SSH known hosts file. -# -# WARNING: If a SSH host key is not specified using this variable, the -# remote host key will not be verified. - -# @ECLASS-VARIABLE: ECVS_CLEAN -# @DEFAULT_UNSET -# @DESCRIPTION: -# Set this to get a clean copy when updating (passes the -# -C option to cvs update) - -# @ECLASS-VARIABLE: ECVS_RUNAS -# @DEFAULT_UNSET -# @DESCRIPTION: -# Specifies an alternate (non-root) user to use to run cvs. Currently -# b0rked and wouldn't work with portage userpriv anyway without -# special magic. - -# [ -z "$ECVS_RUNAS" ] && ECVS_RUNAS="`whoami`" - -# ECVS_SUBDIR -- deprecated, do not use -[ -n "$ECVS_SUBDIR" ] && die "ERROR: deprecated ECVS_SUBDIR defined. Please fix this ebuild." - -# add cvs to deps -# ssh is used for ext auth -# sudo is used to run as a specified user -DEPEND="dev-vcs/cvs" - -[ -n "$ECVS_RUNAS" ] && DEPEND="$DEPEND app-admin/sudo" - -if [ "$ECVS_AUTH" == "ext" ]; then - #default to ssh - [ -z "$CVS_RSH" ] && export CVS_RSH="ssh" - if [ "$CVS_RSH" != "ssh" ]; then - die "Support for ext auth with clients other than ssh has not been implemented yet" - fi - DEPEND="${DEPEND} net-misc/openssh" -fi - -# called from cvs_src_unpack -cvs_fetch() { - - # Make these options local variables so that the global values are - # not affected by modifications in this function. - - local ECVS_COMMAND="${ECVS_COMMAND}" - local ECVS_UP_OPTS="${ECVS_UP_OPTS}" - local ECVS_CO_OPTS="${ECVS_CO_OPTS}" - - debug-print-function $FUNCNAME $* - - # Update variables that are modified by ebuild parameters, which - # should be effective every time cvs_fetch is called, and not just - # every time cvs.eclass is inherited - - # Handle parameter for local (non-recursive) fetching - - if [ -n "$ECVS_LOCAL" ]; then - ECVS_UP_OPTS="$ECVS_UP_OPTS -l" - ECVS_CO_OPTS="$ECVS_CO_OPTS -l" - fi - - # Handle ECVS_BRANCH option - # - # Because CVS auto-switches branches, we just have to pass the - # correct -rBRANCH option when updating. - - if [ -n "$ECVS_BRANCH" ]; then - ECVS_UP_OPTS="$ECVS_UP_OPTS -r$ECVS_BRANCH" - ECVS_CO_OPTS="$ECVS_CO_OPTS -r$ECVS_BRANCH" - fi - - # Handle ECVS_LOCALNAME, which specifies the local directory name - # to use. Note that the -d command option is not equivalent to - # the global -d option. - - if [ -z "$ECVS_CO_DIR" ] && [ "$ECVS_LOCALNAME" != "$ECVS_MODULE" ]; then - ECVS_CO_OPTS="$ECVS_CO_OPTS -d $ECVS_LOCALNAME" - fi - - - if [ -n "$ECVS_CLEAN" ]; then - ECVS_UP_OPTS="$ECVS_UP_OPTS -C" - fi - - - # It would be easiest to always be in "run-as mode", logic-wise, - # if sudo didn't ask for a password even when sudo'ing to `whoami`. - - if [ -z "$ECVS_RUNAS" ]; then - run="" - else - run="sudo -u $ECVS_RUNAS" - fi - - # Create the top dir if needed - - if [ ! -d "$ECVS_TOP_DIR" ]; then - - # Note that the addwrite statements in this block are only - # there to allow creating ECVS_TOP_DIR; we allow writing - # inside it separately. - - # This is because it's simpler than trying to find out the - # parent path of the directory, which would need to be the - # real path and not a symlink for things to work (so we can't - # just remove the last path element in the string) - - debug-print "$FUNCNAME: checkout mode. creating cvs directory" - addwrite /foobar - addwrite / - $run mkdir -p "/$ECVS_TOP_DIR" - export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}" - fi - - # In case ECVS_TOP_DIR is a symlink to a dir, get the real path, - # otherwise addwrite() doesn't work. - - cd -P "$ECVS_TOP_DIR" > /dev/null - ECVS_TOP_DIR="`/bin/pwd`" - - # Disable the sandbox for this dir - addwrite "$ECVS_TOP_DIR" - - # Chown the directory and all of its contents - if [ -n "$ECVS_RUNAS" ]; then - $run chown -R "$ECVS_RUNAS" "/$ECVS_TOP_DIR" - fi - - # Determine the CVS command mode (checkout or update) - if [ ! -d "$ECVS_TOP_DIR/$ECVS_LOCALNAME/CVS" ]; then - mode=checkout - else - mode=update - fi - - # This is required for binutils, if the initial co were interrupted, we need - # to start over again. - if [ -n "$ECVS_CO_DIR" ] && [ -d "$ECVS_TOP_DIR/$ECVS_CO_DIR" ]; then - rm -rf "$ECVS_TOP_DIR/$ECVS_CO_DIR" - fi - - # Our server string (i.e. CVSROOT) without the password so it can - # be put in Root - if [ "$ECVS_AUTH" == "no" ] - then - local server="${ECVS_USER}@${ECVS_SERVER}" - else - local connection="${ECVS_AUTH}" - [[ -n ${ECVS_PROXY} ]] && connection="${connection};proxy=${ECVS_PROXY}" - [[ -n ${ECVS_PROXY_PORT} ]] && connection="${connection};proxyport=${ECVS_PROXY_PORT}" - local server=":${connection}:${ECVS_USER}@${ECVS_SERVER}" - fi - - # Switch servers automagically if needed - if [ "$mode" == "update" ]; then - cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME - local oldserver="`$run cat CVS/Root`" - if [ "$server" != "$oldserver" ]; then - - einfo "Changing the CVS server from $oldserver to $server:" - debug-print "$FUNCNAME: Changing the CVS server from $oldserver to $server:" - - einfo "Searching for CVS directories ..." - local cvsdirs="`$run find . -iname CVS -print`" - debug-print "$FUNCNAME: CVS directories found:" - debug-print "$cvsdirs" - - einfo "Modifying CVS directories ..." - for x in $cvsdirs; do - debug-print "In $x" - $run echo "$server" > "$x/Root" - done - - fi - fi - - # Prepare a cvspass file just for this session, we don't want to - # mess with ~/.cvspass - touch "${T}/cvspass" - export CVS_PASSFILE="${T}/cvspass" - if [ -n "$ECVS_RUNAS" ]; then - chown "$ECVS_RUNAS" "${T}/cvspass" - fi - - # The server string with the password in it, for login - cvsroot_pass=":${ECVS_AUTH}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}" - - # Ditto without the password, for checkout/update after login, so - # that the CVS/Root files don't contain the password in plaintext - if [ "$ECVS_AUTH" == "no" ] - then - cvsroot_nopass="${ECVS_USER}@${ECVS_SERVER}" - else - cvsroot_nopass=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}" - fi - - # Commands to run - cmdlogin="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_pass}\" login" - if [ -n "$ECVS_CO_DIR" ]; then - cmdupdate="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" update ${ECVS_LOCALNAME}" - else - cmdupdate="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME}" - fi - cmdcheckout="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE}" - - # Execute commands - - cd "${ECVS_TOP_DIR}" - if [ "${ECVS_AUTH}" == "pserver" ]; then - einfo "Running $cmdlogin" - eval $cmdlogin || die "cvs login command failed" - if [ "${mode}" == "update" ]; then - einfo "Running $cmdupdate" - eval $cmdupdate || die "cvs update command failed" - elif [ "${mode}" == "checkout" ]; then - einfo "Running $cmdcheckout" - eval $cmdcheckout|| die "cvs checkout command failed" - fi - elif [ "${ECVS_AUTH}" == "ext" ] || [ "${ECVS_AUTH}" == "no" ]; then - - # Hack to support SSH password authentication - - # Backup environment variable values - local CVS_ECLASS_ORIG_CVS_RSH="${CVS_RSH}" - - if [ "${SSH_ASKPASS+set}" == "set" ]; then - local CVS_ECLASS_ORIG_SSH_ASKPASS="${SSH_ASKPASS}" - else - unset CVS_ECLASS_ORIG_SSH_ASKPASS - fi - - if [ "${DISPLAY+set}" == "set" ]; then - local CVS_ECLASS_ORIG_DISPLAY="${DISPLAY}" - else - unset CVS_ECLASS_ORIG_DISPLAY - fi - - if [ "${CVS_RSH}" == "ssh" ]; then - - # Force SSH to use SSH_ASKPASS by creating python wrapper - - export CVS_RSH="${T}/cvs_sshwrapper" - cat > "${CVS_RSH}"<<EOF -#!/usr/bin/python -import fcntl -import os -import sys -try: - fd = os.open('/dev/tty', 2) - TIOCNOTTY=0x5422 - try: - fcntl.ioctl(fd, TIOCNOTTY) - except: - pass - os.close(fd) -except: - pass -newarglist = sys.argv[:] -EOF - - # disable X11 forwarding which causes .xauth access violations - # - 20041205 Armando Di Cianno <fafhrd@gentoo.org> - echo "newarglist.insert(1, '-oClearAllForwardings=yes')" \ - >> "${CVS_RSH}" - echo "newarglist.insert(1, '-oForwardX11=no')" \ - >> "${CVS_RSH}" - - # Handle SSH host key checking - - local CVS_ECLASS_KNOWN_HOSTS="${T}/cvs_ssh_known_hosts" - echo "newarglist.insert(1, '-oUserKnownHostsFile=${CVS_ECLASS_KNOWN_HOSTS}')" \ - >> "${CVS_RSH}" - - if [ -z "${ECVS_SSH_HOST_KEY}" ]; then - ewarn "Warning: The SSH host key of the remote server will not be verified." - einfo "A temporary known hosts list will be used." - local CVS_ECLASS_STRICT_HOST_CHECKING="no" - touch "${CVS_ECLASS_KNOWN_HOSTS}" - else - local CVS_ECLASS_STRICT_HOST_CHECKING="yes" - echo "${ECVS_SSH_HOST_KEY}" > "${CVS_ECLASS_KNOWN_HOSTS}" - fi - - echo -n "newarglist.insert(1, '-oStrictHostKeyChecking=" \ - >> "${CVS_RSH}" - echo "${CVS_ECLASS_STRICT_HOST_CHECKING}')" \ - >> "${CVS_RSH}" - echo "os.execv('/usr/bin/ssh', newarglist)" \ - >> "${CVS_RSH}" - - chmod a+x "${CVS_RSH}" - - # Make sure DISPLAY is set (SSH will not use SSH_ASKPASS - # if DISPLAY is not set) - - [ -z "${DISPLAY}" ] && DISPLAY="DISPLAY" - export DISPLAY - - # Create a dummy executable to echo $ECVS_PASS - - export SSH_ASKPASS="${T}/cvs_sshechopass" - if [ "${ECVS_AUTH}" != "no" ]; then - echo -en "#!/bin/bash\necho \"$ECVS_PASS\"\n" \ - > "${SSH_ASKPASS}" - else - echo -en "#!/bin/bash\nreturn\n" \ - > "${SSH_ASKPASS}" - - fi - chmod a+x "${SSH_ASKPASS}" - fi - - if [ "${mode}" == "update" ]; then - einfo "Running $cmdupdate" - eval $cmdupdate || die "cvs update command failed" - elif [ "${mode}" == "checkout" ]; then - einfo "Running $cmdcheckout" - eval $cmdcheckout|| die "cvs checkout command failed" - fi - - # Restore environment variable values - export CVS_RSH="${CVS_ECLASS_ORIG_CVS_RSH}" - if [ "${CVS_ECLASS_ORIG_SSH_ASKPASS+set}" == "set" ]; then - export SSH_ASKPASS="${CVS_ECLASS_ORIG_SSH_ASKPASS}" - else - unset SSH_ASKPASS - fi - - if [ "${CVS_ECLASS_ORIG_DISPLAY+set}" == "set" ]; then - export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}" - else - unset DISPLAY - fi - fi - - # Restore ownership. Not sure why this is needed, but someone - # added it in the orig ECVS_RUNAS stuff. - if [ -n "$ECVS_RUNAS" ]; then - chown `whoami` "${T}/cvspass" - fi - -} - -# @FUNCTION: cvs_src_unpack -# @DESCRIPTION: -# The cvs src_unpack function, which will be exported -cvs_src_unpack() { - - debug-print-function $FUNCNAME $* - - debug-print "$FUNCNAME: init: - ECVS_CVS_COMMAND=$ECVS_CVS_COMMAND - ECVS_UP_OPTS=$ECVS_UP_OPTS - ECVS_CO_OPTS=$ECVS_CO_OPTS - ECVS_TOP_DIR=$ECVS_TOP_DIR - ECVS_SERVER=$ECVS_SERVER - ECVS_USER=$ECVS_USER - ECVS_PASS=$ECVS_PASS - ECVS_MODULE=$ECVS_MODULE - ECVS_LOCAL=$ECVS_LOCAL - ECVS_RUNAS=$ECVS_RUNAS - ECVS_LOCALNAME=$ECVS_LOCALNAME - ECVS_CO_DIR=$ECVS_CO_DIR" - - [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue." - - [ -n "$ECVS_LOCALNAME" ] && [ -n "$ECVS_CO_DIR" ] && \ - die "ERROR: ECVS_LOCALNAME and ECVS_CO_DIR can't both be set." - - local ECVS_LOCALNAME="${ECVS_LOCALNAME}" - - if [ -z "$ECVS_LOCALNAME" ]; then - ECVS_LOCALNAME="$ECVS_MODULE" - fi - - local sanitized_pn=$(echo "${PN}" | LC_ALL=C sed -e 's:[^A-Za-z0-9_]:_:g') - local offline_pkg_var="ECVS_OFFLINE_${sanitized_pn}" - if [[ -n ${!offline_pkg_var}${ECVS_OFFLINE} ]] || [[ "$ECVS_SERVER" == "offline" ]] ; then - # We're not required to fetch anything; the module already - # exists and shouldn't be updated. - if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then - debug-print "$FUNCNAME: offline mode" - else - debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error" - die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting." - fi - elif [ -n "$ECVS_SERVER" ]; then # ECVS_SERVER!=offline --> real fetching mode - einfo "Fetching CVS module $ECVS_MODULE into $ECVS_TOP_DIR ..." - cvs_fetch - else # ECVS_SERVER not set - die "ERROR: CVS server not specified, cannot continue." - fi - - # After cheking out, test if ECVS_CO_DIR dir exists, if so, rename it to ECVS_LOCALNAME - if [ -n "$ECVS_CO_DIR" ] && [ -d "${ECVS_TOP_DIR}/${ECVS_CO_DIR}" ]; - then - mv "${ECVS_TOP_DIR}/${ECVS_CO_DIR}" "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" - fi - - einfo "Copying $ECVS_MODULE from $ECVS_TOP_DIR ..." - debug-print "Copying module $ECVS_MODULE local_mode=$ECVS_LOCAL from $ECVS_TOP_DIR ..." - - # This is probably redundant, but best to make sure. - mkdir -p "$WORKDIR/$ECVS_LOCALNAME" - - if [ -n "$ECVS_LOCAL" ]; then - cp -f "$ECVS_TOP_DIR/$ECVS_LOCALNAME"/* "$WORKDIR/$ECVS_LOCALNAME" - else - cp -Rf "$ECVS_TOP_DIR/$ECVS_LOCALNAME" "$WORKDIR/$ECVS_LOCALNAME/.." - fi - - # Not exactly perfect, but should be pretty close #333773 - export ECVS_VERSION=$(find "$ECVS_TOP_DIR/$ECVS_LOCALNAME/" -ipath '*/CVS/Entries' -exec cat {} + | sort | sha1sum | awk '{print $1}') - export ESCM_VERSION=${ECVS_VERSION} - - # If the directory is empty, remove it; empty directories cannot - # exist in cvs. This happens when, for example, kde-source - # requests module/doc/subdir which doesn't exist. Still create - # the empty directory in workdir though. - if [ "`ls -A \"${ECVS_TOP_DIR}/${ECVS_LOCALNAME}\"`" == "CVS" ]; then - debug-print "$FUNCNAME: removing empty CVS directory $ECVS_LOCALNAME" - rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" - fi - - # Implement some of base_src_unpack's functionality; note however - # that base.eclass may not have been inherited! - if [ -n "$PATCHES" ]; then - debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching" - cd "$S" - epatch ${PATCHES} - # Make sure we don't try to apply patches more than once, - # since cvs_src_unpack is usually called several times from - # e.g. kde-source_src_unpack - export PATCHES="" - fi - - einfo "CVS module ${ECVS_MODULE} is now in ${WORKDIR}" -} - -EXPORT_FUNCTIONS src_unpack diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest deleted file mode 100644 index c387ac7..0000000 --- a/sys-devel/binutils/Manifest +++ /dev/null @@ -1,6 +0,0 @@ -AUX binutils-2.20.1-loongson2f.patch 17738 RMD160 20c4d0e470865dc1acbc5673487a729c70ade63d SHA1 d9ac59f8b5d96d872ed8f7aba58400bde4c7e462 SHA256 1e9b2772e6297e27c0079ae76bed3de20c2e1b399a7e16d0a946525e1b290b7c -AUX binutils-mips-tls.patch 402 RMD160 4a1d8c9db6498d1f70e6329c18db2694d9a3d8ed SHA1 62a3716ce3800e23050856ddd69f258b278bea4c SHA256 060089a4e41184653c38cdf69fa4629361575355cd82a6cb207650d105266812 -DIST binutils-2.20.1-patches-1.1.tar.bz2 14913 RMD160 5a850d8ee3880153f614e9ef659ed4764f708538 SHA1 96900b1aab6c25b537be283102d8f44654cf0542 SHA256 aa92fc88cf1a96c88c010aa95ae788c3fd95300d93caf210301a5783266f9062 -DIST binutils-2.20.1.tar.bz2 17501436 RMD160 2ab2de504a85840d1ec227eff50b5f4d2cad581e SHA1 fd2ba806e6f3a55cee453cb25c86991b26a75dee SHA256 228b84722d87e88e7fdd36869e590e649ab523a0800a7d53df906498afe6f6f8 -EBUILD binutils-2.20.1-r1.ebuild 560 RMD160 8df550f3c8c8e2769ce3d12b9c631c2322057a20 SHA1 87c60d2249cf0667e5d97063518fb3ad03e66380 SHA256 3fe98fa1305502e605e3c5497348504ad188f993c72ec95f24243c8e9f985aa7 -EBUILD binutils-9999.ebuild 197 RMD160 a2ebbb25f80a8107a1a527dc8b3ae8868a1f2ac8 SHA1 cbfbc5a89f5d55d543adb613c0a953e90f23c5e4 SHA256 d56af21658dde3dc96847a041c28c4099534cde45b653c0f8d08979a521de61b diff --git a/sys-devel/binutils/binutils-2.20.1-r1.ebuild b/sys-devel/binutils/binutils-2.20.1-r1.ebuild deleted file mode 100644 index edb71e8..0000000 --- a/sys-devel/binutils/binutils-2.20.1-r1.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.20.1-r1.ebuild,v 1.1 2010/05/09 08:32:47 vapier Exp $ - -PATCHVER="1.1" -ELF2FLT_VER="" -inherit toolchain-binutils - -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" -src_unpack() { - toolchain-binutils_src_unpack - cd "${S}" - epatch ${FILESDIR}/${P}-loongson2f.patch - epatch ${FILESDIR}/${PN}-mips-tls.patch # need upstream verification -} diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild deleted file mode 100644 index ec92650..0000000 --- a/sys-devel/binutils/binutils-9999.ebuild +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header$ - -ELF2FLT_VER="" -ECVS_CO_DIR="src" - -inherit toolchain-binutils cvs - -KEYWORDS="" diff --git a/sys-devel/binutils/files/binutils-2.20.1-loongson2f.patch b/sys-devel/binutils/files/binutils-2.20.1-loongson2f.patch deleted file mode 100644 index ee5d517..0000000 --- a/sys-devel/binutils/files/binutils-2.20.1-loongson2f.patch +++ /dev/null @@ -1,505 +0,0 @@ -From 4f4447eb9b9f49cf87facbe4a15bc53973401add Mon Sep 17 00:00:00 2001 -From: Wu Zhangjin <wuzhangjin@gmail.com> -Date: Mon, 23 Nov 2009 15:13:15 +0800 -Subject: [PATCH] [PATCH] Fixups of Loongson2F - -(This v4 revision incorporates with the feedbacks from Richard - Sandiford, Zhang Fuxin, Maciej W. Rozycki, Alfred M. Szmidt and Yan - Hua, Thanks goes to them!) - -This patch adds two new options for binutils: -mfix-loongson2f-nop and --mfix-loongson2f-jump to work around the NOP and Jump instruction Issues of -Loongson2F. - --mfix-loongson2f-nop replaces the original NOP instructions by "or at,at,zero" -to work around the NOP issue. Without it, under extreme cases, cpu might -deadlock.(e.g. some have seen this with binutils 2.18, ld dies when compiling). - -The NOP issue has been solved in latest loongson2f batches, but this fix has no -side effect to them since the "or at,at,zero" is also a dummy instruction. - --mfix-loongson2f-jump inserts three instructions before the J,JR,JALR -instructions to eliminate instruction fetch from outside 256M region to work -around the JUMP instructions issue(only with some specific external chips, such -as CS5536.). Without it, under extreme cases, kernel may hang/crash with -unpredictable memory access. This fix may bring us with some potential -overhead. This issue has been solved in latest loongson2f batches. - -These two fixes are recommended when compiling kernel, but only the -first one is needed to compile applications. That's why I split them out -into two options, not just one -fix-loongson2f. More detailed -explanation about them are given by Zhang Fuxin(one of the Loongson2F -designers) as follows: - - - The NOP issue - -"The nature of the erratum is deeply related to the microarchitecture of -Loongson-2. It uses roughly a 4-way superscalar dynamically scheduled core, -instructions are excuted as much as possible in parallel with technics like -branch prediction etc. We use a 8-entry internal branch prediction queue to -keep track of each predicted branches, if some branches are proved to be -wrongly predicted, all the instructions following it will be cancelled,together -with the resources used by them, including the registers used for renaming, and -the queue entry will be freeed. There is a bug that might cause a hang when the -queue is full(some resources might been leaked due to conflict branch entries), -the workaround is to reduce the possiblity of branch queue full by using -renaming registers(they are also limited, can prevent too many simutaneos -branches). In theory this is still not enough to fully eliminate possible -hangs, but the possiblity is extremely low now and hard to be hit in real -code." - - - The JUMP instructions issue - -"The Loongson-2 series processors have quite complex micro-architecture, it will -try to execute instructions from the predicated branch of coming instruction -stream before they are confirmed to be run, if the predication of branch -direction is proved wrong later, the instructions will be cancelled, but if the -instructions is a read from memory, the read action might not be cancelled(but -the changes to register will) to enable some prefetch. This will lead to some -problems when compining with some chipsets. E.g. the AMD CS5536 used in -Yeeloong/Fuloong will hang if it gets an address in the physical address range -of 0x100000-0x200000(might be more other ranges). Speculative reads can perform -read at any address in theory(due to wrong prediction of branch directions and -the use of branch target buffer), thus in very few occasions they might cause a -hard lock of the machine. - -To prevent this, we need to prevent some addresses from entering branch -target buffers. A way to do this is that to modify all jump targets, e.g., - calulations of t9 - ... - jalr t9 => - calculations of t9 - or t9, t9, 0x80000000; // to make sure t9 is in kseg0 - jalr t9 -Of course, we have to consider 64/32bit, and modules addresses etc. - -This only need to be performed on kernel code, because only there we can have -accesses not translated/limited by TLB. For user code, it is impossible to -generate accesses to unwanted physical address. So it is safe. - -Also, to prevent addresses generated by user mode code to be used by the -kernel, we add a few empty jumps to flush the BTB upon entrance to kernel." - -2009-11-13 Wu Zhangjin <wuzhangjin@gmail.com>, Lemote Inc. - - gas/ - - * config/tc-mips.c (mips_fix_loongson2f, mips_fix_loongson2f_nop, - mips_fix_loongson2f_jump): New variables. - (md_longopts): Add New options -mfix-loongson2f-nop/jump, - -mno-fix-loongson2f-nop/jump. - (md_parse_option): Initialize variables via above options. - (options): New enums for the above options. - (md_begin): Initialize nop_insn from LOONGSON2F_NOP_INSN. - (fix_loongson2f, fix_loongson2f_nop, fix_loongson2f_jump): - New functions. - (append_insn): call fix_loongson2f(). - (mips_handle_align): Replace the implicit nops. - * config/tc-mips.h (MAX_MEM_FOR_RS_ALIGN_CODE): Modified - for the new mips_handle_align(). - * doc/c-mips.texi: Document the new options. - - gas/testsuite/ - - * gas/mips/loongson-2f-2.s: New test of -mfix-loongson2f-nop. - * gas/mips/loongson-2f-2.d: Likewise. - * gas/mips/loongson-2f-3.s: New test of -mfix-loongson2f-jump. - * gas/mips/loongson-2f-3.d: Likewise. - * gas/mips/mips.exp: Run the new tests. - - include/ - - * opcode/mips.h (LOONGSON2F_NOP_INSN): New macro. - -Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> ---- - gas/config/tc-mips.c | 119 +++++++++++++++++++++++++++++--- - gas/config/tc-mips.h | 2 +- - gas/doc/c-mips.texi | 13 ++++ - gas/testsuite/gas/mips/loongson-2f-2.d | 18 +++++ - gas/testsuite/gas/mips/loongson-2f-2.s | 10 +++ - gas/testsuite/gas/mips/loongson-2f-3.d | 35 +++++++++ - gas/testsuite/gas/mips/loongson-2f-3.s | 23 ++++++ - gas/testsuite/gas/mips/mips.exp | 2 + - include/opcode/mips.h | 4 + - 12 files changed, 245 insertions(+), 10 deletions(-) - create mode 100644 gas/testsuite/gas/mips/loongson-2f-2.d - create mode 100644 gas/testsuite/gas/mips/loongson-2f-2.s - create mode 100644 gas/testsuite/gas/mips/loongson-2f-3.d - create mode 100644 gas/testsuite/gas/mips/loongson-2f-3.s - -diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c -index 1c96480..a9991e2 100644 ---- a/gas/config/tc-mips.c -+++ b/gas/config/tc-mips.c -@@ -761,6 +761,15 @@ enum fix_vr4120_class { - NUM_FIX_VR4120_CLASSES - }; - -+/* ...likewise -mfix-loongson2f-jump. */ -+static int mips_fix_loongson2f_jump; -+ -+/* ...likewise -mfix-loongson2f-nop. */ -+static int mips_fix_loongson2f_nop; -+ -+/* True if -mfix-loongson2f-nop or -mfix-loongson2f-jump passed */ -+static int mips_fix_loongson2f; -+ - /* Given two FIX_VR4120_* values X and Y, bit Y of element X is set if - there must be at least one other instruction between an instruction - of type X and an instruction of type Y. */ -@@ -1918,6 +1927,8 @@ md_begin (void) - if (nop_insn.insn_mo == NULL && strcmp (name, "nop") == 0) - { - create_insn (&nop_insn, mips_opcodes + i); -+ if (mips_fix_loongson2f_nop) -+ nop_insn.insn_opcode = LOONGSON2F_NOP_INSN; - nop_insn.fixed_p = 1; - } - } -@@ -2731,6 +2742,53 @@ nops_for_insn_or_target (const struct mips_cl_insn *history, - return nops; - } - -+static void -+macro_build (expressionS *ep, const char *name, const char *fmt, ...); -+ -+static void fix_loongson2f_nop(struct mips_cl_insn *ip) -+{ -+ /* Fix NOP issue: Replace nops by "or at,at,zero" */ -+ if (strcmp(ip->insn_mo->name, "nop") == 0) -+ ip->insn_opcode = LOONGSON2F_NOP_INSN; -+} -+ -+static void fix_loongson2f_jump(struct mips_cl_insn *ip) -+{ -+ -+ /* Fix Jump Issue: Eliminate instruction fetch from outside 256M region -+ * jr target pc &= 'hffff_ffff_cfff_ffff -+ */ -+ if (strcmp(ip->insn_mo->name, "j") == 0 -+ || strcmp(ip->insn_mo->name, "jr") == 0 -+ || strcmp(ip->insn_mo->name, "jalr") == 0) -+ { -+ int sreg; -+ expressionS ep; -+ -+ if (! mips_opts.at) -+ return; -+ -+ sreg = EXTRACT_OPERAND (RS, *ip); -+ if (sreg == ZERO || sreg == KT0 || sreg == KT1 || sreg == ATREG) -+ return; -+ -+ ep.X_op = O_constant; -+ ep.X_add_number = 0xcfff0000; -+ macro_build (&ep, "lui", "t,u", ATREG, BFD_RELOC_HI16); -+ ep.X_add_number = 0xffff; -+ macro_build (&ep, "ori", "t,r,i", ATREG, ATREG, BFD_RELOC_LO16); -+ macro_build (NULL, "and", "d,v,t", sreg, sreg, ATREG); -+ } -+} -+ -+static void fix_loongson2f(struct mips_cl_insn *ip) -+{ -+ if (mips_fix_loongson2f_nop) -+ fix_loongson2f_nop(ip); -+ if (mips_fix_loongson2f_jump) -+ fix_loongson2f_jump(ip); -+} -+ - /* Output an instruction. IP is the instruction information. - ADDRESS_EXPR is an operand of the instruction to be used with - RELOC_TYPE. */ -@@ -2744,6 +2802,9 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, - bfd_boolean relaxed_branch = FALSE; - segment_info_type *si = seg_info (now_seg); - -+ if (mips_fix_loongson2f) -+ fix_loongson2f(ip); -+ - /* Mark instruction labels in mips16 mode. */ - mips16_mark_labels (); - -@@ -11220,6 +11281,10 @@ enum options - OPTION_MNO_7000_HILO_FIX, - OPTION_FIX_24K, - OPTION_NO_FIX_24K, -+ OPTION_FIX_LOONGSON2F_JUMP, -+ OPTION_NO_FIX_LOONGSON2F_JUMP, -+ OPTION_FIX_LOONGSON2F_NOP, -+ OPTION_NO_FIX_LOONGSON2F_NOP, - OPTION_FIX_VR4120, - OPTION_NO_FIX_VR4120, - OPTION_FIX_VR4130, -@@ -11308,6 +11373,10 @@ struct option md_longopts[] = - {"mfix7000", no_argument, NULL, OPTION_M7000_HILO_FIX}, - {"no-fix-7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX}, - {"mno-fix7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX}, -+ {"mfix-loongson2f-jump", no_argument, NULL, OPTION_FIX_LOONGSON2F_JUMP}, -+ {"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP}, -+ {"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP}, -+ {"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP}, - {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120}, - {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120}, - {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130}, -@@ -11575,6 +11644,22 @@ md_parse_option (int c, char *arg) - mips_fix_24k = 0; - break; - -+ case OPTION_FIX_LOONGSON2F_JUMP: -+ mips_fix_loongson2f_jump = 1; -+ break; -+ -+ case OPTION_NO_FIX_LOONGSON2F_JUMP: -+ mips_fix_loongson2f_jump = 0; -+ break; -+ -+ case OPTION_FIX_LOONGSON2F_NOP: -+ mips_fix_loongson2f_nop = 1; -+ break; -+ -+ case OPTION_NO_FIX_LOONGSON2F_NOP: -+ mips_fix_loongson2f_nop = 0; -+ break; -+ - case OPTION_FIX_VR4120: - mips_fix_vr4120 = 1; - break; -@@ -11789,6 +11874,8 @@ md_parse_option (int c, char *arg) - return 0; - } - -+ mips_fix_loongson2f = mips_fix_loongson2f_nop || mips_fix_loongson2f_jump; -+ - return 1; - } - -@@ -14794,6 +14881,8 @@ void - mips_handle_align (fragS *fragp) - { - char *p; -+ int bytes, size, excess; -+ valueT opcode; - - if (fragp->fr_type != rs_align_code) - return; -@@ -14801,17 +14890,27 @@ mips_handle_align (fragS *fragp) - p = fragp->fr_literal + fragp->fr_fix; - if (*p) - { -- int bytes; -+ opcode = mips16_nop_insn.insn_opcode; -+ size = 2; -+ } -+ else -+ { -+ opcode = nop_insn.insn_opcode; -+ size = 4; -+ } - -- bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; -- if (bytes & 1) -- { -- *p++ = 0; -- fragp->fr_fix++; -- } -- md_number_to_chars (p, mips16_nop_insn.insn_opcode, 2); -- fragp->fr_var = 2; -+ bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; -+ excess = bytes % size; -+ if (excess != 0) -+ { -+ /* If we're not inserting a whole number of instructions, pad the -+ end of the fixed part of the frag with zeros */ -+ memset (p, 0, excess); -+ p += excess; -+ fragp->fr_fix += excess; - } -+ md_number_to_chars (p, opcode, size); -+ fragp->fr_var = size; - } - - static void -@@ -15523,6 +15622,8 @@ MIPS options:\n\ - -mmt generate MT instructions\n\ - -mno-mt do not generate MT instructions\n")); - fprintf (stream, _("\ -+-mfix-loongson2f-jump work around Loongson2F JUMP instructions\ -+-mfix-loongson2f-nop work around Loongson2F NOP errata\n\ - -mfix-vr4120 work around certain VR4120 errata\n\ - -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\ - -mfix-24k insert a nop after ERET and DERET instructions\n\ -diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h -index 4bdf807..a0790c5 100644 ---- a/gas/config/tc-mips.h -+++ b/gas/config/tc-mips.h -@@ -59,7 +59,7 @@ extern char mips_nop_opcode (void); - extern void mips_handle_align (struct frag *); - #define HANDLE_ALIGN(fragp) mips_handle_align (fragp) - --#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2) -+#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4) - - struct insn_label_list; - struct mips_segment_info { -diff --git a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi -index 9ca7ebf..7b82dea 100644 ---- a/gas/doc/c-mips.texi -+++ b/gas/doc/c-mips.texi -@@ -172,6 +172,19 @@ This tells the assembler to accept MT instructions. - Cause nops to be inserted if the read of the destination register - of an mfhi or mflo instruction occurs in the following two instructions. - -+@item -mfix-loongson2f-jump -+@itemx -mno-fix-loongson2f-jump -+Eliminate instruction fetch from outside 256M region to work around the -+Loongson2F @samp{jump} instructions. Without it, under extreme cases, kernel -+may crash. The issue has been solved in latest processor batches, but this fix -+has no side effect to them. -+ -+@item -mfix-loongson2f-nop -+@itemx -mno-fix-loongson2f-nop -+Replace nops by @code{or at,at,zero} to work around the Loongson2F @samp{nop} -+errata. Without it, under extreme cases, cpu might deadlock. The issue has been -+solved in latest loongson2f batches, but this fix has no side effect to them. -+ - @item -mfix-vr4120 - @itemx -no-mfix-vr4120 - Insert nops to work around certain VR4120 errata. This option is -diff --git a/gas/testsuite/gas/mips/loongson-2f-2.d b/gas/testsuite/gas/mips/loongson-2f-2.d -new file mode 100644 -index 0000000..f5267a8 ---- /dev/null -+++ b/gas/testsuite/gas/mips/loongson-2f-2.d -@@ -0,0 +1,18 @@ -+#as: -mfix-loongson2f-nop -+#objdump: -M reg-names=numeric -dr -+#name: ST Microelectronics Loongson-2F workarounds of nop issue -+ -+.*: file format .* -+ -+ -+Disassembly of section .text: -+ -+00000000 <loongson2f_nop_insn>: -+ 0: 00200825 move \$1,\$1 -+ 4: 00200825 move \$1,\$1 -+ 8: 00200825 move \$1,\$1 -+ c: 00200825 move \$1,\$1 -+ 10: 00200825 move \$1,\$1 -+ 14: 00200825 move \$1,\$1 -+ 18: 00200825 move \$1,\$1 -+ 1c: 00200825 move \$1,\$1 -diff --git a/gas/testsuite/gas/mips/loongson-2f-2.s b/gas/testsuite/gas/mips/loongson-2f-2.s -new file mode 100644 -index 0000000..842e157 ---- /dev/null -+++ b/gas/testsuite/gas/mips/loongson-2f-2.s -@@ -0,0 +1,10 @@ -+# Test the work around of the NOP issue of loongson2F -+ .text -+ .set noreorder -+ -+ .align 5 # Test _implicit_ nops -+loongson2f_nop_insn: -+ nop # Test _explicit_ nops -+ -+# align section end to 16-byte boundary for easier testing on multiple targets -+ .p2align 4 -diff --git a/gas/testsuite/gas/mips/loongson-2f-3.d b/gas/testsuite/gas/mips/loongson-2f-3.d -new file mode 100644 -index 0000000..99844d3 ---- /dev/null -+++ b/gas/testsuite/gas/mips/loongson-2f-3.d -@@ -0,0 +1,35 @@ -+#as: -mfix-loongson2f-jump -+#objdump: -M reg-names=numeric -dr -+#name: ST Microelectronics Loongson-2F workarounds of Jump Instruction issue -+ -+.*: file format .* -+ -+ -+Disassembly of section .text: -+ -+00000000 <.text>: -+ 0: 3c01cfff lui \$1,0xcfff -+ 4: 3421ffff ori \$1,\$1,0xffff -+ 8: 03c1f024 and \$30,\$30,\$1 -+ c: 03c00008 jr \$30 -+ 10: 00000000 nop -+ -+ 14: 3c01cfff lui \$1,0xcfff -+ 18: 3421ffff ori \$1,\$1,0xffff -+ 1c: 03e1f824 and \$31,\$31,\$1 -+ 20: 03e00008 jr \$31 -+ 24: 00000000 nop -+ -+ 28: 3c01cfff lui \$1,0xcfff -+ 2c: 3421ffff ori \$1,\$1,0xffff -+ 30: 03c1f024 and \$30,\$30,\$1 -+ 34: 03c0f809 jalr \$30 -+ 38: 00000000 nop -+ -+ 3c: 00200008 jr \$1 -+ 40: 00000000 nop -+ -+ 44: 08000000 j 0x0 -+ 44: R_MIPS_26 external_label -+ 48: 00000000 nop -+ 4c: 00000000 nop -diff --git a/gas/testsuite/gas/mips/loongson-2f-3.s b/gas/testsuite/gas/mips/loongson-2f-3.s -new file mode 100644 -index 0000000..cbb73de ---- /dev/null -+++ b/gas/testsuite/gas/mips/loongson-2f-3.s -@@ -0,0 +1,23 @@ -+# Test the work around of the Jump instruction Issue of Loongson2F -+ .text -+ .set noreorder -+ -+ j $30 # j with register -+ nop -+ -+ jr $31 # jr -+ nop -+ -+ jalr $30 # jalr -+ nop -+ -+ .set noat -+ jr $1 # jr with at register and .set annotation -+ nop -+ .set at -+ -+ j external_label # j with label -+ nop -+ -+# align section end to 16-byte boundary for easier testing on multiple targets -+ .p2align 4 -diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp -index 6f82f46..92fa13d 100644 ---- a/gas/testsuite/gas/mips/mips.exp -+++ b/gas/testsuite/gas/mips/mips.exp -@@ -789,6 +789,8 @@ if { [istarget mips*-*-vxworks*] } { - - run_dump_test "loongson-2e" - run_dump_test "loongson-2f" -+ run_dump_test "loongson-2f-2" -+ run_dump_test "loongson-2f-3" - - run_dump_test_arches "octeon" [mips_arch_list_matching octeon] - run_list_test_arches "octeon-ill" "" \ -diff --git a/include/opcode/mips.h b/include/opcode/mips.h -index 27d10e6..671c6ef 100644 ---- a/include/opcode/mips.h -+++ b/include/opcode/mips.h -@@ -1106,4 +1106,8 @@ extern int bfd_mips_num_opcodes; - extern const struct mips_opcode mips16_opcodes[]; - extern const int bfd_mips16_num_opcodes; - -+/* Replace the original nops by "or at,at,zero", -+ Used to implement -mfix-loongson2f */ -+#define LOONGSON2F_NOP_INSN 0x00200825 -+ - #endif /* _MIPS_H_ */ diff --git a/sys-devel/binutils/files/binutils-mips-tls.patch b/sys-devel/binutils/files/binutils-mips-tls.patch deleted file mode 100644 index c58cdcf..0000000 --- a/sys-devel/binutils/files/binutils-mips-tls.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- bfd/elfxx-mips.c.orig 2010-09-04 14:21:35.000000000 +0800 -+++ bfd/elfxx-mips.c 2010-09-04 14:22:14.000000000 +0800 -@@ -2772,7 +2772,7 @@ - = (struct mips_elf_link_hash_entry *) arg1; - struct mips_elf_count_tls_arg *arg = arg2; - -- if (hm->tls_type & GOT_TLS_GD) -+ if (hm->tls_type & (GOT_TLS_GD | GOT_TLS_LDM)) - arg->needed += 2; - if (hm->tls_type & GOT_TLS_IE) - arg->needed += 1; |