http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53922
Jack Howarth <howarth at nitro dot med.uc.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |howarth at nitro dot | |med.uc.edu --- Comment #11 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-09-22 23:46:14 UTC --- The new gcc.dg/torture/pr53922.c testcase fails on darwin. The darwin linker developer had the following comments... --------------------------------------- This is a feature that darwin does not support: int y(int a) __attribute__ ((weak)); This is a function prototype marked "weak". In the linux world, this tells the static linker it is ok for there to be no definition +of the function y - just make a PLT entry as if it was found is some shared object, and somehow it will be magically found at +runtime. Darwin uses two-level namespace where the static linker needs to record in which dylib (shared object) each undefined symbol was +found. If the symbol cannot be found at static link time, it is an error. You can make this example work by adding -undefined dynamic_lookup to the link line which tells the static linker to assume any unresolved symbol will be magically found at runtime. ------------------------------------- Adding... /* { dg-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */ is confirmed to allow all of the gcc.dg/torture/pr53922.c tests to pass at -m32/-m64 on x86_64-apple-darwin11.