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

first.asm code fail to compile under Linux #11

Open
Saldef opened this issue Apr 10, 2023 · 1 comment
Open

first.asm code fail to compile under Linux #11

Saldef opened this issue Apr 10, 2023 · 1 comment

Comments

@Saldef
Copy link

Saldef commented Apr 10, 2023

Thanks for the Book Paul, very helpful.

While trying to run the first.asm code, I was not able to compile it under x86_64 Linux. GCC will complain citing architecture incompatibility issues. After a little bit of search I found out that ones needs to add the -m32 option to for it to correctly compile (along with installing gcc-multilib and g++-multilib packages before-head)

Also, assembling the asm_io.asm was not mentioned in section 1.4.3, although it is necessary, and it has a caveat where one needs to add the inline macro -d ELF_TYPE, this would only be noticed when reading the comments of the asm_io.asm file. For a beginner, and for his/her very first code, this will hinder a bit, and distract the learner on a quest on the web trying to find a solution.

I have submitted a pull request with some some details on the comments to the asm_io.asm file.

@GuichiZhao
Copy link

You are absolutely correct, I faced the exactly the same problem and take quite a while to figure it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants