Simplify source.sh, fix dependencies and enable CET support

This commit is contained in:
2025-04-14 19:41:51 +03:00
parent e1b84f1c8b
commit 898c929fff
2 changed files with 36 additions and 15 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
name: glibc
description: The GNU C Library
version: 2.41
revision: 2
revision: 3
url: https://www.gnu.org/software/libc/
license: GPL2-or-later
license: GPL2-or-later,LGPL2.1-or-later,BSD-3-Clause
architecture: any
make_depends: ["bash","binutils","bison","coreutils","diffutils","gawk","gcc","gettext","grep","gzip","make","perl","python3","sed","texinfo"]
provides: ["libc"]
+34 -13
View File
@@ -17,14 +17,21 @@ prepare() {
build() {
mkdir -p build
cd build
# Install system binaries to /usr/sbin
echo "rootsbindir=/usr/sbin" > configparms
../configure --prefix=/usr \
--disable-werror \
--enable-kernel=5.4 \
--enable-stack-protector=strong \
--disable-nscd \
../configure --prefix=/usr \
--with-headers=/usr/include \
--enable-kernel=5.4 \
--enable-cet \
--enable-stack-protector=strong \
--disable-werror \
--disable-nscd \
libc_cv_slibdir=/usr/lib
make
# Generate locales here because localedef does not work in fakeroot
make -C "$BPM_SOURCE"/localedata objdir="$BPM_SOURCE"/build DESTDIR="${BPM_WORKDIR}"/locales install-locale-files
}
@@ -36,6 +43,7 @@ check() {
sed -i "/tst-thread-affinity-sched/d" nptl/Makefile
cd build
make check
}
@@ -43,22 +51,35 @@ check() {
# This function is used to move the compiled files into the output directory
package() {
cd build
make DESTDIR="$BPM_OUTPUT" install
# Fix hardcoded path
sed '/RTLDLIST=/s@/usr@@g' -i "$BPM_OUTPUT"/usr/bin/ldd
mkdir -p "$BPM_OUTPUT"/usr/lib/locale
mkdir -p "$BPM_OUTPUT"/etc
mkdir -p "$BPM_OUTPUT"/usr/share/i18n
sed -e '1,3d' -e 's|/| |g' -e 's| \\||g' "$BPM_SOURCE"/localedata/SUPPORTED > "$BPM_OUTPUT"/usr/share/i18n/SUPPORTED
# Install locale-gen script
install -Dm755 "$BPM_WORKDIR"/locale-gen "$BPM_OUTPUT"/usr/bin/locale-gen
# Create locale.gen file
install -dm755 "$BPM_OUTPUT"/etc
touch "$BPM_OUTPUT"/etc/locale.gen
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' "$BPM_SOURCE"/localedata/SUPPORTED >> "$BPM_OUTPUT"/etc/locale.gen
sed -i '/#C\.UTF-8 /d' "$BPM_OUTPUT"/etc/locale.gen
# Create SUPPORTED file
install -dm755 "$BPM_OUTPUT"/usr/share/i18n
sed -e '1,3d' -e 's|/| |g' -e 's| \\||g' "$BPM_SOURCE"/localedata/SUPPORTED > "$BPM_OUTPUT"/usr/share/i18n/SUPPORTED
# Install C.UTF-8 so that it is always available
install -dm55 "$BPM_OUTPUT"/usr/lib/locale
cp -r "$BPM_WORKDIR"/locales/usr/lib/locale/C.utf8 -t "$BPM_OUTPUT"/usr/lib/locale
cp "$BPM_WORKDIR"/locale-gen "$BPM_OUTPUT"/usr/bin/locale-gen
mkdir -p "$BPM_OUTPUT"/lib64/
sed -i '/#C\.UTF-8 /d' "$BPM_OUTPUT"/etc/locale.gen
# Symlink glibc dynamic linker to /lib64
install -dm755 "$BPM_OUTPUT"/lib64/
ln -sf ../lib/ld-linux-x86-64.so.2 "$BPM_OUTPUT"/lib64
ln -sf ../lib/ld-linux-x86-64.so.2 "$BPM_OUTPUT"/lib64/ld-lsb-x86_64.so.3
chmod +x "$BPM_OUTPUT"/usr/bin/locale-gen
# Install package licenses
install -Dm644 "$BPM_SOURCE"/LICENSES "$BPM_OUTPUT"/usr/share/licenses/glibc/LICENSES
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/glibc/COPYING
install -Dm644 "$BPM_SOURCE"/COPYING.LIB "$BPM_OUTPUT"/usr/share/licenses/glibc/COPYING.LIB