"fatal error: gnu/stubs-32.h: No such file or directory" but stubs-64.h is present

10,579

Solution 1

On Ubuntu

sudo apt install libc6-dev:i386

Solution 2

On a system like Centos 6, you can get the 32 bit libraries with this command: sudo yum -y install glibc-devel.i686 glibc-devel

Share:
10,579
abcd
Author by

abcd

Updated on June 04, 2022

Comments

  • abcd
    abcd almost 2 years

    I'm running Linux as follows:

    dbliss@nx4[objdir]> uname -a
    Linux nx4.priv 2.6.32-573.3.1.el6.x86_64 #1 SMP Thu Aug 13 22:55:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    dbliss@nx4[objdir]> cat /etc/*release
    CentOS release 6.7 (Final)
    LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
    CentOS release 6.7 (Final)
    CentOS release 6.7 (Final)
    

    I just downloaded version 4.8.4 of gcc and attempted to configure and build it as follows:

    dbliss@nx4[objdir]> ~/srcdir/configure --prefix=$HOME --with-gmp=$HOME
    dbliss@nx4[objdir]> make
    

    The last of these commands raised the following error:

    make[5]: Entering directory `/home/despo/dbliss/objdir/x86_64-unknown-linux-gnu/32/libgcc'
    # If this is the top-level multilib, build all the other
    # multilibs.
    DEFINES='' HEADERS='/home/despo/dbliss/srcdir/libgcc/config/i386/value-unwind.h' \
            /home/despo/dbliss/srcdir/libgcc/mkheader.sh > tmp-libgcc_tm.h
    /bin/sh /home/despo/dbliss/srcdir/libgcc/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
    echo timestamp > libgcc_tm.stamp
    /home/despo/dbliss/objdir/./gcc/xgcc -B/home/despo/dbliss/objdir/./gcc/ -B/home/despo/dbliss/x86_64-unknown-linux-gnu/bin/ -B/home/despo/dbliss/x86_64-unknown-linux-gnu/lib/ -isystem /home/despo/dbliss/x86_64-unknown-linux-gnu/include -isystem /home/despo/dbliss/x86_64-unknown-linux-gnu/sys-include    -g -O2 -m32 -O2  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../../.././gcc -I/home/despo/dbliss/srcdir/libgcc -I/home/despo/dbliss/srcdir/libgcc/. -I/home/despo/dbliss/srcdir/libgcc/../gcc -I/home/despo/dbliss/srcdir/libgcc/../include -I/home/despo/dbliss/srcdir/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS  -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /home/despo/dbliss/srcdir/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
    In file included from /usr/include/features.h:385:0,
                     from /usr/include/stdio.h:28,
                     from /home/despo/dbliss/srcdir/libgcc/../gcc/tsystem.h:87,
                     from /home/despo/dbliss/srcdir/libgcc/libgcc2.c:27:
    /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
     # include <gnu/stubs-32.h>
                               ^
    compilation terminated.
    make[5]: *** [_muldi3.o] Error 1
    make[5]: Leaving directory `/home/despo/dbliss/objdir/x86_64-unknown-linux-gnu/32/libgcc'
    make[4]: *** [multi-do] Error 1
    make[4]: Leaving directory `/home/despo/dbliss/objdir/x86_64-unknown-linux-gnu/libgcc'
    make[3]: *** [all-multi] Error 2
    make[3]: Leaving directory `/home/despo/dbliss/objdir/x86_64-unknown-linux-gnu/libgcc'
    make[2]: *** [all-stage1-target-libgcc] Error 2
    make[2]: Leaving directory `/home/despo/dbliss/objdir'
    make[1]: *** [stage1-bubble] Error 2
    make[1]: Leaving directory `/home/despo/dbliss/objdir'
    make: *** [all] Error 2
    

    What I get from this is that make expects a file stubs-32.h in /usr/include/gnu/, but can't find it.

    However, I do have a file stubs-64.h in this directory:

    dbliss@nx4[objdir]> ls /usr/include/gnu
    libc-version.h  lib-names.h  stubs-64.h  stubs.h
    

    My question is, should I be specifying somehow in my call to configure that I'm using a 64-bit system and, therefore, that stubs-64.h should be used? Or is stubs-32.h always required? If stubs-32.h is required, what is the best way for me to acquire and install it -- given that I am not an administrator of this computing system and would need to install it locally (and have make find it locally).