0

I compiled the kernel modules written in C directly on my Raspberry Pi using this Makefile:

obj-m := HelloWorld.o

all:
    $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

I was wondering how to get the compiler to output the assembly source code.

  • Have you solved your problem? If so, please mark the answer that helped you, or if you solved it on your own, create a self-answer and mark it as such. We are trying to get the site Q:A ratio up and marking answers is what does that. If you resolved it and mark then people in the future will be able to profit from what you did and it helps move the site closer to graduation. Thanks! – RPiAwesomeness Mar 23 '14 at 16:47
1

What is your C compiler?

If it's GCC, adding parameters -S -save-temps makes it leave all intermediate files - preprocessed, assembly, objects.

  • Thanks for the answer! I don't know what is my compiler...there is a way to know it? I simply launch "make" to compile, so the compilator is hidden. Thanks! – Flavio Barisi Aug 5 '13 at 7:13
  • @FlavioBarisi If you could edit in the contents of the Makefile to the question, we would be able to tell what compiler you are using. – syb0rg Aug 6 '13 at 4:01
0
obj-m := HelloWorld.o

EXTRA_CFLAGS+= -save-temps

all:
    $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  • Please use the Post answer button only for actual answers. You should modify your original question to add additional information. – RPiAwesomeness Mar 23 '14 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.