derle.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. cd $SRC/linux-4.19
  2. make mrproper
  3. make headers_check
  4. make INSTALL_HDR_PATH=dest headers_install
  5. find dest/include \( -name .install -o -name ..install.cmd \) -delete
  6. mkdir -p $PKG/usr/include
  7. cp -rv dest/include/* $PKG/usr/include
  8. rm -rf $SRC/linux-4.19
  9. cd $SRC/glibc-$surum
  10. patch -Np1 -i $SRC/glibc-$surum-fhs-1.patch || exit 1
  11. # glibc'in son halinde tools a link olmaması için
  12. ln -sfv /tools/lib/gcc /usr/lib
  13. #[ -f /usr/include/limits.h ] && rm -f /usr/include/limits.h
  14. # 64bit için gerekli kısayollar
  15. mkdir $PKG/usr/lib
  16. GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include
  17. ln -s ../lib/ld-linux-x86-64.so.2 $PKG/usr/lib
  18. ln -s ../lib/ld-linux-x86-64.so.2 $PKG/usr/lib/ld-lsb-x86-64.so.3
  19. mkdir -v build
  20. cd build
  21. echo "slibdir=/usr/lib" >> configparms
  22. echo "rtlddir=/usr/lib" >> configparms
  23. echo "sbindir=/usr/bin" >> configparms
  24. echo "rootsbindir=/usr/bin" >> configparms
  25. # remove stack protector for libs
  26. CFLAGS=${CFLAGS/-fstack-protector/}
  27. CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
  28. #CC="gcc -ffile-prefix-map=/tools=/usr" \
  29. CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" \
  30. ${SRC}/glibc-${surum}/configure --prefix=/usr \
  31. --libdir=/usr/lib --libexecdir=/usr/lib \
  32. --with-bugurl=https://milislinux.org \
  33. --disable-werror \
  34. --enable-kernel=3.2 \
  35. --enable-stack-protector=strong \
  36. --disable-timezone-tools
  37. # build libs without stack protector
  38. echo "build-programs=no" >> configparms
  39. make
  40. # build bins with stack protector
  41. sed -i "/build-programs=/s#no#yes#" configparms
  42. echo "CC += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
  43. echo "CXX += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
  44. make
  45. # no stack protector for running tests
  46. sed -i '5,7d' configparms
  47. sed -i '/FORTIFY/d' configparms
  48. unset GCC_INCDIR