All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toralf Lund <toralf@procaptura.com>
To: linux-kernel@vger.kernel.org
Subject: Re: kernel load issues (insmod segfault)
Date: Fri, 01 Apr 2005 16:00:39 +0200	[thread overview]
Message-ID: <424D5407.6070003@procaptura.com> (raw)
In-Reply-To: <424D467F.3090700@procaptura.com>

Toralf Lund wrote:

> Hi.
>
> I thought I might try this one again (with updated code and more 
> compete info):

Right. I think maybe I've made some kind of stupid mistake. Sorry.

I looked, and looked again, and just couldn't find anything wrong with 
the module (so it must be the kernel, right?), but I looked the wrong 
place, of course. It was the build flags, not the source code...

[ ... ]

>
>
> # make itifg8tst.o
> gcc -pipe -Wall -O2  -DLinux -mcpu=i686 -I../../include -fno-common 
> -fno-strict-aliasing -fomit-frame-pointer -nostdinc -I. 
> -I/lib/modules/2.6.11.4-0.EL.toralf/build/include 
> -I/usr/lib/gcc/i386-redhat-linux/3.4.3/include -D__KERNEL__ -DMODULE 
> -I/lib/modules/2.6.11.4-0.EL.toralf/build/include/asm-i386/mach-default 
> -o itifg8tst.o -c itifg8tst.c

It seems like this is not quite right. I've now changed this build flags 
based on the module build setup of the kernel sources, so that I have

gcc    -DLinux -mpreferred-stack-boundary=2 -fno-unit-at-a-time 
-march=i686 -mregparm=3  -I../../include -fno-strict-aliasing 
-fno-common -ffreestanding -fomit-frame-pointer -nostdinc -I. 
-I/lib/modules/2.6.11.4-0.EL.toralf/build/include -isystem 
/usr/lib/gcc/i386-redhat-linux/3.4.3/include -D__KERNEL__ -DMODULE 
-I/lib/modules/2.6.11.4-0.EL.toralf/build/include/asm-i386/mach-default 
-o itifg8.mod.o -c itifg8.mod.c

and the module works!

I'm not sure what exactly did the trick, though. (Although I guess the 
distinction between -march and just -mcpu might be significant.). If 
someone would like to explain more about the different flags, just go 
ahead....

- Toralf


      reply	other threads:[~2005-04-01 14:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-01 13:02 kernel load issues (insmod segfault) Toralf Lund
2005-04-01 14:00 ` Toralf Lund [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=424D5407.6070003@procaptura.com \
    --to=toralf@procaptura.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.