[SERVER-29516] Tools build on OS X needs to set -mmacosx-version-min in CGO_{C,LD}FLAGS Created: 05/Jun/17  Updated: 30/Oct/23  Resolved: 09/Jun/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.16, 3.2.15, 3.4.6, 3.5.9

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4, v3.2, v3.0
Sprint: Platforms 2017-06-19
Participants:

 Description   

The OS X system on which the go tools are built may be newer than the intended minimum supported OS X version that we intend to support. Currently:

  • 3.0, 3.2, and 3.4 target 10.7, and are built on 10.10
  • master targets 10.10, and is built on 10.10

However, we are about to upgrade the macOS builders to 10.12, at which point things will look like:

  • 3.0, 3.2, and 3.4 target 10.7, and are built on 10.12
  • master targets 10.10, and targets 10.12

To ensure that the C++ server works correctly on the older systems, even though it is built on the newer ones, we arrange for the flag -mmacosx-version-min=10.x to be provided to all C and C++ compile and link steps.

However, we are not doing this for any binaries compiled by cgo as part of building the tools. As a result, the tools as built on the newer systems may not run correctly on the older systems we intend to support.

The most likely solution is that we need to add -mmacosx-version-min=something to CGO_CFLAGS (and the associated link flag?) across the v3.0, v3.2, v3.4, and master branches.

Also, as pointed out by gabriel.russell, there were some syscall related changes that may intersect this issue, and might constrain our actual target minima for the tools differently than they are constrained for the server component. We should investigate this situation as part of undertaking this work.



 Comments   
Comment by Githook User [ 09/Jun/17 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-29516 Specify target OS minimum for go tools build

(cherry picked from commit db55e668d87d66b171c310241bdbcabfa790e2cf)
Branch: v3.4
https://github.com/mongodb/mongo/commit/7af9a88227ee3d59ec32878253cda784cbf6b6a5

Comment by Githook User [ 09/Jun/17 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-29516 Specify target OS minimum for go tools build

(cherry picked from commit db55e668d87d66b171c310241bdbcabfa790e2cf)
Branch: v3.2
https://github.com/mongodb/mongo/commit/67b904ff0404ac247b8ed9e8076057fb6dbf5391

Comment by Githook User [ 09/Jun/17 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-29516 Specify target OS minimum for go tools build

(cherry picked from commit db55e668d87d66b171c310241bdbcabfa790e2cf)
Branch: v3.0
https://github.com/mongodb/mongo/commit/55552c72286203c8280da91395c46b29c6535009

Comment by Githook User [ 09/Jun/17 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-29516 Specify target OS minimum for go tools build
Branch: master
https://github.com/mongodb/mongo/commit/db55e668d87d66b171c310241bdbcabfa790e2cf

Comment by Andrew Morrow (Inactive) [ 05/Jun/17 ]

FYI this probably needs to be set in CGO_LDFLAGS as well, though I'm not 100% sure about that, since I don't know as much about go's linking model.

Comment by William Banfield [ 05/Jun/17 ]

Research needs to be done here to determine what go's compatibility is across different versions of macOS.

Generated at Thu Feb 08 04:21:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.