Linker fails to report link errors clearly when linking against specific library

Originator:google.j
Number:rdar://12566019 Date Originated:2012-10-24
Status:Open Resolved:
Product:Developer Tools Product Version:4.5.1/4G1004
Classification:UI/Usability Reproducible:Always
 
Summary:
When linking to a particular static library (included with attached project), the linker fails to report which symbols are involved in link errors triggered by unrelated files.

Steps to Reproduce:
Build both targets (shylinker and happylinker) in the attached project.

Expected Results:
Both targets should fail to build with a linker error along the lines of:
Undefined symbols for architecture x86_64:
  "_ThisFunctionIsNotDefined", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64

Actual Results:
happylinker produces the expected error message. shylinker produces a much less helpful message:
ld: '_main' in /.../shylinker.build/Objects-normal/x86_64/main.o contains undefined reference for architecture x86_64

Regression:
I believe this happened in Xcode 4.5.0. I don't remember if I saw it in 4.4.

Notes:
Both targets have the same link error, and both link to the static library. The difference is that only shylinker contains a separate source file which contains a function that calls into the static library. That file is not involved in any link errors. The setup is described in more detail in the included README.txt file.



Attachment:
http://jens.ayton.se/code/files/shylinker.zip

Comments


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!