How to Apply a GCC Patch
Asked Answered
B

2

7

I'm trying to apply this patch to GCC on MinGW to get it to compile GDC 2, but I don't know how. (I'm still new to the internals of GCC, and even to *nix tools in general.) I know there's the patch command but I can't figure out how to use it, and I don't even know if I have enough information for this.

How do I apply the patch for GCC?

Berzelius answered 4/3, 2011 at 2:41 Comment(0)
D
3

By default GNU Patch can be used by feeding a patch file to it from stdin (console input), e.g.:

patch < file.patch

There are many switches and options patch can use, the functionality is described here:

http://www.rtr.com/winpak/Documentation/patch.htm

http://www.gnu.org/software/diffutils/manual/html_mono/diff.html#Invoking%20patch

patch and diff work hand in hand. A small demonstration is found on wikipedia.

Demark answered 5/3, 2011 at 13:47 Comment(0)
W
1

Take a look at the patch manual pages. Just type man patch in a terminal window... typically i think you want to do a patch -p0 -i your_file.diff.

Wormhole answered 4/3, 2011 at 2:46 Comment(4)
Unfortunately this is MinGW (on Windows), and there's no man command; I looked at patch --help but I didn't figure out how to use it. (By the way, do I need a patch file or a diff file, or both? I only have the former.)Berzelius
@Mehrdad Sorry probably the .diff extension mislead you :). The patch file is the output of the diff command. It's a text file. The patch command will apply the patch file to your local files. Maybe you can just do patch < patch_file_name too... I'm not sure since I can't really test it out here.Wormhole
I tried that too, it didn't work. I feel like I'm missing an important file (or files)...Berzelius
@Mehrdad OK. Sorry I really don't know MinGW. As you might imagine, it's hard to tell from my end if you're missing anything :(.Wormhole

© 2022 - 2024 — McMap. All rights reserved.