Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Getting errors when running make on glibc

    Last week I decided to try and further my knowledge of Linux by making my own distro by following the LinuxFromScratch guide and to be expected I hit a little snag. I have looked around but I am not even sure what is happening so I have come to the experts for some help.

    I am trying to compile the glibc program for my initial toolchain. After running the make install command it ends with this.

    /mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:180: undefined reference to `__stack_chk_guard'
    /mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:483: undefined reference to `__stack_chk_guard'
    /mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os): In function `res_gethostbyaddr':
    /mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:644: undefined reference to `__stack_chk_guard'
    /mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:783: undefined reference to `__stack_chk_guard'
    /mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os): In function `__GI_res_gethostbyname2':
    /mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:510: undefined reference to `__stack_chk_guard'
    /mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os):/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:636: more undefined references to `__stack_chk_guard' follow
    collect2: error: ld returned 1 exit status
    make[2]: *** [/mnt/lfs/sources/glibc-build/resolv/] Error 1
    make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.17/resolv'
    make[1]: *** [resolv/subdir_install] Error 2
    make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.17'
    make: *** [install] Error 2
    I am still new to Linux so any help or tips would really be appreciated.

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Harrow, UK
    The error comes from the linker ld, which means that the compilation worked but the linking stage failed. There is a function referred to in the code which wasn't found in any of the modules to be linked.

    If this kind of error occurs in lfs, it's probably because you used the wrong version of something earlier on. lfs is like painting by numbers; you have to follow the instructions rigidly, including using the correct versions of all the tools in your toolchain.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

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