xml2-config with 10.12 and XCode 9 returns wrong paths

Originator:tobias.bussmann
Number:rdar://35102061 Date Originated:20.10.2017
Status:Duplicate/34655752 Resolved:
Product:macOS + SDK Product Version:10.12
Classification:Bug Reproducible:always
 
Summary:
Builds of applications that link against libxml (for example PostgreSQL) fail because "xml2-config --cflags --libs" include a 
"-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib" which pulls in libSystem.B.tbd which refers to "/usr/lib/system/libsystem_darwin.dylib" which does not exist.

Steps to Reproduce:
On 10.12.6 install all available updates including Xcode 9 command line tools. Then try to configure postgresql.

Expected Results:
-I/usr/include/libxml2
-lxml2 -lz -lpthread -licucore -lm
These are returned both in 10.12 with Xcode8 and 10.13 with Xcode 9

Actual Results:
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm

Version/Build:
xml2-config --version
2.9.4

Configuration:
macOS 10.12.6 with XCode 9 and command-line tools
$ xcode-select --version
xcode-select version 2347.
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

Comments

it seems that this problem is only caused by XCode 9 itself. A fresh install of 10.12.6 as well as with just the Xcode command line tools "Command Line Tools (macOS Sierra version 10.12) for Xcode" Version 9.2 installed with "xcode-select --install" does return the expected values from xml2-config. Installing XCode 9.2 changes this, uninstalling reverts to previous behaviour. Xcode 9 does apparently only include the 10.13 SDK even if installed under 10.12. It is possible to switch to use the Command Line Tools version of the developer tools by issuing "sudo xcode-select -s /Library/Developer/CommandLineTools/" even if XCode 9 is installed. With these the issue does not appear to happen, although it only contains an 10.13 SDK as well.

By tobias.bussmann at Jan. 25, 2018, 6:08 p.m. (reply...)

Engineering has determined that your bug report (35102061) is a duplicate of 34655752 and will be closed.

By tobias.bussmann at Nov. 8, 2017, 11:15 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!