Find the answer to your Linux question:
Results 1 to 7 of 7
HI, I complied a simple g++ "helloworld" program on my Redhat enterprise 5 desktop. It has a linux 2.6.18-53.el5 kernel. The g++ compiler was version 4.1.2. I used the following ...
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    11

    FATAL: kernel too old

    HI,
    I complied a simple g++ "helloworld" program on my Redhat enterprise 5 desktop. It has a linux 2.6.18-53.el5 kernel. The g++ compiler was version 4.1.2.

    I used the following command: g++ -ohello -Wall -static helloworld.cpp to compile the program. It runs and prints "hello world " to the screen on my Redhat desktop.

    I then transerred the binary to another linux machine that has linux 2.4.22 in it. Both machines are 686 machines.

    When I try to run the program, I get FATAL: kernel to old.

    What do I need to do to make my simple program run on the other platform?

    Thanks,
    Keith Stallings

  2. #2
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    Quote Originally Posted by mhuman1 View Post
    What do I need to do to make my simple program run on the other platform?
    portability means the portability of the source code and not of the binaries , the glibc of redhat is compiled with --enable-kernel=2.6.0 , however binaries can be ported from any version of the 2.6.x series of the kernel but not to the 2.4.x kernels (there is some important difference ) , so compile your source again .

    Regards.
    Linux is not only an operating system, it's a philosophy.
    Archost.

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Posts
    11
    aliov,
    My understanding is that you are telling me to re-compile the program on the destination computer with the 2.4.x kernel. Unfortunately, it is an embedded linux system and doesn't have compilers on it.
    Does this mean that I have to set up a computer with a 2.4.x kernel installed, then re-compile my program on that computer?

    Thanks for your help. I am REALLY doing on the job training.
    Thanks again,
    Keith Stallings

  4. #4
    Just Joined!
    Join Date
    Nov 2007
    Posts
    11
    aliov,
    I have a computer that has 2.4 on it. I'll use it for now. For the Red Hat, it seems that I need to download the 2.4 glibc source and compile it using the enable-kernel=2.4 option. I'll have to make sure that I put it into another directory so I won't write over the 2.6 libraries. Am I on the right track?

    thanks,
    Keith Stallings

  5. #5
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    Quote Originally Posted by mhuman1 View Post
    For the Red Hat, it seems that I need to download the 2.4 glibc source and compile it using the enable-kernel=2.4 option. I'll have to make sure that I put it into another directory so I won't write over the 2.6 libraries. Am I on the right track?
    this is bit tricky , i've never done it with glibc , i mean if everything goes fine and you installed the glibc package in another prefix are you able to link your compiler to it while compiling ! i don't think this will work .

    So yes it's better to have a working 2.4.x based linux distro .
    mainly now the kernel 2.6.x is the most supported one and features/drivers are added inside, and almost all the major distributions running 2.6.x kernels if you want a good 2.4.x distro to compile i would suggest Slackware 11.0 .

    Regards.
    Linux is not only an operating system, it's a philosophy.
    Archost.

  6. #6
    Just Joined!
    Join Date
    Nov 2007
    Posts
    11
    aliov,
    Can you download a pre-compiled glib. This way I could put the object code in anohter library without having to through all the compiling of the source?

  7. #7
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    no i don't think this will work as well , cause the rpm are very complicated and while installing it'll complain a lot about dependencies error , and most probably it's compiled with the same prefix ,so it'll overwrite the old one .

    Sure there is a solution to have both and link against any of them if needed , but really i never did this with glibc , i have some old and new libraries installed with different prefix, but not glibc, since this is essential and to build it , it's very tricky, so the best way it's to have another 2.4.x distro , or if you want to spend time try to compile it from source you can follow what is done in LFS to have an idea how it can be done

    6.9.*Glibc-2.5.1
    Linux is not only an operating system, it's a philosophy.
    Archost.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...