Bug 396475

Summary: [PATCH] valgrind OS-X build: config.h not found
Product: [Developer tools] valgrind Reporter: Rob Boehne <rboehne>
Component: generalAssignee: Rhys Kidd <rhyskidd>
Status: RESOLVED FIXED    
Severity: normal CC: rboehne, rhyskidd
Priority: NOR    
Version First Reported In: 3.14 SVN   
Target Milestone: ---   
Platform: Compiled Sources   
OS: macOS   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Add -I$(top_builddir) to the special rule for fixup_macho_loadcmds.c

Description Rob Boehne 2018-07-13 14:50:22 UTC
Created attachment 113917 [details]
Add -I$(top_builddir) to the special rule for fixup_macho_loadcmds.c

Under OS X, the git sources as of July 13, 2018 can't be build outside the source directory.  This is because and include path to the "build" directory isn't specified in the special rule for one file.


Making all in coregrind
(cd m_mach && mig /usr/include/mach/mach_vm.defs /usr/include/mach/task.defs /usr/include/mach/thread_act.defs /usr/include/mach/vm_map.defs)
gcc -I../../../../valgrind -I../../../../valgrind -I../../../../valgrind/include -I../include -I../../../../valgrind/VEX/pub -I../VEX/pub -DVGA_amd64=1 -DVGO_darwin=1 -DVGP_amd64_darwin=1 -DVGPV_amd64_darwin_vanilla=1  -I../../../../valgrind/coregrind -DVG_LIBDIR="\"/opt/valgrind-3.14.GIT/lib/valgrind"\" -DVG_PLATFORM="\"amd64-darwin\"" -g -Wall -o fixup_macho_loadcmds ../../../../valgrind/coregrind/fixup_macho_loadcmds.c
../../../../valgrind/coregrind/fixup_macho_loadcmds.c:121:10: fatal error: 'config.h' file not found
#include "config.h"
         ^
1 error generated.
gnumake[2]: *** [fixup_macho_loadcmds] Error 1
gnumake[1]: *** [all-recursive] Error 1
gnumake: *** [all] Error 2

Patch attached.
Comment 1 Rhys Kidd 2018-08-19 18:38:56 UTC
Thanks Rob for the report and the patch. Included in Valgrind Git master.