deadpixi / sam

An updated version of the sam text editor.
Other
430 stars 46 forks source link

Issue with compiling on M2 (arm64) Mac #127

Closed amaier10 closed 3 months ago

amaier10 commented 6 months ago
gcc  -o samterm main.o flayer.o  io.o menu.o mesg.o rasp.o samrc.o scroll.o unix.o ../libframe/libframe.a ../libXg/libXg.a -lXt -lX11 -lXft -lXi -L/usr/X11R6/lib
ld: warning: ignoring file ../libXg/libXg.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ../libframe/libframe.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
  "_Pt", referenced from:
      _closeup in main.o
      _cmdscrolldownline in main.o
      _scroll in scroll.o
  "_Rect", referenced from:
      _scrdraw in scroll.o
  "__bgpixel", referenced from:
      _flnew in flayer.o
      _flclose in flayer.o
      _flreshape in flayer.o
  "__dpy", referenced from:
      _flushtyping in main.o
  "_backgroundspec", referenced from:
      _dirbackground in samrc.o
  "_balloc", referenced from:
      _flclose in flayer.o
      _flprepare in flayer.o
      _scrdraw in scroll.o
  "_bfree", referenced from:
      _flclose in flayer.o
      _newvisibilities in flayer.o
      _flreshape in flayer.o
  "_bitblt", referenced from:
      _getscreen in unix.o
  "_bitblt2", referenced from:
      _flinit in flayer.o
      _flclose in flayer.o
      _newvisibilities in flayer.o
      _flreshape in flayer.o
      _flprepare in flayer.o
      _flrefresh in flayer.o
      _scrflip in scroll.o
      ...
  "_border", referenced from:
      _flborder in flayer.o
      _flprepare in flayer.o
  "_borderspec", referenced from:
      _dirborder in samrc.o
  "_bscreenrect", referenced from:
      _RESHAPED in io.o
  "_chartorune", referenced from:
      _externchar in io.o
      _genmenu3 in menu.o
      _hdata in mesg.o
  "_clipatom", referenced from:
      _dirsnarfselection in samrc.o
  "_cursorset", referenced from:
      _scroll in scroll.o
  "_cursorswitch", referenced from:
      _duplicate in main.o
      _cmdwrite in main.o
      _menu3hit in menu.o
      _setlock in mesg.o
      _clrlock in mesg.o
      _hsetsnarf in mesg.o
  "_darkgrey", referenced from:
      _scrdraw in scroll.o
  "_ecankbd", referenced from:
      _kbdchar in io.o
  "_ecanread", referenced from:
      _kbdchar in io.o
  "_einit", referenced from:
      _initio in io.o
  "_ekbd", referenced from:
      _kbdchar in io.o
  "_emouse", referenced from:
      _frgetmouse in io.o
  "_eqpt", referenced from:
      _scroll in scroll.o
  "_eread", referenced from:
      _waitforio in io.o
      _kbdchar in io.o
  "_estart", referenced from:
      _initio in io.o
  "_font", referenced from:
      _main in main.o
      _sweeptext in menu.o
  "_fontspec", referenced from:
      _dirfont in samrc.o
  "_foregroundspec", referenced from:
      _dirforeground in samrc.o
  "_frcharofpt", referenced from:
      _cmdscrolldownline in main.o
      _flselect in flayer.o
      _scroll in scroll.o
  "_frclear", referenced from:
      _flclose in flayer.o
      _newvisibilities in flayer.o
      _flreshape in flayer.o
  "_frdelete", referenced from:
      _fldelete in flayer.o
      _horigin in mesg.o
  "_frinit", referenced from:
      _flinit in flayer.o
      _flprepare in flayer.o
  "_frinsert", referenced from:
      _flinsert in flayer.o
      _flprepare in flayer.o
      _horigin in mesg.o
  "_frselect", referenced from:
      _flselect in flayer.o
  "_frselectp", referenced from:
      _flsetselect in flayer.o
      _flprepare in flayer.o
  "_frsetrects", referenced from:
      _flreshape in flayer.o
  "_getbg", referenced from:
      _main in main.o
      _sweeptext in menu.o
  "_getrect", referenced from:
      _getr in main.o
  "_inset", referenced from:
      _onethird in main.o
      _flrect in flayer.o
      _flinit in flayer.o
      _flreshape in flayer.o
      _scrpos in scroll.o
      _scrdraw in scroll.o
      _scroll in scroll.o
      ...
  "_installbinding", referenced from:
      _installdefaultbindings in samrc.o
      _dirraw in samrc.o
      _dirrawliteral in samrc.o
      _dirbind in samrc.o
  "_installchord", referenced from:
      _installdefaultchords in samrc.o
      _dirchord in samrc.o
  "_menuhit", referenced from:
      _menu2hit in menu.o
      _menu3hit in menu.o
  "_ptinrect", referenced from:
      _main in main.o
      _flwhich in flayer.o
  "_pushkbd", referenced from:
      _cmdtab in main.o
      _cmdsend in main.o
  "_raddp", referenced from:
      _flreshape in flayer.o
      _scroll in scroll.o
  "_rectXrect", referenced from:
      _flrefresh in flayer.o
  "_rectclip", referenced from:
      _getr in main.o
      _flrect in flayer.o
      _flreshape in flayer.o
      _scrflip in scroll.o
  "_removebinding", referenced from:
      _dirunbind in samrc.o
  "_removechord", referenced from:
      _dirunchord in samrc.o
  "_rsubp", referenced from:
      _flreshape in flayer.o
  "_screen", referenced from:
      _main in main.o
      _reshape in main.o
      _getr in main.o
      _flinit in flayer.o
      _flclose in flayer.o
      _newvisibilities in flayer.o
      _flreshape in flayer.o
      ...
     (maybe you meant: _screensize)
  "_scrpix", referenced from:
      _screensize in unix.o
  "_snarfswap", referenced from:
      _hsetsnarf in mesg.o
  "_sub", referenced from:
      _flreshape in flayer.o
  "_tabwidth", referenced from:
      _cmdtab in main.o
      _dirtabs in samrc.o
  "_texture", referenced from:
      _scrdraw in scroll.o
  "_xtbinit", referenced from:
      _getscreen in unix.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[1]: *** [samterm] Error 1
make: *** [samtermdir] Error 2

I'm having a linker issue when compiling using gcc on an M2 mac. This is the output that I'm getting.

mikerosenberg commented 6 months ago

I haven't tried to compile on my m1, but the version I compiled on my intel mac works fine on the m1 - probably faster!

erezschatz commented 6 months ago

Haven't tried on M1, tried on Intel Mac, and it works. Needs an X server, but works.

mikerosenberg commented 6 months ago

I hope it still works on Intel Macs!! Rob and I spent a lot of time on that. There is a bug having to do with exchange but otherwise it's been fine for years. Since Mx Macs run Intel stuff via emulation, and since the emulation is often faster than native (!), I see no urgent need to get the compilation working on M-series.

amaier10 commented 3 months ago

Retrying compilation with some changes to config.mk.