Review Request: 8008451: Make mac builds on 10.8 work on 10.7

Erik Joelsson erik.joelsson at oracle.com
Wed Feb 20 14:52:44 UTC 2013


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 -DMAC_OS_X_VERSION_MAX_ALLOWED=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 
MACOSX_VERSION_MIN=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/
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:
>>>>
>>>> -DMAC_OS_X_VERSION_MAX_ALLOWED=1070 
>>>> -DMAC_OS_X_VERSION_MIN_REQUIRED=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 
>>> MIN_REQUIRED 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 
> MAC_OS_X_VERSION_MIN_REQUIRED=, 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