D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19373 - can't link dmd on macOS
Summary: can't link dmd on macOS
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Mac OS X
: P2 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-07 10:25 UTC by John Colvin
Modified: 2024-12-13 19:01 UTC (History)
2 users (show)

See Also:


Attachments
linker errors (44.05 KB, text/plain)
2018-11-07 10:25 UTC, John Colvin
Details

Note You need to log in before you can comment on or make changes to this issue.
Description John Colvin 2018-11-07 10:25:39 UTC
Created attachment 1715 [details]
linker errors

make -f posix.mak fails with a long list of missing symbols, please find output attached
Comment 1 Jacob Carlborg 2018-11-07 19:34:19 UTC
Works for me. I noticed this in your output:

ld: warning: ignoring file ../generated/osx/release/64/backend.a, file was built for archive which is not the architecture being linked (x86_64): ../generated/osx/release/64/backend.a

Do you have some leftovers from a previous builds?
Comment 2 Jacob Carlborg 2018-11-07 19:35:51 UTC
I've tried compiling with DMD 2.081.0 to 2.083.0.
Comment 3 Nicholas Wilson 2018-11-09 10:13:34 UTC
I also have this problem.
Comment 4 Nicholas Wilson 2018-11-09 11:22:13 UTC
My list of missing symbols is much shorter though:
Undefined symbols for architecture x86_64:
  "movregconst(CodeBuilder&, unsigned int, unsigned long long, unsigned int)", referenced from:
      regwithvalue(CodeBuilder&, unsigned int, unsigned long long, unsigned int*, unsigned int) in backend.a(cgen.o)
  "reghasvalue(unsigned int, unsigned long, unsigned int*)", referenced from:
      simplify_code(code*) in backend.a(cod3.o)
      ...
  "regwithvalue(CodeBuilder&, unsigned int, unsigned long, unsigned int*, unsigned int)", referenced from:
      load87(CodeBuilder&, elem*, unsigned int, unsigned int*, elem*, int) in backend.a(cg87.o)
      ...
  "genc2(code*, unsigned int, unsigned int, unsigned long)", referenced from:
      doswitch(CodeBuilder&, block*) in backend.a(cod3.o)
  "CodeBuilder::genc(unsigned int, unsigned int, unsigned int, unsigned long, unsigned int, unsigned long)", referenced from:
      cnvt87(CodeBuilder&, elem*, unsigned int*) in backend.a(cg87.o)
      ...
  "CodeBuilder::genc1(unsigned int, unsigned int, unsigned int, unsigned long)", referenced from:
      ndp_fstp(CodeBuilder&, int, unsigned int) in backend.a(cg87.o)
      ...
  "CodeBuilder::genc2(unsigned int, unsigned int, unsigned long)", referenced from:
      genjmpifC2(CodeBuilder&, code*) in backend.a(cg87.o)
      ...
  "CodeBuilder::genfltreg(unsigned int, unsigned int, unsigned long)", referenced from:
      fixresult_complex87(CodeBuilder&, elem*, unsigned int, unsigned int*) in backend.a(cg87.o)
      fixresult87(CodeBuilder&, elem*, unsigned int, unsigned int*) in backend.a(cg87.o)
      ...
  "CodeBuilder::genxmmreg(unsigned int, unsigned int, unsigned long, unsigned int)", referenced from:
      fixresult_complex87(CodeBuilder&, elem*, unsigned int, unsigned int*) in backend.a(cg87.o)
      fixresult87(CodeBuilder&, elem*, unsigned int, unsigned int*) in backend.a(cg87.o)
      movxmmconst(CodeBuilder&, unsigned int, unsigned int, unsigned long, unsigned int) in backend.a(cgxmm.o)
      fixresult(CodeBuilder&, elem*, unsigned int, unsigned int*) in backend.a(cod1.o)
      loaddata(CodeBuilder&, elem*, unsigned int*) in backend.a(cod1.o)
  "Obj::reftoident(int, unsigned long, Symbol*, unsigned long, int)", referenced from:
      codout(int, code*) in backend.a(cod3.o)
      do16bit(MiniCodeBuf*, int, evc*, int) in backend.a(cod3.o)
      do32bit(MiniCodeBuf*, int, evc*, int, int) in backend.a(cod3.o)
      do64bit(MiniCodeBuf*, int, evc*, int) in backend.a(cod3.o)
      el_ptr(Symbol*) in backend.a(elem.o)
  "Obj::reftodatseg(int, unsigned long, unsigned long, unsigned int, int)", referenced from:
      codout(int, code*) in backend.a(cod3.o)
      do16bit(MiniCodeBuf*, int, evc*, int) in backend.a(cod3.o)
      do32bit(MiniCodeBuf*, int, evc*, int, int) in backend.a(cod3.o)
      do64bit(MiniCodeBuf*, int, evc*, int) in backend.a(cod3.o)
  "Obj::reftocodeseg(int, unsigned long, unsigned long)", referenced from:
      codgen(Symbol*) in backend.a(cgcod.o)
      outswitab(block*) in backend.a(cod3.o)
      do16bit(MiniCodeBuf*, int, evc*, int) in backend.a(cod3.o)
      do32bit(MiniCodeBuf*, int, evc*, int, int) in backend.a(cod3.o)
      do64bit(MiniCodeBuf*, int, evc*, int) in backend.a(cod3.o)
  "Obj::bytes(int, unsigned long, unsigned int, void*)", referenced from:
      codout(int, code*) in backend.a(cod3.o)
      MiniCodeBuf::flushx() in backend.a(cod3.o)
      el_convstring(elem*) in backend.a(elem.o)
  "Obj::lidata(int, unsigned long, unsigned long)", referenced from:
      outjmptab(block*) in backend.a(cod3.o)
      outswitab(block*) in backend.a(cod3.o)
  "Obj::linnum(Srcpos, int, unsigned long)", referenced from:
      codgen(Symbol*) in backend.a(cgcod.o)
      codout(int, code*) in backend.a(cod3.o)
  "Obj::pubdef(int, Symbol*, unsigned long)", referenced from:
      cod3_thunk(Symbol*, Symbol*, unsigned int, unsigned int, unsigned int, int, unsigned int) in backend.a(cod3.o)
ld: symbol(s) not found for architecture x86_64

They all seem to be backend symbols.
Comment 5 Nicholas Wilson 2018-11-09 11:57:00 UTC
... and it works now. I suspect it is related to the recent backend changes. Make sure you run make -f posix.mak clean and try again with git master.
Comment 6 Nicholas Wilson 2018-12-02 07:26:17 UTC
Are you still experiencing this? If not please close.
Comment 7 dlangBugzillaToGithub 2024-12-13 19:01:14 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19505

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB