License Exceptions
1. (a) Software that is developed by any person or entity for an Apple Operating System ("Apple OS-Developed Software"), including but not limited to Apple and third party printer drivers, filters, and backends for an Apple Operating System, that is linked to the CUPS imaging library or based on any sample filters or backends provided with CUPS shall not be considered to be a derivative work or collective work based on the CUPS program and is exempt from the mandatory source code release clauses of the GNU GPL.
[1] http://www.cups.org/documentation.php/doc-1.5/license.html
Also the x86 Darwin kernel was made open source with no benefit to Apple, and winocm managed to port it to ARM too (although it's pretty debatable if it actually provides anything useful)
That's true of Cups and part of WebKit (most of the actual browser engine is BSD-licensed, but there are LGPL libraries used); however, Apple was certainly under no obligation to contribute its changes to LLVM back, or to contribute clang back _at all_.