www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - symbol suggestion algorithm goes a bit awry

reply =?UTF-8?B?Ikx1w61z?= Marques" <luis luismarques.eu> writes:
Maybe we should tweak the symbol suggestion algorithm :-)

     extern(C) void f();

     void main()
     {
         f();
     }

$ dmd test.d (v2.063.2)
Undefined symbols for architecture x86_64:
   "_f", referenced from:
       __Dmain in test.o
      (maybe you meant: 
_D17src/object_.d.80815__unittest_failFiZv, 
_D17src/object_.d.81315__unittest_failFiZv , 
_D2rt3aaA15__unittest_failFiZv , 
_D17src/object_.d.81415__unittest_failFiZv , 
_D17src/object_.d.80915__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f4swapMxFNaNbNePvPvZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f5tsizeMxFNaNbNdNeZm , 
_D2rt8typeinfo8ti_float10TypeInfo_f7getHashMxFNaNbNexPvZm , 
_D10TypeInfo_f7__ClassZ , 
_D2rt8typeinfo8ti_float10TypeInfo_f7_equalsFNaNbNeffZb , 
_D16src/object_.d.9815__unittest_failFiZv , 
_D33../druntime/import/object.di.218515__unittest_failFiZv , 
_D16src/object_.d.9715__unittest_failFiZv , 
_D6object19MemberInfo_function6__ctorMFAyaC8TypeInfoPvkZC6object1
MemberInfo_function 
, _D6object19MemberInfo_function5flagsMFNaNbNdZk , 
_D6object19MemberInfo_function2fpMFNaNbNdZPv , 
_D6object19MemberInfo_function4nameMFNaNbNdZAya , 
_D6object19MemberInfo_function6__initZ , 
_D6object16MemberInfo_field6__ctorMFAyaC8TypeInfomZC6object16MemberInfo_field 
, _D6object16MemberInfo_field4nameMFNaNbNdZAya , 
_D4core7runtime19defaultTraceHandlerFPvZC6object9Throwable9TraceInfo16DefaultTraceInfo8toStringMxFZAya16__foreac
body353MFNfKmKxAaZi 
, _D3std7complex15__unittest_failFiZv , 
_D16src/object_.d.9515__unittest_failFiZv , 
_D2gc3gcx15__unittest_failFiZv , _D2gc3gcx3Gcx8log_freeMFPvZv , 
_rt_finalize2 , _D17src/object_.d.81215__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f8toStringMxFNaNbNeZAya , 
_D4core4time15__unittest_failFiZv , 
_D6object19MemberInfo_function8typeInfoMFNaNbNdZC8TypeInfo , 
_D6object15__unittest_failFiZv , 
_D6object16MemberInfo_field6__initZ , _D10TypeInfo_f6__initZ , 
_D3std8internal7uni_tab15__unittest_failFiZv , 
_D3std8internal3uni15__unittest_failFiZv , 
_D3std7numeric15__unittest_failFiZv , 
_D2rt9critical_15__unittest_failFiZv , 
_D2rt8monitor_15__unittest_failFiZv , 
_D6object16MemberInfo_field6__vtblZ , 
_D2gc2gc15__unittest_failFiZv , 
_D2rt4deh213__eh_finddataFPvZPyS2rt4deh29FuncTable16__foreachbody509MFKS2rt12sections
osx12SectionGroupZi 
, _D2rt4util9container15__unittest_failFiZv , 
_D4core6thread15__unittest_failFiZv , 
_D4core7runtime15__unittest_failFiZv , 
_D16src/object_.d.9315__unittest_failFiZv , 
_D18src/object_.d.121815__unittest_failFiZv , 
_D16src/object_.d.8315__unittest_failFiZv , 
_D2rt5minfo16rt_moduleTlsCtorUZv16__foreachbody544MFKS2rt12sections
osx12SectionGroupZi 
, 
_D2rt5minfo13rt_moduleDtorUZv16__foreachbody546MFKS2rt12sections
osx12SectionGroupZi 
, _D4core9exception15__unittest_failFiZv , 
_D3std9container15__unittest_failFiZv , 
_D6object19MemberInfo_function7__ClassZ , _D10TypeInfo_f6__vtblZ 
, _D3std5regex15__unittest_failFiZv , 
_D6object19MemberInfo_function6__vtblZ , 
_D6object16MemberInfo_field8typeInfoMFNaNbNdZC8TypeInfo , 
_D2rt6memory16initStaticDataGCFZv16__foreachbody518MFKS2rt12sections
osx12SectionGroupZi 
, 
_D2rt5minfo17moduleinfos_applyFMDFKPS6object10ModuleInfoZiZi16__foreachbody540MFKS2rt12sections
osx12SectionGroupZi 
, _D2rt4util7console15__unittest_failFiZv , 
_D16src/object_.d.8915__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f4initMxFNaNbNeZAxv1ryf , 
_D3std5array15__unittest_failFiZv , 
_D3std9exception15__unittest_failFiZv , 
_D3std6traits15__unittest_failFiZv , 
_D16src/object_.d.5215__unittest_failFiZv , 
_D4core6thread14thread_joinAllUZv16__foreachbody370MFKC4core6thread6ThreadZi 
, _D3std6format15__unittest_failFiZv , 
_D6object16MemberInfo_field6offsetMFNaNbNdZm , 
_D3std5ascii15__unittest_failFiZv , 
_D2rt5minfo13rt_moduleCtorUZv16__foreachbody543MFKS2rt12sections
osx12SectionGroupZi 
, 
_D3std8internal7uni_tab48unicodeInCombining_Diacritical_Marks_for_SymbolsyS3std8intern
l3uni12CodepointSet 
, _D17src/object_.d.21615__unittest_failFiZv , 
_D2rt5tlsgc15__unittest_failFiZv , _gc_free , 
_D3std9typetuple15__unittest_failFiZv , 
_D3std9stdiobase15__unittest_failFiZv , 
_D3std8typecons15__unittest_failFiZv , 
_D3std6string15__unittest_failFiZv , 
_D3std4math15__unittest_failFiZv , 
_D3std10functional15__unittest_failFiZv , 
_D16src/object_.d.8615__unittest_failFiZv , 
_D18src/object_.d.122215__unittest_failFiZv , 
_D2rt4deh213__eh_finddataFPvPyS2rt4deh29FuncTablePyS2rt4deh29FuncTableZP
S2rt4deh29FuncTable 
, _D18src/object_.d.133515__unittest_failFiZv , 
_D20std/exception.d.142715__unittest_failFiZv , 
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv14printInfoBlockMFC6object9ThrowableZv16__fo
eachbody514MFKxAaZi 
, _D2rt8lifetime15__unittest_failFiZv , 
_D3std8bitmanip15__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f8_compareFNaNbNeffZi , 
_D3std3utf15__unittest_failFiZv , 
_D2rt12sections_osx12SectionGroup11__fieldDtorMFZv , 
_D6object16MemberInfo_field7__ClassZ , 
_D3std4conv15__unittest_failFiZv , 
_D3std9algorithm15__unittest_failFiZv , 
_D3std6random15__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f6equalsMxFNaNbNexPvxPvZb , 
_D18src/object_.d.105315__unittest_failFiZv , 
_D3std5range15__unittest_failFiZv , 
_D2rt12sections_osx15__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f4initMxFNaNbNeZAxv , 
_D2rt4deh215__unittest_failFiZv , 
_D4core7runtime18runModuleUnitTestsUZb16__foreachbody351MFKPS6
bject10ModuleInfoZi 
, 
_D6object14TypeInfo_Class4findFxAaZxC14TypeInfo_Class16__foreachbody314MFKPS6
bject10ModuleInfoZi 
, _D17src/object_.d.81015__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f7compareMxFNaNbNexPvxPvZi , 
_D2rt4deh213__eh_finddataFPvZPyS2rt4deh29FuncTable , 
_D2rt12sections_osx12SectionGroup15__fieldPostBlitMFZv , 
_D3std5stdio15__unittest_failFiZv , 
_D18src/object_.d.121915__unittest_failFiZv , 
_D2rt5minfo16rt_moduleTlsDtorUZv16__foreachbody545MFKS2rt12sections
osx12SectionGroupZi 
, _D18src/object_.d.122115__unittest_failFiZv , 
_D6object9Throwable8toStringMFZAya16__foreachbody319MFNfKxAaZi , 
_D2rt6dmain215__unittest_failFiZv )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
--- errorlevel 1
Sep 17 2013
next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Tue, Sep 17, 2013 at 09:02:43PM +0200, digitalmars-d-bounces puremagic.com
wrote:
 Maybe we should tweak the symbol suggestion algorithm :-)
 
     extern(C) void f();
 
     void main()
     {
         f();
     }
 
 $ dmd test.d (v2.063.2)
 Undefined symbols for architecture x86_64:
   "_f", referenced from:
       __Dmain in test.o
      (maybe you meant: _D17src/object_.d.80815__unittest_failFiZv,
 _D17src/object_.d.81315__unittest_failFiZv ,
 _D2rt3aaA15__unittest_failFiZv ,
[...] Heh, that's funny. Please file a bug at: http://d.puremagic.com/issues/ :) T -- Why are you blatanly misspelling "blatant"? -- Branden Robinson
Sep 17 2013
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 9/17/2013 12:08 PM, H. S. Teoh wrote:
 Please file a bug at: http://d.puremagic.com/issues/
That isn't going to help, as the clang linker devs don't look there.
Sep 17 2013
parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Tue, Sep 17, 2013 at 12:20:21PM -0700, Walter Bright wrote:
 On 9/17/2013 12:08 PM, H. S. Teoh wrote:
Please file a bug at: http://d.puremagic.com/issues/
That isn't going to help, as the clang linker devs don't look there.
lol... that will teach me to reply before reading more carefully. :-P T -- Doubtless it is a good thing to have an open mind, but a truly open mind should be open at both ends, like the food-pipe, with the capacity for excretion as well as absorption. -- Northrop Frye
Sep 17 2013
prev sibling parent "Maxim Fomin" <maxim maxim-fomin.ru> writes:
On Tuesday, 17 September 2013 at 19:09:22 UTC, H. S. Teoh wrote:
 On Tue, Sep 17, 2013 at 09:02:43PM +0200, 
 digitalmars-d-bounces puremagic.com wrote:
 Maybe we should tweak the symbol suggestion algorithm :-)
 
     extern(C) void f();
 
     void main()
     {
         f();
     }
 
 $ dmd test.d (v2.063.2)
 Undefined symbols for architecture x86_64:
   "_f", referenced from:
       __Dmain in test.o
      (maybe you meant: 
 _D17src/object_.d.80815__unittest_failFiZv,
 _D17src/object_.d.81315__unittest_failFiZv ,
 _D2rt3aaA15__unittest_failFiZv ,
[...] Heh, that's funny. Please file a bug at: http://d.puremagic.com/issues/ :) T
LOL. The question is as funny as the answer is.
Sep 17 2013
prev sibling parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Tuesday, 17 September 2013 at 19:02:44 UTC, Luís Marques wrote:
 Maybe we should tweak the symbol suggestion algorithm :-)
That looks like linker output, and thus not a problem with the D toolchain. I guess that the linker you're using also has a suggestion feature. A quick Google tells me you're using a Mac?
Sep 17 2013
parent =?UTF-8?B?Ikx1w61z?= Marques" <luis luismarques.eu> writes:
On Tuesday, 17 September 2013 at 19:22:00 UTC, Vladimir Panteleev 
wrote:
 That looks like linker output, and thus not a problem with the 
 D toolchain. I guess that the linker you're using also has a 
 suggestion feature. A quick Google tells me you're using a Mac?
I'm so used to D suggesting symbols that I didn't think this through, even though I remember seeing 'ld' in the output :-) Yes, llvm/clang on a Mac.
Sep 17 2013