Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  

Can't build IOGraphics-373.2 due to errors

2 posts in this topic

Recommended Posts

Topic title and description says it all. I need help to fix the 100 errors in order to build IOGraphics-330.


There are 67 errors in IOGraphicsFamily alone. Some of them conversion stuff (absolute time) but most of them seem to be caused by missing header (links) and/or frameworks. How do I fix this?


Any developers in here willing to help?





Share this post

Link to post
Share on other sites

Maybe This will help you


I found it here:


Figure that some other ppl may also encounter such compilation problems, I decide to share my experience here.
The last time I do the compilation was a couple years ago and not much can be remembered. So I downloaded the source code from apple's site and try to compile it again today.

My system is still in 10.6.3, so I downloaded the corresponding IOGraphicsFamily package. A initial compilation produced all kinds of errors and warnings including the one you mentioned. So I need to check each of them and fix it.

From my past experience, it is an fact that those header files are really missing in our system's framework folder where the compiler is trying to search. But these files actually have a copy in the IOGraphicsFamily project itself. To solve the problem, simply copy them to the system path. Open a terminal, cd to the project directory and do below things:
cd IOGraphicsFamily
sudo cp ./IOKit/graphics/*.h /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/graphics/
sudo cp ./IOKit/i2c/*.h /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/i2c/

Here, I not only copied the missing header files, also overwrote those already existing header files. I only find out that I need do this after I encounter a lot errors without a clue and finally it turns out that these existing header files are not updated to correct version by Mac OSX's system update at all.

That's all header files from the package itself. There is another missing header file, IOHibernatePrivate.h, which can not be found here. I googled and get it from apple's xnu source:
Here, xnu-1504.3.12 is the version for 10.6.3. You should check your version by typing "uname -a" in terminal.
So copy it to system path as well. Since I downloaded it to my Desktop, I type:
sudo cp ~/Desktop/IOHibernatePrivate.h /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/

All missing header file problems should be solved. Now check other errors.

A bunch of errors can be solved by editing IOKit/graphics/IOGraphicsPrivate.h:

1. comment out the line: extern "C" ppnum_t pmap_find_phys(pmap_t map, addr64_t va);

2. Add another include file: #include <kern/thread_call.h>

3. Add below declarations:
__OSAbsoluteTime(AbsoluteTime	abstime)
return (*(uint64_t *)&abstime);

#define AbsoluteTime_to_scalar(x)	(*(uint64_t *)(x))


#define AsUInt64(x)	 (x)


static inline const UInt64& AsUInt64(const AbsoluteTime& rhs)
return reinterpret_cast<const uint64_t&>(rhs);

static inline UInt64& AsUInt64(AbsoluteTime& rhs)
return reinterpret_cast<uint64_t&>(rhs);

static inline void absolutetime_to_nanoseconds(const AbsoluteTime& abs, UInt64* ns)
absolutetime_to_nanoseconds(AsUInt64(abs), ns);

static inline void nanoseconds_to_absolutetime(UInt64 ns, AbsoluteTime* abs)
nanoseconds_to_absolutetime(ns, reinterpret_cast<uint64_t*>(abs));

static inline void clock_get_uptime(AbsoluteTime* abs)

static inline void clock_interval_to_deadline(uint32_t interval, uint32_t scale_factor, AbsoluteTime* result)
clock_interval_to_deadline(interval, scale_factor, reinterpret_cast<uint64_t*>(result));

static inline void clock_interval_to_absolutetime_interval(uint32_t interval, uint32_t scale_factor, AbsoluteTime* result)
clock_interval_to_absolutetime_interval(interval, scale_factor, reinterpret_cast<uint64_t*>(result));

static inline void clock_delay_until(const AbsoluteTime& deadline)
static inline boolean_t	thread_call_enter1_delayed(thread_call_t call, thread_call_param_t param1, const AbsoluteTime& deadline)
return thread_call_enter1_delayed(call, param1, AsUInt64(deadline));

static inline void ADD_ABSOLUTETIME(AbsoluteTime* time, const AbsoluteTime* offset)
*reinterpret_cast<uint64_t*>(time) += *reinterpret_cast<const uint64_t*>(offset);

static inline void SUB_ABSOLUTETIME(AbsoluteTime* time, const AbsoluteTime* offset)
*reinterpret_cast<uint64_t*>(time) -= *reinterpret_cast<const uint64_t*>(offset);

static inline int64_t CMP_ABSOLUTETIME(const AbsoluteTime* lhs, const AbsoluteTime* rhs)
return (*reinterpret_cast<const uint64_t*>(lhs) - *reinterpret_cast<const uint64_t*>(rhs));


After editing, copy it again to the system path:
sudo cp ./IOKit/graphics/IOGraphicsPrivate.h /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/graphics/

There is still a problem related to "clock_delay_until". I can solve it the same way as shown in above code with the part that is commented out, but that will produce another error where the function clock_delay_until is referenced (it's confused when there are 2 overloaded versions of the function clock_delay_until). I did not figure out an elegant way to solve this. What I did is to edit IOFramebuffer.cpp, change the line:

Finally, there is an undefined function: vm_map_wire
I googled and find its declaration:
void vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end,
vm_prot_t access_type, boolean_t user_wire);
Since it's one of the low-level VM map API of the system, it should exist somewhere in the kernel already. So I simply add the declaration right before the function where vm_map_wire is used:
extern "C" {
void vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end,
vm_prot_t access_type, boolean_t user_wire);
After all these editing, the target "IOGraphicsFamily" compiled without errors, but still produced a lot of warnings. I checked them and don't think those are big problems.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Recent Status Updates

    • Bios-PC  »  MaLd0n

      Hi MaLd0n
      you helped me with dsdt and everything working fine .
      I fix the audio issue.
      I need to add wifi bcm4360 original apple to dsdt to be  en0 all the time 
      also to add it to pci list.
      and I change from gtx970 to AMD radeon pro rx580 and I have issue with vtencoderxpcservice that make my cpu 300% and high temperature . with Nvidia it doesn't happen.
      I search the internet days and night and try to fix this issue no luck.
      best regards
      · 0 replies
    • DynaFEX  »  MaLd0n

      Hi MaLd0n!!
      I just don't know what the hell to do with this issue and I was wondering if you might please have any ideas??
      Sorry to bother you and thanks for all your help!
      · 0 replies
    • mrjayviper  »  e97

      hello. Can you please share instructions and files to get OSX working on a dual 2011 setup? you included a link to sixflow but it's not loading anymore. Thanks
      · 0 replies
    • adamfox

      I added a video to a @YouTube playlist https://t.co/EXJucl9T8B Go the distance sung by Adam Fox karaoke cover Disney Hurculese
      · 0 replies
    • Mr. Xtreme

      Hey, I'm not dead, I've moved over to using the nickname "Mr. Xtreme", and mostly use Linux distros/Windows 10, though it seems I'm gonna have to hackintosh again, so, hey everyone who remembers me! :wave:
      · 0 replies