glibc编译过程记录
本文参考这篇文章 首先使用apt安装编译所需依赖 1
sudo apt build-dep glibc
1
2
3
4cd ~/Downloads
mkdir glibc-recompile
cd glibc-recompile
sudo apt-get source glibc
修改一些文件以设置优化 1
cd glibc-2.24/debian
1
2BUILD_CFLAGS = -O2 -g
HOST_CFLAGS = -pipe -O2 -g $(call xx,extra_cflags)1
2BUILD_CFLAGS = -O2 -march=native -mtune=native
HOST_CFLAGS = -pipe -O2 $(call xx,extra_cflags) -march=native -mtune=native1
2
3
4amd64_CC = $(CC) -m64 -march=native -mtune=native
amd64_CXX = $(CXX) -m64 -march=native -mtune=native
i386_CC = $(CC) -m32 -march=native -mtune=native
i386_CXX = $(CXX) -m32 -march=native -mtune=native1
dch
1
glibc (2.24-11+deb9u3) UNRELEASED; urgency=medium
1
dpkg -l|grep libc6
1
debuild -us -uc
1
DEB_BUILD_OPTIONS=nocheck debuild -us -uc
1
sudo dpkg -i ./\.deb
1
sudo apt-mark hold glibc-doc glibc-source libc6 libc6-dbg libc6-dev libc6-dev-i386 libc6-dev-x32 libc6-i386 libc6-pic libc6-x32 nscd