[MacPorts] #62278: libgcrypt @1.9.1_0 broken on SnowLeopard (was: libgcrypt 1.9.1_0 broken on SnowLeopard)

MacPorts noreply at macports.org
Sat Feb 13 06:31:56 UTC 2021


#62278: libgcrypt @1.9.1_0 broken on SnowLeopard
-------------------------+-------------------------
  Reporter:  grumpybozo  |      Owner:  Schamschula
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.4
Resolution:              |   Keywords:  haspatch
      Port:  libgcrypt   |
-------------------------+-------------------------
Changes (by ryandesign):

 * cc: Schamschula (removed)
 * status:  new => assigned
 * owner:  (none) => Schamschula


Comment:

 I don't agree with the fix.

 There's nothing special about OS X 10.11 in the context of this problem
 and there's no reason for it to be singled out in the code.

 [https://opensource.apple.com/source/xnu/xnu-3789.21.4/bsd/man/man2/getentropy.2.auto.html
 getentropy appeared in macOS 10.12]. That means it's in the 10.12 SDK.

 If you build with e.g. the 10.12 SDK but with a deployment target set for
 an earlier OS version, then any symbols introduced in 10.12 will appear as
 weak symbols and it is the program's responsibility to check at runtime
 whether or not the symbol exists before using it.

 That's how Apple's SDKs work. It's not specific to `getentropy` or 10.11
 or 10.12.

 It just so happens that the last version of Xcode that is compatible with
 OS X 10.11 is Xcode 8.2.1 and it contains only the 10.12 SDK.

 This is standard operating procedure for Apple. The last version of Xcode
 compatible with any macOS version typically includes the ''next'' macOS
 version's SDK.

 And of course if you're compiling on 10.11 you'll want to run the result
 on 10.11 so you'll have set the deployment target to 10.11. (That is in
 fact its default value when you are on 10.11.)

 So if you are compiling on 10.11 with Xcode 8.2.1 (or any earlier 8.x)
 you'll be using the 10.12 SDK and `getentropy` will be available as a weak
 symbol. The same would happen if you compile on 10.12 or later but set the
 deployment target to 10.11 or earlier.

 But if you are compiling on 10.11 with Xcode 7.x then you'll be using the
 10.11 SDK and `getentropy` will not be available at all.

 The MacPorts buildbot worker for OS X 10.11 happens to be using Xcode
 8.2.1 and thus the 10.12 SDK. On most of the other buildbot workers, I've
 deliberately not upgraded Xcode to the latest major version specifically
 so that we keep an SDK version that matches the OS version in order to
 avoid this class of problem.

-- 
Ticket URL: <https://trac.macports.org/ticket/62278#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list