Fix build on macOS 10.15 Catalina + xcode 11 (#14820)
commit181a602acee3bcc1ac529ff41c254f794052ca71
authorEgor Bogatov <egorbo@gmail.com>
Wed, 5 Jun 2019 22:39:05 +0000 (6 01:39 +0300)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 5 Jun 2019 22:39:04 +0000 (6 00:39 +0200)
tree2af3f662ebcfc2a414907e9ff3e91577523c794c
parente548a7d231e936562fcc301826034c14e4bc9d7b
Fix build on macOS 10.15 Catalina + xcode 11 (#14820)

1) CC_MD5_Init, CC_MD5_Update and CC_MD5_Final are deprecated.

```c
mono-md5.c:45:2: error: 'CC_MD5_Init' is deprecated: first deprecated in macOS 10.15 - This function is
      cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256
      (or stronger). [-Werror,-Wdeprecated-declarations]
        CC_MD5_Init (ctx);
        ^
```

2) objc_msgSend is deprecated
```
mono-threads-mach-helper.c:95:17: error: too many arguments to function call, expected 0, have 2
                objc_msgSend (value, release);
                ~~~~~~~~~~~~  ^~~~~~~~~~~~~~
```
XCode has a special switch `Enable Strict Checking of objc_msgSend Calls` which is now `true` by default. It's fixed by `-DOBJC_OLD_DISPATCH_PROTOTYPES=1` flag to clang or the corresponding define in the source file.

3) Fixes https://github.com/mono/mono/issues/14793

It worked on pre 10.15 without `-framework GSS`, because it got pulled in through the dependencies. You can see it by running DYLD_PRINT_LIBRARIES=1 csharp and then trace it back. On Mojave /System/Library/Frameworks/GSS.framework/Versions/A/GSS got loaded as dependency of /usr/lib/libcups.2.dylib and so on. Unlike Windows, macOS will resolve the symbols to whatever is already available so it was just happy that someone loaded GSS before libmono-native[-compat/-unified].
configure.ac
mono/utils/mono-md5.c
mono/utils/mono-threads-mach-helper.c