Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any interest in OS X builds? #57

Open
zenware opened this issue Jun 18, 2016 · 17 comments
Open

Any interest in OS X builds? #57

zenware opened this issue Jun 18, 2016 · 17 comments

Comments

@zenware
Copy link

zenware commented Jun 18, 2016

I've been looking around for an ASM environment but I think I'll end up just using vim still. I could build and provide releases for this project on OS X however (assuming it actually does build and function on OS X).

@Dman95
Copy link
Owner

Dman95 commented Jun 18, 2016

Hello!
It would be great. There are instruction about building SASM on Mac. You could use it.

@assp1r1n3
Copy link

What about a homebrew formula?

@zenware
Copy link
Author

zenware commented Jul 18, 2016

@assp1r1n3 so far, creating a homebrew formula falls apart right around here https://sourceware.org/gdb/wiki/BuildingOnDarwin#Giving_gdb_permission_to_control_other_processes%7Cofficial
I've asked in the IRC to no response yet, but if you've got any advice I'd love to hear it 👍

@zenware
Copy link
Author

zenware commented Jul 18, 2016

@Dman95 Hey I was just following along that guide and hit an error on step 6

Jays-MacBook-Pro:SASM-master jaylooney$ sudo make install
cp -f /Users/jaylooney/Workspace/MyHomebrewTap/SASM-master/Linux/bin/fasm /usr/bin/
cp: /usr/bin/fasm: Operation not permitted
make: [install_binfile] Error 1 (ignored)
cp -f /Users/jaylooney/Workspace/MyHomebrewTap/SASM-master/Linux/bin/listing /usr/bin/
cp: /usr/bin/listing: Operation not permitted
make: [install_binfile] Error 1 (ignored)
mkdir: /usr/share/sasm/: Operation not permitted
make: *** [install_data] Error 1

Normally I'm pretty familiar with unix permissions and would just be able to solve this, but OS X is a totally different story, I'm still in my first year using Macs and I have a lot to learn about the subtle differences between Darwin and Linux. If you've got any ideas or know who might, that would be awesome!

@zenware
Copy link
Author

zenware commented Jul 18, 2016

Actually, it looks like it did actually build the app, so maybe it's fine that it doesn't litter all over the system...

Jays-MacBook-Pro:SASM-master jaylooney$ ls | grep sasm.app
sasm.app

It also actually runs the app which is great, but building a small NASM file failed:
Image of elf23 build failing
I'm pretty sure nasm came with xcode's command line utilities

$ nasm -v
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on Feb 10 2016

and 
$ nasm -hf
...
valid output formats for -f are (`*' denotes default):
  * bin       flat-form binary files (e.g. DOS .COM, .SYS)
    aout      Linux a.out object files
    aoutb     NetBSD/FreeBSD a.out object files
    coff      COFF (i386) object files (e.g. DJGPP for DOS)
    elf       ELF32 (i386) object files (e.g. Linux)
    as86      Linux as86 (bin86 version 0.3) object files
    obj       MS-DOS 16-bit/32-bit OMF object files
    win32     Microsoft Win32 (i386) object files
    rdf       Relocatable Dynamic Object File Format v2.0
    ieee      IEEE-695 (LADsoft variant) object file format
    macho     NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X object files

I think it's weird that there is a save as .exe in the menu, but not a save as 'Mach-O' or 'ELF', as well I think exe should be 'PE' in this context as people tinkering with the assembler should know the actual format of their code but those are all totally different issues
Image of file menu showing save as exe

@Dman95
Copy link
Owner

Dman95 commented Aug 26, 2016

May be you should change the format from "-f elf32" to "-f elf" on the "Build" tab in the settings to avoid error messages.

As for saving with an exe extension, it is just universal extension for an executable, which will work with all systems. The internal format of a saved file will differ for each system and will be correct.

@zenware
Copy link
Author

zenware commented Sep 7, 2016

Hey @Dman95 thanks for getting back!
I switched the format at your suggestion and it cleared up one of the issues, so thanks for all your help!

I'm still getting this error and I'm not getting any object file output.
Image of build error

My current solution for development, by the way, is that I'm using Vagrant to spin up a Gentoo VM and using the cross-compilers and everything available there.
I still want to get a stable, fully working build of SASM going that I can release for others to use.

@Dman95
Copy link
Owner

Dman95 commented Sep 25, 2016

@zenware Try to change linking options in the "Settings->Build->Linking options" from "$PROGRAM.OBJ$ $MACRO.OBJ$ -g -o $PROGRAM$ -m32" to "$PROGRAM.OBJ$ -g -o $PROGRAM$ -m32"

@MatthewFrench
Copy link

Do you have a release build you can share?

@Dman95
Copy link
Owner

Dman95 commented Sep 30, 2016

@MatthewFrench No, I don't. Because I don't have a Mac. But there is one link about running SASM on Mac: http://www.brianrhall.net/rss/installingsasmonamac
If you can make a build, I will be glad to add it to release.

@sfischer123
Copy link

I have a mac build for SASM: sasm.app.zip

It's only working with sudo: sudo /Applications/sasm.app/Contents/MacOS/sasm

The following Assembly options work for me: -g -f macho64 $SOURCE$ -l $LSTOUTPUT$ -o $PROGRAM.OBJ$ --prefix _
Linking options: $PROGRAM.OBJ$ $MACRO.OBJ$ -g -o $PROGRAM$ -m64
Assembler path: nasm
Linker path: gcc
x64 and NASM selected.

I haven't tried to build the new version of SAMS, but with the upgrade to macOS Sierra the debugging stopped working because of gdb...
With every OS X (now macOS) version it's getting more difficult to get gdb working...

@sfischer123
Copy link

Ok, now I have a working build from version 3.6.0:
sasm.app.zip

gdb is working, too. You have to install it and then sign it with a certificate.

But sudo is still required....

@Dman95 I have changed the code in the debugger.cpp because on mac you have to disable the shell startup in gdb first: "set startup-with-shell off" (Before running "disas main"). It's only a quick and dirty solution, so I don't post the code here.

@lberserq
Copy link
Contributor

Hey, what about integrating Travis county into your project? This ci
service helps you to get a builds and tests coverage on every commit and
supports osx builds too. With new release builds publishing feature(
https://docs.travis-ci.com/user/deployment/releases/) it solves this
problem at all.

On 21 Oct 2016 5:46 p.m., "sfischer123" [email protected] wrote:

I have a mac build for SASM: sasm.app.zip
https://github.com/Dman95/SASM/files/544566/sasm.app.zip

It's only working with sudo: sudo /Applications/sasm.app/Contents/MacOS/sasm

The following Assembly options work for me: -g -f macho64 $SOURCE$ -l
$LSTOUTPUT$ -o $PROGRAM.OBJ$ --prefix _
Linking options: $PROGRAM.OBJ$ $MACRO.OBJ$ -g -o $PROGRAM$ -m64
Assembler path: nasm
Linker path: gcc
x64 and NASM selected.

I haven't tried to build the new version of SAMS, but with the upgrade to
macOS Sierra the debugging stopped working because of gdb...
With every OS X (now macOS) version it's getting more difficult to get gdb
working...


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#57 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFDpkPWGNdBGAebUsZd-80PJot3M2QNNks5q2NBJgaJpZM4I5BgA
.

@rex4539
Copy link

rex4539 commented Feb 22, 2017

I built 3.8.0 from source. It's working fine.

sasm.zip

@kristianmandrup
Copy link

kristianmandrup commented Mar 7, 2017

I just tried the 3.8 pre-build package for Mac

$ sudo /Applications/sasm-3.8.app/Contents/MacOS/sasm
dyld: Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Applications/sasm-3.8.app/Contents/MacOS/sasm
  Reason: image not found

So I guess I have to install Qt first

  1. SASM is built on Qt, so if you don’t have Qt, download Qt
  2. Install Qt
    Only Install the macOS driver, not all the other tools and addons. I got it down to less than 2Gb from over 12Gb with all the shit included
  3. In order to be able to run qmake, add the following path to your .bash_profile
    PATH=$PATH:/Users/YOUR-NAME-HERE/Qt/5.8/clang_64/bin
    with obvious changes for your username and Qt

are you able to compile a MASM file? I'm trying to convert dec64 to NASM, C or JavaScript.

Any help would be greatly appreciated!!

@kristianmandrup
Copy link

I installed Qt for Mac (minimal install) and set the Path. What am I missing?
Still getting the Library not loaded error.

@sfischer123
Copy link

You have to copy some files manually in the Library directory. I don't remember which ones, but you can see the missing files in the error message in the terminal.
You find the files in your QT directory.

@Dman95 Dman95 closed this as completed Jan 26, 2020
@Dman95 Dman95 reopened this Jan 26, 2020
Repository owner locked as off-topic and limited conversation to collaborators Jan 26, 2020
Repository owner unlocked this conversation Jan 26, 2020
Repository owner locked as spam and limited conversation to collaborators Jan 26, 2020
Repository owner deleted a comment from bearcules Jan 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants