Clang + Nasm on Ubuntu?

Programming, for all ages and all languages.
Post Reply
NukeRusich
Posts: 2
Joined: Thu Aug 02, 2012 12:40 am

Clang + Nasm on Ubuntu?

Post by NukeRusich »

So I'm going to attempt making my first OS (Yay me!) and I'd like to just run it in QEMU using Nasm as my assembler and Clang as my compiler.

But the default (on Ubuntu) is GAS/GCC for make.

So, uh, do I just put .clang on the end of the makefile or something? Do some shell script edits? I'm assuming the latter, since there's an assembler involved, not just a compiler. *goes to search for shell scripts while I wait for a response*
User avatar
iansjack
Member
Member
Posts: 4687
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Clang + Nasm on Ubuntu?

Post by iansjack »

You just need to set the standard make variables CC, CXX, and AS to point to the appropriate programs. Using nasm could be problematic and will probably need a little more work as the compiler will be emitting assembler code targetted at the standard GNU assembler. Personally I would make life easier and stick withthe GNU assembler.

This is not really a question about OS development, but about how to use the toolset. Practice with simple programs until you are confident that you know how to use the tools - compiler, assembler, linker, library utilities - before progressing to the more ambitious stuff.
NukeRusich
Posts: 2
Joined: Thu Aug 02, 2012 12:40 am

Re: Clang + Nasm on Ubuntu?

Post by NukeRusich »

iansjack wrote:This is not really a question about OS development, but about how to use the toolset. Practice with simple programs until you are confident that you know how to use the tools - compiler, assembler, linker, library utilities - before progressing to the more ambitious stuff.
Yeah, I'm going to be doing that for practice for awhile. And reading more documentation.
Post Reply