2010-03-10 10:51:28     Out-of-Tree Module Build Question - Binary Differences

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-03-10 10:51:28     Out-of-Tree Module Build Question - Binary Differences

David Kasper (UNITED STATES)

Message: 87048   

 

How do I either build an out of tree module either without including debugging information or strip it out after linking?  Is there a flag within the linux tree makefile that can be disabled?  I am using the online tutorial for the module makefile but diff fails if the module is built from different folder locations (note diff works if the module is built repeatedly from the same folder; thus this is not an embedded date/timestamp issue).  I believe diff fails because the build folder location is embedded as symbol information within the .ko file.

 

Thanks,

 

David Kasper

QuoteReplyEditDelete

 

 

2010-03-10 11:45:06     Re: Out-of-Tree Module Build Question - Binary Differences

Mike Frysinger (UNITED STATES)

Message: 87049   

 

add -g0 to EXTRA_CFLAGS in the Makefile

 

you could also try using `strip -g` on the .ko

QuoteReplyEditDelete

 

 

2010-03-10 12:11:28     Re: Out-of-Tree Module Build Question - Binary Differences

David Kasper (UNITED STATES)

Message: 87050   

 

Mike,

 

Neither method worked.  I got "unable to recognise the format of the input file" when typing "strip -g" for the .ko.  I didn't see EXTRA_CFLAGS so I added "-g0" to CFLAGS below.  Any other suggestions?

 

Thanks,

 

Dave

 

#

# Sample out of tree build Makefile

# for the TARGET system

#

PWD = $(shell pwd)

ROOTDIR ?= $(KERNEL_ROOT)/..

KSRC = $(ROOTDIR)/$(LINUXDIR)

ARCH ?= blackfin

CROSS_COMPILE ?=bfin-uclinux-

MAKEARCH_KERNEL ?= $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

 

#ifdef M

obj-m += fpga_block.o

fpga_block-objs := fpga_spi_block.o fpga_sequencer.o

#else

all:

        CFLAGS=" -g0" CPPFLAGS="" LDFLAGS="" \

        $(MAKEARCH_KERNEL) -C $(ROOTDIR)/$(LINUXDIR) M=$(PWD) modules

        $(MAKEARCH_KERNEL) -C $(ROOTDIR)/$(LINUXDIR) M=$(PWD) \

        INSTALL_MOD_PATH=$(ROOTDIR)/romfs DEPMOD=true modules_install

romfs:

 

clean:

        $(MAKEARCH_KERNEL) -C $(ROOTDIR)/$(LINUXDIR) M=$(PWD) clean

 

#endif

QuoteReplyEditDelete

 

 

2010-03-10 12:14:58     Re: Out-of-Tree Module Build Question - Binary Differences

Mike Frysinger (UNITED STATES)

Message: 87051   

 

running your host strip makes no sense.  use the cross-target one.

QuoteReplyEditDelete

 

 

2010-03-10 14:55:33     Re: Out-of-Tree Module Build Question - Binary Differences

David Kasper (UNITED STATES)

Message: 87061   

 

Mike,

 

It works, sorry I am new to this.  I needed to type "bfin-uclinux-strip -g *.ko."

 

- Dave

QuoteReplyEditDelete

 

 

2010-03-10 15:02:58     Re: Out-of-Tree Module Build Question - Binary Differences

Mike Frysinger (UNITED STATES)

Message: 87062   

 

good to know ... i wasnt really sure it would

Attachments

    Outcomes