Compiling on Tiger and running the binary on Leopard causes vm_map() to fail
Hi, JavaScriptCore uses some compile-time defines to decide which flags to pass to vm_map() and mmap(), depending on the Mac OS version. Now, if WebKit is built and run on the same version, that's obviously fine, but we've found that if we build on Tiger but run on Leopard, the vm_map() call fails. Similarly, mmap() fails if we build on Leopard but run on Tiger. This case can be made to work by defining BUILDING_ON_TIGER even when building on Leopard, but that doesn't feel too good... Can/should the decision of which flags to pass be made at runtime instead? Regards, Kent
On Sep 10, 2009, at 9:04 AM, Kent Hansen wrote:
JavaScriptCore uses some compile-time defines to decide which flags to pass to vm_map() and mmap(), depending on the Mac OS version. Now, if WebKit is built and run on the same version, that's obviously fine, but we've found that if we build on Tiger but run on Leopard, the vm_map() call fails.
That's right. There are many places where WebKit makes compile time assumptions about Tiger vs. Leopard vs. Snow Leopard.
Can/should the decision of which flags to pass be made at runtime instead?
This is only one of the many different places you'll have to add more logic and runtime checks to WebKit if you want to build a single binary that works well on Tiger, Leopard, and Snow Leopard. Doing that project will be quite challenging! Adding runtime checks would be OK, but the main version of WebKit, built for Mac OS X, should not have such runtime checks. So you'll have to figure out an appropriate way to do the #if so that we don't add unnecessary runtime overhead to the standard Mac OS X WebKit. -- Darin
participants (2)
-
Darin Adler
-
Kent Hansen