Contents|Index|Previous|Next

# Patching

After a problem report (PR) has been submitted to Cygnus Solutions, and the corrective source code has been written and tested; the old and new contents of the source directory are compared using the Unix ‘diff’ command. The output is sent out as a “patch.”

To apply the patch to your source code, you will need to cd into the src directory. The full default pathname is ‘/usr/cygnus/release_name/src’.

‘release_name’ should be replaced with ‘progressive-97r1’. For custom supported toolchains, the target-specific ‘release_name’ will be supplied. Save the patch as a file, e.g. ‘/tmp/patch’, and run the patch program with the following command.

patch -p < /tmp/patch

You do not need to edit out all the non-patch text from the file, ‘/tmp/patch’. The patch program will recognize where the real patch begins.

Do not cut-and-paste the patch with a windowing system like X; tab characters are important and they are usually not preserved correctly when cut-and-pasting is used.

See “Invoking Patch” and “Options to patch” in Comparing and Merging Files in GNUPro Advanced Topics. This information is also available using the info program for online help information.

If the patch is rejected, there will be a filename ending in ‘.rej’ in your source code. For instance, if the patch was against the file ‘gcc/reload.c’, and the patch was rejected, the rejection would be called ‘gcc/reload.c.rej’. Although it will take a while to run, you can search all files for a rejected patch with the following command.

find . -name ‘*.rej’ -print