aaronbloomfield/pdr

Lab 8: Suggestion - Compilation Instruction Simplification

Closed this issue · 2 comments

Currently, the lab instructs students to use nasm and clang++ in a three step process for compiling with assembly source. However, all that seems to be needed is just to use the .s file as if it were another .cpp file. That is, on my machine:

$ clang++ -Wall -g main.cpp vecsum.s

appears to produce the same output as

$ clang++ -m64 -Wall -g  -c -o main.o main.cpp
$ nasm -f elf64 -g -o vecsum.o vecsum.s
$ clang++ -m64 -Wall -g vecsum.o main.o

Is there a reason we use the longer process?

I think it is good for them to see the steps involved, converting to object code and linking separately. I'm going to leave this for now.

This doesn't work in my machine, going to close for now. We can reopen if we work out why.