Ticket #670 (closed defect: fixed)

Opened 3 years ago

Last modified 22 months ago

unrecognised format 'macho64' on OS X

Reported by: micah_gideon Owned by:
Priority: Nice to Have Milestone: Alpha 7
Component: Core engine Keywords:
Cc:

Description

In attempting to build on OS X Snow Leopard (10.6.5), I run into the following fatal error:

...a whole bunch of stuff...
==== Building test_gen ====
amd64_asm.asm
nasm: fatal: unrecognised output format `macho64' - use -hf for a list
type `nasm -h' for help
make[1]: *** [obj/lowlevel_Release/amd64_asm.o] Error 1
make: *** [lowlevel] Error 2
make: *** Waiting for unfinished jobs....
make[1]: `../../../binaries/system/libwxJS.a' is up to date.

My brief searching indicates that there's hack in place to support linux compilation or something of the sort and I suspect it is interfering.

Attachments

update-workspaces.sh (1021 bytes) - added by micah_gideon 2 years ago.

Change History

comment:1 Changed 2 years ago by Kimball

  • Priority changed from blocker to minor
  • Status changed from new to closed
  • Resolution set to fixed

Looks like your nasm is out of date - I had this same error earlier (10.6.5, MacBook? Pro). Run this in terminal:

sudo port install nasm

Also, you'll need to disable compiling Atlas as it currently fails to build on OSX and doesn't work anyway:

In file /build/workspaces/update-workspaces.sh, replace line

src/bin/premake --outpath ../workspaces/gcc --editor --collada "$@" --target gnu || die "Premake failed"

With the following:

src/bin/premake --outpath ../workspaces/gcc --collada "$@" --target gnu || die "Premake failed"

comment:2 Changed 2 years ago by micah_gideon

OK, now I get a different error - I'll open up a new ticket.

comment:3 Changed 2 years ago by micah_gideon

  • Priority changed from minor to major
  • Status changed from closed to reopened
  • Resolution fixed deleted

Actually, scratch that - it's the same error:

../../../source/lib/timer.h:181: warning: dereferencing type-punned pointer will break strict-aliasing rules
tex_tga.cpp
amd64.cpp
amd64_asm.asm
nasm: fatal: unrecognised output format `macho64' - use -hf for a list
type `nasm -h' for help
make[1]: *** [obj/lowlevel_Release/amd64_asm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [lowlevel] Error 2

I updated nasm, changed the line in the config script (I'll upload it - the line I changed wasn't identical) and now I'm getting the above.

Changed 2 years ago by micah_gideon

comment:4 Changed 2 years ago by Kimball

  • Priority changed from major to minor

It may have said --atlas instead of --editor. Yours looks good though. Atlas can cause some build errors, and since it doesn't work yet anyway, it's not worth wasting your time on the errors. That's why we're taking that flag out. But I wouldn't call this a major issue. Minor doesn't mean it won't be fixed, but major is more for universal issues.

Make sure you're booted with 64-bit kernel enabled. To check if you are, check up in the system profiler (hit the Apple on the left of the menu bar, go to About This Mac, click More Info..., then click the Software heading). If it says "No", follow these instructions: http://support.apple.com/kb/HT3773

If you want more direct and immediate help from the development team, stop by our IRC channel:

irc.quakenet.org
#0ad OR #0ad-dev

comment:5 Changed 2 years ago by micah_gideon

It seems the issue is that my machine doesn't support the 64 bit kernel and extensions. Does the game itself require them? If so, why? Is this documented anywhere?

comment:6 Changed 2 years ago by Philip

Hmm, you shouldn't get the "unrecognised output format `macho64'" error if you have the latest nasm. You may need to run

sudo port selfupdate

and then do

sudo port upgrade nasm

to get the latest. If that doesn't help, what's the output from running:

nasm -v
which nasm

?

The game itself supports 32-bit and 64-bit compilation - the problem seems to be that the build system gets confused on OS X and tries compiling in the wrong mode. (I get confused too, and don't know what the right mode is - maybe 32-bit on 10.5 and 64-bit on 10.6 but I'm not really sure). If you get errors other than the macho64 one, you may need to edit build/premake/premake.lua and add the line

arch="amd64

just before the "-- Set up the Project" line, then run update-workspaces again, to trick it into using the right mode. (Would be much better if we could detect this automatically.)

comment:7 Changed 2 years ago by micah_gideon

OK,  now I get:

==== Regenerating Makefiles ====
make: premake: No such file or directory
make: *** [Makefile] Error 1
==== Regenerating Makefiles ====
make: premake: No such file or directory
make: *** [Makefile] Error 1

I'm trying to find you in IRC...

comment:8 Changed 2 years ago by Philip

  • Status changed from reopened to closed
  • Resolution set to worksforme
  • Milestone changed from Backlog to Alpha 4

As mentioned on IRC you need to run update-workspaces.sh to resolve that error.

Closing this ticket since it worked for Kimball and there hasn't been any progress here lately; feel free to reopen and provide more information if you still have this problem.

comment:9 Changed 22 months ago by historic_bruno

  • Status changed from closed to reopened
  • Resolution worksforme deleted
  • Milestone changed from Alpha 4 to Backlog

Reopening since I'm getting this bug with the xcode project in Premake4. See this forum post for the gory details. I've tried everything above, except the arch="amd64" suggestion, but I'm not sure if that still applies.

comment:10 Changed 22 months ago by ben

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [9891]) Replaces architecture-dependent cpuid function with inline GCC assembly. Should fix #670 by eliminating nasm dependency.

comment:11 Changed 22 months ago by historic_bruno

  • Milestone changed from Backlog to Alpha 7
Note: See TracTickets for help on using tickets.