Re: inline functions
On Sat, Jun 4, 2016 at 9:08 PM, Augusto Mecking Caringi wrote: > On Sat, Jun 4, 2016 at 11:59 AM, Muni Sekhar wrote: >> Hi, >> >> I tested with the below mentioned code("inline.c") to understand about >> inline functions. >> >> I explicitly instructed gcc to translate inline.c to inline.s. >> >> Next I removed the inline keyword from inline.c and re-created the >> inline.s file, but I don’t see any difference in the assembly code. Is >> it correct behavior? >> >> Could you guys point few good examples to understand the concept of inline? > > Hi Muni, > > Probably gcc is automatic inlining your function even in the > absence of 'inline' keyword... > > Take a look here: > > > http://www.cocoabuilder.com/archive/xcode/269025-how-to-disable-gcc-automatic-inlining.html Thanks Augusto. > > And here: > > https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html > > There are a few inline related flags, including this: > > -finline-functions-called-once > Consider all static functions called once for inlining into their > caller even if they are not marked inline. If a call to a given > function is integrated, then the function is not output as assembler > code in its own right. > Enabled at levels -O1, -O2, -O3 and -Os. > > Best regards, > > -- > Augusto Mecking Caringi -- Thanks, Sekhar ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Building modules: missing scripts/basic/Makefile
Hi Steven, On Mon, Jun 6, 2016 at 12:14 AM, Steven Laabs wrote: > Hi, > > I'm trying to build my first kernel module but when running the makefile, > make tries to use a file at > /usr/src/linux-headers-3.16.0-4-common/scripts/basic/Makefile which gives me > the "No such file or directory" error. I've looked into the folder it is > referencing and it does not have any Makefile, the only file in that > location is the fixdep executable. The scripts folder itself is linked to > ../../lib/linux-kbuild-3.16/scripts. > > The Makefile I am using (located in a folder in my home directory): > > obj-m = hello.o > KDIR ?= /lib/modules/$(shell uname -r)/build > > all: > make -C $(KDIR) M=$(PWD) modules > > clean: > make -C $(KDIR) M=$(PWD) clean > > I'm not quite sure where to look for this Makefile as I believe I have all of > the proper headers installed, and I am running everything with the proper > permission level. > > Any ideas on what I may be missing here? > > Thanks, > Steven > You should use "+=" and not "=" -- obj-m = hello.o ++ obj-m += hello.o ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Building modules: missing scripts/basic/Makefile
Hi, I'm trying to build my first kernel module but when running the makefile, make tries to use a file at /usr/src/linux-headers-3.16.0-4-common/scripts/basic/Makefile which gives me the "No such file or directory" error. I've looked into the folder it is referencing and it does not have any Makefile, the only file in that location is the fixdep executable. The scripts folder itself is linked to ../../lib/linux-kbuild-3.16/scripts. The Makefile I am using (located in a folder in my home directory): obj-m = hello.o KDIR ?= /lib/modules/$(shell uname -r)/build all: make -C $(KDIR) M=$(PWD) modules clean: make -C $(KDIR) M=$(PWD) clean I'm not quite sure where to look for this Makefile as I believe I have all of the proper headers installed, and I am running everything with the proper permission level. Any ideas on what I may be missing here? Thanks, Steven ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies