flat assembler
Message board for the users of flat assembler.

Index > Unix > How to build current FASM on MacOS?

Author
Thread Post new topic Reply to topic
TmX



Joined: 02 Mar 2006
Posts: 826
Location: Jakarta, Indonesia
TmX
I used fasm-1.73.27.tar.gz as starting point.

First, built objconv found at here
Then grab FASM.

Convert the object file:
Code:
./objconv -fmacho -nu fasm.o fasm.obj    


Quote:
Input file: fasm.o, output file: fasm.obj
Converting from ELF32 to Mach-O Little Endian32
Adding leading underscores to symbol names

0 Debug sections removed
0 Exception sections removed
14 Changes in leading underscores on symbol names


Last part: link with gcc
Code:
gcc fasm.obj -o fasm    


I got this:
Quote:

ld: warning: ignoring file fasm.obj, building for macOS-x86_64 but attempting to link with file built for unknown-i386
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


For those who are not familiar with MacOS:
Quote:
starting with macOS Catalina, 32-bit apps are no longer compatible with macOS

https://support.apple.com/en-us/HT208436


Any help?
Post 21 Feb 2021, 13:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17942
Location: In your JS exploiting you and your system
revolution
You can make a 64-bit compatible binary here:
https://board.flatassembler.net/topic.php?t=19593
Post 21 Feb 2021, 15:18
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7862
Location: Kraków, Poland
Tomasz Grysztar
If you start with fasmg (which comes with a 64-bit Mach-O executable in the official package), you might be able to use its Mach-O formatter and make fasm.x64 in Mach-O format instead of ELF (similarly to what jacobly did for fasmg).
Post 21 Feb 2021, 16:10
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.