skip to Main Content

the steps is:

  1. update the make version to 4.8
  2. update the gcc version to 12.2.0
  3. Perform the following steps to compile glibc:
tar zxf glibc-2.28.tar.gz && cd glibc-2.28
mkdir build && cd build

../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

make -j 8

I got like the following:

inux-gnu/12.2.0/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include /root/source/glibc-2.28/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc 
        -DGEN_AS_CONST_HEADERS -x c - 
        -MD -MP -MF /root/source/glibc-2.28/build/tcb-offsets.h.dT -MT '/root/source/glibc-2.28/build/tcb-offsets.h.d /root/source/glibc-2.28/build/tcb-offsets.h'
In file included from ../include/pthread.h:1,
                 from ../nptl/../nptl_db/thread_db.h:25,
                 from ../nptl/descr.h:32,
                 from ../sysdeps/x86_64/nptl/tls.h:130,
                 from ../sysdeps/unix/sysv/linux/x86_64/sysdep.h:24,
                 from <stdin>:1:
../sysdeps/nptl/pthread.h:744:47: error: argument 1 of type 'struct __jmp_buf_tag *' declared as a pointer [-Werror=array-parameter=]
  744 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from ../include/setjmp.h:2,
                 from ../nptl/descr.h:24:
../setjmp/setjmp.h:54:46: note: previously declared as an array 'struct __jmp_buf_tag[1]'
   54 | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
      |                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [../Makerules:287: /root/source/glibc-2.28/build/tcb-offsets.h] Error 1
make[2]: Leaving directory '/root/source/glibc-2.28/csu'
make[1]: *** [Makefile:258: csu/subdir_lib] Error 2
make[1]: Leaving directory '/root/source/glibc-2.28'
make: *** [Makefile:9: all] Error 2

Can anyone give me some help or tips? Appreciate

I tried recompiling with the make clean command, or deleting the glibc-2.28 folder altogether to retry and avoid multicore compilation without using the -j 8 parameter, but the problem persists

2

Answers


  1. Chosen as BEST ANSWER

    all right. I fix it. the solution is: after reinstall gcc 8.2 it is work. BTW, I got other error:

    x86_64-pc-linux-gnu/bin/ld: cannot find -lnss_test2
    collect2: error: ld returned 1 exit status
    Execution of gcc failed!
    

    but we can ignore this error, see :https://sourceware.org/bugzilla/show_bug.cgi?id=21911


  2. Just add the --disable-werror to your configure setup:

    $ # if you are in glibc-build
    $ ../glibc-version/configure --disable-werror ....other args ....
    

    from GNU manual:

    By default, the GNU C Library is built with -Werror. If you wish to build without this option (for example, if building with a newer
    version of GCC than this version of the GNU C Library was tested with,
    so new warnings cause the build with -Werror to fail), you can
    configure with –disable-werror.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search