Skip to content

Home

David Grayson edited this page Dec 11, 2013 · 31 revisions
Clone this wiki locally

Table of Contents

What is this?

This project is a version of GNU Make 3.82 that has been modified to fix a few bugs that mainly affect users of Microsoft Windows. We call this version "GNU Make 3.82-pololu2". It was originally created to support users of the Pololu Wixel, but it is full-featured and suitable for anyone. Windows users can download a precompiled make.exe binary in the download section.

This project is based on the official GNU Make 3.82 source distribution.

Advantage over the official GNU Make 3.82

The official version of GNU Make 3.82 has a bug that causes it to crash and display an error message like this:

make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x425073)
This problem only occurs if the official GNU Make tries to execute a command that requires use of the shell (for example "a && b") and the shell detected by Make has parentheses in its path. This is a problem for Windows users because various programs such as MsysGit install a copy of sh.exe inside the "Program Files (x86)" folder and put it on the PATH. The official GNU Make will detect that copy of sh.exe, try to use it as the shell, and crash. We fixed this bug in Make 3.82-pololu1. We have submitted a patch (#7522) to fix this issue in the offical version of Make. A maintainer of Make acknowledged it and made a similar change so this bug should be gone in Make 4.0.

The official version of GNU Make 3.82 has another bug that occurs whenever it parses a list of prerequisite names and one of the names contains a parenthesis. For example, if your Makefile consisted of the single line "a : b(c" this bug could affect you. The bug causes Make to read past the end of a string into unallocated memory. Sometimes this causes an Access Violation crash and sometimes this causes other symptoms. The bug was fixed in the Make CVS repository in August 2010, but there has been no official release of GNU Make since then. We fixed this bug in Make 3.82-pololu2.

How to build Make in Windows

  1. Install MinGW.
  2. Download the pololu/make source code from GitHub.
  3. Run "build_w32.bat gcc release" at a Command Prompt in the source directory. If this completes without errors, the result will be a file named gnumake.exe.

How to debug Make in Windows with GDB

  1. After following the instructions above to install the prerequisites, run "build_w32.bat gcc debug" at a Command Prompt in the source directory. If this completes without errors, the result will be a file named gnumake.exe.
  2. If you need to, copy gnumake.exe to a directory that is on your PATH.
  3. Go to the appropriate directory to reproduce the problem you are having.
  4. Run 'gdb gnumake'.
  5. At the gdb prompt, type "run".
  6. If make crashes, you will see a message like "Program received signal SIGSEGV, Segmentation fault."
  7. At the gdb prompt, type "where". This command will show you the call stack when the command occurred.
  8. At the gdb prompt, you can type "help" to get information about more commands.
Something went wrong with that request. Please try again.