make fails while installing Valgrind

后端 未结 4 471
鱼传尺愫
鱼传尺愫 2020-12-06 00:02

I\'m trying to install Valgrind on a Mac with Snow Leopard but am getting an error. This is what I\'m typing into Terminal.

$ curl -O http://valgrind.org/do         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-06 00:20

    Ever since the System Integrity Protection system was put in place on OSX, the user, not even as root, can modify /usr. Thus, modifying /usr/include/mach to add the necessary files becomes impossible. The only alternative is now to edit the makefile itself.

    The Makefile at hand should be located at coregrind/Makefile, and the mach files should be located near /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/ (replace MacOSX10.12.sdk with the appropriate version of OSX).

    There should be a symbol named am__append_17 defined around line 160 or so (might be elsewhere for different versions).

    It should look something like this:

    am__append_17 = \
        /usr/include/mach/mach_vm.defs \
        /usr/include/mach/task.defs \
        /usr/include/mach/thread_act.defs \
        /usr/include/mach/vm_map.defs
    

    Replace each instance of /usr/include with /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/, so that it looks like:

    am__append_17 = \
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/mach/mach_vm.defs \
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/mach/task.defs \
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/mach/thread_act.defs \
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/mach/vm_map.defs
    

    After this, valgrind should compile properly

提交回复
热议问题