Compile error with 2.3.99-Pre2

Compile error with 2.3.99-Pre2

Post by Mike Dowli » Wed, 22 Mar 2000 04:00:00



In case it is of interest to anybody, I get

gcc -D__KERNEL__ -I/usr/src/linux/include -D__SMP__ -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -pipe
-mpreferred-stack-boundary=2 -DCPU=586 -march=i586 -fno-strict-aliasing
-c -o shm.o shm.c
shm.c:142: `THIS_MODULE' undeclared here (not in a function)
shm.c:142: initializer element is not constant
shm.c:142: (near initialization for `shm_fs_type.owner')
make[2]: *** [shm.o] Error 1
make[2]: Leaving directory `/usr/src/linux/ipc'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux/ipc'
make: *** [_dir_ipc] Error 2

I could not work out what exactly went wrong.

Cheers,
Mike

--

It is, in fact, a sendmail alias; the digit 'N' is incremented regularly.
Spammed aliases will be deleted.  Currently, mike[21,22]
are valid.  If email to mikeN bounces, try mikeN+1.

 
 
 

Compile error with 2.3.99-Pre2

Post by Robert Lync » Wed, 22 Mar 2000 04:00:00



> In case it is of interest to anybody, I get

> gcc -D__KERNEL__ -I/usr/src/linux/include -D__SMP__ -Wall
> -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe
> -mpreferred-stack-boundary=2 -DCPU=586 -march=i586 -fno-strict-aliasing
> -c -o shm.o shm.c
> shm.c:142: `THIS_MODULE' undeclared here (not in a function)
> shm.c:142: initializer element is not constant
> shm.c:142: (near initialization for `shm_fs_type.owner')
> make[2]: *** [shm.o] Error 1
> make[2]: Leaving directory `/usr/src/linux/ipc'
> make[1]: *** [first_rule] Error 2
> make[1]: Leaving directory `/usr/src/linux/ipc'
> make: *** [_dir_ipc] Error 2

> I could not work out what exactly went wrong.

> Cheers,
> Mike

I got it to compile by adding a line to ipc/shm.c
======
...
 * - mode is the mode for the root directory (default S_IRWXUGO |
S_ISVTX)
 */
/* 3-20-00 they forget to include module.h! */
#include <linux/module.h>

#include <linux/config.h>
...
=======

HTH. Bob L.

> --

> It is, in fact, a sendmail alias; the digit 'N' is incremented regularly.
> Spammed aliases will be deleted.  Currently, mike[21,22]
> are valid.  If email to mikeN bounces, try mikeN+1.

--


 
 
 

Compile error with 2.3.99-Pre2

Post by nbec.. » Wed, 22 Mar 2000 04:00:00


#include <linux/module.h>
 
 
 

Compile error with 2.3.99-Pre2

Post by Mike Dowli » Thu, 23 Mar 2000 04:00:00



Quote:>#include <linux/module.h>

That  did the job, but....

ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o
init/version.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
        mm/mm.o fs/fs.o ipc/ipc.o \
        drivers/block/block.a drivers/char/char.o drivers/misc/misc.o
        drivers/net/net.o drivers/parport/parport.a
        drivers/char/drm/drm.o drivers/scsi/scsi.a drivers/cdrom/cdrom.a
        drivers/sound/sounddrivers.o drivers/pci/pci.a drivers/pnp/pnp.o
        drivers/video/video.o \
        net/network.a \
        /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
        /usr/src/linux/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux
fs/fs.o: In function `msdos_partition':
fs/fs.o(.text+0x1f6c5): undefined reference to `ide_xlate_1024'
fs/fs.o(.text+0x1f6f5): undefined reference to `ide_xlate_1024'
fs/fs.o(.text+0x1f77e): undefined reference to `ide_xlate_1024'
drivers/sound/sounddrivers.o: In function `sb_dsp_unload':
drivers/sound/sounddrivers.o(.text+0x1535): undefined reference to
`sbmixnum'
make: *** [vmlinux] Error 1

Cheers,
Mike

--

It is, in fact, a sendmail alias; the digit 'N' is incremented regularly.
Spammed aliases will be deleted.  Currently, mike[21,22]
are valid.  If email to mikeN bounces, try mikeN+1.

 
 
 

1. kernel 2.3.99-pre2 compilation ends with error ???

Hello,

I've downloaded the 2.3.99-pre2 kernel and wanted to see
whether I could compile it myself.

I've done:

make mrproper
make menuconfig
make dep
make clean
make bzImage

The latter ends with:

[snip]
shm.c:142: `THIS_MODULE' undeclared here (not in a function)
shm.c:142: initializer element for `shm_fs_type.owner' is not constant
make[2]: *** [shm.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.3.99-pre2/ipc'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.3.99-pre2/ipc'
make: *** [_dir_ipc] Error 2

Have I done something wrong or does the 2.3 kernel more than just
downloading the source code of the kernel?

I have currently RedHat 6.2beta with kernel 2.2.15.

Thanks,

Rob.

2. finger: Who fingers me?

3. new kernel compile problems [2.3.99-pre9]

4. named: preventing to connect to root-servers?

5. Can't compile pci-irq.c in 2.3.99-pre9-1

6. Upgrade gcc and lib

7. Logins rejected after 2.3.99-pre5 compile

8. RPC Unable to send...

9. 2.3.99-pre6: can't compile bootsect.S

10. kernel 2.3.99-pre9 compile problem

11. modem with 2.3.99-pre5

12. ppp and 2.3.99-pre5

13. 2.3.99-pre? and /boot