Review Request: 8008451: Make mac builds on 10.8 work on 10.7 (original) (raw)

Tao Mao tao.mao at oracle.com
Thu Feb 21 23:48:21 UTC 2013


Please reply to this thread to make sure all interested parties can see it. Tao

On 2/20/2013 11:53 AM, John Coomes wrote:

Erik Joelsson (erik.joelsson at oracle.com) wrote:

I was wrong, just setting the macros below did not generate 10.7 compatible bits when built on 10.8. Since I already pushed the old solution (except for hotspot), I created a new bug. Here is a new set of patches, combining -DMACOSXVERSIONMAXALLOWED=1070 and -mmacosx-version-min=10.7.0 and also setting the latter on the link command line. This combination both generates compatible binaries and treats newer API calls as errors, all verified.

Sine the two parameters take their argument in different formats, the handling of defaults is a bit more complicated. The variable being sent around and that you can override on the command line is now MACOSXVERSIONMIN=10.7.0, matching the parameter to the compiler/linker. It would be good if someone from hotspot could review the hotspot changes. http://cr.openjdk.java.net/~erikj/8008451/webrev.hotspot.01/ The hotspot changes look good to me. -John http://cr.openjdk.java.net/~erikj/8008451/webrev.root.01/ http://cr.openjdk.java.net/~erikj/8008451/webrev.jdk.01/ /Erik On 2013-02-15 10:49, Erik Joelsson wrote:

On 2013-02-15 09:43, Erik Joelsson wrote: On 2013-02-14 18:04, David DeHaven wrote: Here are a series of patches that adds the following to all native compile lines on macosx:

-DMACOSXVERSIONMAXALLOWED=1070 -DMACOSXVERSIONMINREQUIRED=1070 I know I'm not a reviewer, but I have an opinion anyways :) Using "-mmacosx-version-min=10.7" seems more appropriate for the latter, this is passed to the linker as well which I believe sets version information in the Mach-O headers (in the form of a load command) to prevent it from being loaded on older systems. The MINREQUIRED macro is set to a value that matches what's passed to the -mmacosx-version-min argument, so it doesn't need to be provided.

The effect of the -mmacosx-version-min=10.7 when sent to the linker is to make any calls to newer APIs "softlinked". This means the library will still load fine on the older OS, but the application is responsible for only actually making the newer calls if they are available. This is a good feature if you knowingly want to support multiple versions of the OS and still use features in the newer OS when available. I do not believe we have the need for that and if we ever do, then these parameters will need to change. It's true -mmacosx-version-min= also sets the macro MACOSXVERSIONMINREQUIRED=, but I see no gain in changing just one of them to something else just because it works. The format of the parameter is also different (10.7 vs 1070) which would require us to add logic for converting between the two. /Erik



More information about the build-dev mailing list