On Tue, Apr 16, 2002 at 01:43:48PM -0400, Tung-Sing Chong wrote:
> Florian,
>
> Thanks for your respond.  "add this as a patch to the kernel src.rpm and
> then rebuild the ...."--> Do you mean rebuilding the kernel with 2.4.9-31
> source tree and compile  my file again? Anyway I did the following ways and
> got the same error:
>
> 1 - applied "kernel-2.4.9-31.s390.rpm", "modutils-2.4.13-0.7.1.s390.rpm",
> "kernel-source-2.4.9-31.s390.rpm" and "kernel-headers-2.4.9-31.s390.rpm".
>       IPLed the system with shipped 2.4.9-31 kernel and compiled the
> testvm.c from /usr/src/linux2.4.9-31 tree.
>
> 2 - Rebuilt the kernel with the 2.4.9.-31 updates. IPLed the system with
> the rebuilt kernel and compiled the testvm.c from /usr/src/linux2.4.9-31
> tree.
>
> However when I changed  the Makefile in the directory
> "/usr/src/linux2.4/drivers/s390/net" to include the testvm.o and did the
> "make modules", the testvm.c was complied with only warning (no undeclared
> error). I did this on both 2.4.9-17 and 2.4.9-31 kernel and trees. And I
> was also able to insmod the testvm.o with no error.


This is a good possibility to compile a module matching one kernel. Though
there is no guarantee that one module can be used for the 4 different kernel
versions that we ship with Red Hat Linux.

Your above method works fine for a fast development cycle, but if you want
to distribute the modules to other people, you should compile the module
against all four kernel versions we ship and that can be most easily be
done by using the source rpm, adding this new module and recompiling the
whole kernel.

cu,

Florian La Roche


> (I do not have to do this on SuSE SLES-7.0).
>
> The changed (in bold) /usr/src/linux2.4/drivers/s390/net/Makefile:
> ----------------------------------------------
> #
> # S/390 network devices
> #
>
> O_TARGET := s390-net.o
>
> list-multi := ctc.o
> export-objs := iucv.o fsm-s390.o
>
> ctc-objs := ctcmain.o ctctty.o testvm.o
>
> obj-y += iucv.o fsm-s390.o
> obj-$(CONFIG_CTC) += ctc.o
> obj-$(CONFIG_IUCV) += netiucv.o
>
> include $(TOPDIR)/Rules.make
>
> ctc.o: $(ctc-objs)
>         $(LD) -r -o $@ $(ctc-objs)
>
>
> My scaled down (only have #includes and #defines) "testvm.c":


Too bad, I thought I could see the whole source. :-) :-)


> --------------------------------------------
> /*********************************************************************/
> /*********************************************************************/
>
> /* Debug defines */
> /* #define DEBUG 1 */
> /* #define DEBUG_MORE */
>
> #define MODULE
>
> /* includes */
> #include <linux/module.h>
> #include <linux/autoconf.h>
> #if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
> #  define MODVERSIONS
> #endif
> #ifdef MODVERSIONS
> #  include <linux/modversions.h>
> #endif
> #include <linux/kernel.h>
> #include <linux/config.h>
> #include <linux/errno.h>
> #include <linux/socket.h>
> #include <linux/sched.h>
> #include <linux/time.h>
> #include <linux/string.h>
> #include <linux/net.h>
> #include <linux/mm.h>
> #include <linux/interrupt.h>
> #include <linux/proc_fs.h>
> #include <linux/init.h>
> #include <linux/poll.h>
> #include <linux/inet.h>
> #include <linux/skbuff.h>
> #include <linux/unistd.h>
> #include <linux/if_arp.h>
> #include <linux/route.h>
> #include <net/protocol.h>
> #include <net/sock.h>
> #include <net/inet_common.h>
> #include <asm/io.h>
> #include <asm/system.h>
> #include <asm/ebcdic.h>
> #include <linux/version.h>
>
> We are currently working on porting an application on to 2.4 kernel.
>  We did that for SuSE-SLES 7.0 (2.4.7) and now we like to work on the Redhat 
>distribution.
> Any help will be greatly appreciated. Thanks,
>
> Chong
>
>
> Tung-Sing Chong
> Software Engineer
> VM development, IBM S/390 Software
> Endicott, NY
> T/l : 852-5342 Outside Phone: 607-752-5342
> E-mail: [EMAIL PROTECTED]
>
>
> Florian La Roche <[EMAIL PROTECTED]>@VM.MARIST.EDU> on 04/12/2002 04:57:35
> PM
>
> Please respond to Linux on 390 Port <[EMAIL PROTECTED]>
>
> Sent by:    Linux on 390 Port <[EMAIL PROTECTED]>
>
>
> To:    [EMAIL PROTECTED]
> cc:
> Subject:    Re: compile error with 31-bit RedHat 7.2
>
>
>
> On Fri, Apr 12, 2002 at 03:38:16PM -0400, Tung-Sing Chong wrote:
> > Hi,
> >
> > I been trying to compile a test c file on my 31-bit RedHat 7.2 and  I got
> > the "/usr/src/linux-2.4.9-31/include/asm/pgalloc.h:225:
> > 'machine_flags_Rsmp_69afa35e' undeclared (first use in this function)"
> > error. Please see the following:
>
> I'd advise to add this as a patch to the kernel src.rpm and then rebuild
> the complete kernel to build kernel modules. Or unpack the kernel, select
> your correct config "cp linux/configs/* linux/.config; make oldconfig; ..."
> and build your modul in that tree.
>
> Or just send your testvm.c file here... :-)
>
> cu,
>
> Florian La Roche
>
>
> >
> > [root@lxssl6 linux-2.4]# make
> /usr/src/linux-2.4/drivers/s390/net/testvm.o
> > gcc -D__KERNEL__ -I/usr/src/linux-2.4.9-31/include -Wall
> -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
> > -fno-strict-aliasing -fno-common -Wno-unused -pipe -fno-strength-reduce
> > -c -o /usr/src/linux-2.4/drivers/s390/net/testvm.o
> /usr/src/linux-2.4/drivers/s390/net/testvm.c
> > In file included from /usr/src/linux-2.4.9-31/include/linux/highmem.h:5,
> >                  from /usr/src/linux-2.4.9-31/include/linux/skbuff.h:27,
> >                  from /usr/src/linux-2.4/drivers/s390/net/testvm.c:117:
> > /usr/src/linux-2.4.9-31/include/asm/pgalloc.h: In function
> `global_flush_tlb':
> > /usr/src/linux-2.4.9-31/include/asm/pgalloc.h:225:
> `machine_flags_Rsmp_69afa35e' undeclared (first use in this function)
> > /usr/src/linux-2.4.9-31/include/asm/pgalloc.h:225: (Each undeclared
> identifier is reported only once
> > /usr/src/linux-2.4.9-31/include/asm/pgalloc.h:225: for each function it
> appears in.)
> > make: *** [/usr/src/linux-2.4/drivers/s390/net/testvm.o] Error 1
> >
> > I did the compilations on both the 2.4.9-17 and 2.4.9.31 kernel souce
> trees and get the same error. The line 225 of
> > /usr/src/linux-2.4.9-31/include/asm/pgalloc.h  is -->  "if
> (MACHINE_HAS_CSP)".  The MACHINE_HAS_CSP is defined in
> > /usr/src/linux-2.4/include/asm/setup.h as :
> >                    extern unsigned long machine_flags;
> >                    #define MACHINE_HAS_CSP  (machine_flags & 8)
> >
> > When I defined the MACHINE_HAS_CSP in pgalloc.h, I get a warning meesage
> indicated that the MACHINE_HAS_CSP already
> > defined in setup.h and the compilation completed with no error.
> >
> > I was able to compiled the same test file in SuSE SLES-7.0 without any
> error or problem.  Am I missing something on my RedHat system.
> > Any help will be greatly appreciated. Thanks,
> >
> > Chong
> >
> > Tung-Sing Chong
> > Software Engineer
> > VM development, IBM S/390 Software
> > Endicott, NY
> > T/l : 852-5342 Outside Phone: 607-752-5342
> > E-mail: [EMAIL PROTECTED]

Reply via email to