0

How to compile my own glibc C standard library from source and use it?

I am trying to follow the following commands shown on the above page to compile glibc.

git clone git://sourceware.org/git/glibc.git
cd glibc
git checkout glibc-2.32
mkdir build
cd build
export glibc_install="$(pwd)/install"
../configure --prefix "$glibc_install"
make -j `nproc`
make install -j `nproc`

But when I run the following command, I got errors. Could anybody let me know what is the current way to compile glibc?

$ make -j `nproc`
...
mkdir -p -- /home/xxx/glibc/build/intl
mkdir -p -- /home/xxx/glibc/build/intl
.././scripts/mkinstalldirs /home/xxx/glibc/build/intl
mkdir -p -- /home/xxx/glibc/build/intl
LC_ALL=C gawk '!/^"POT-Creation-Date: [0-9-]+ [0-9:+-]+\\n"$/' ../po/de.po > /home/xxx/glibc/build/intl/tst-gettext-de.po
mkdir -p -- /home/xxx/glibc/build/intl
bison --yacc --name-prefix=__gettext --output /home/xxx/glibc/build/intl/plural.c plural.y
echo '' > /home/xxx/glibc/build/intl/stamp.oST
mv -f /home/xxx/glibc/build/intl/stamp.oST /home/xxx/glibc/build/intl/stamp.oS
plural.y:46.1-7: warning: POSIX Yacc does not support %define [-Wyacc]
   46 | %define api.pure full
      | ^~~~~~~
plural.y:47.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
   47 | %expect 7
      | ^~~~~~~
LC_ALL=C gawk -f po2test.awk /home/xxx/glibc/build/intl/tst-gettext-de.po > /home/xxx/glibc/build/intl/msgs.h
gawk: fatal: cannot open source file `po2test.awk' for reading: No such file or directory
make[2]: *** [Makefile:129: /home/xxx/glibc/build/intl/msgs.h] Error 2
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/xxx/glibc/intl'
make[1]: *** [Makefile:470: intl/subdir_lib] Error 2
make[1]: Leaving directory '/home/xxx/glibc'
make: *** [Makefile:9: all] Error 2
user1424739
  • 11,937
  • 17
  • 63
  • 152

0 Answers0