1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
12 url = http://www.gnu.org/software/libc/libc.html
13 license = GPLv2+ LGPLv2+
14 summary = The GNU libc libraries.
17 The glibc package contains standard libraries which are used by
18 multiple programs on the system. In order to save disk space and
19 memory, as well as to make upgrading easier, common system code is
20 kept in one place and shared between programs. This particular package
21 contains the most important sets of shared libraries: the standard C
22 library and the standard math library. Without these two libraries, a
23 Linux system will not function.
26 source_dl = https://ftp.gnu.org/gnu/glibc/
27 sources = %{thisapp}.tar.xz
30 # Optimize glibc for kernel
31 OPTIMIZED_KERNEL = 3.2
40 kernel-headers >= %{OPTIMIZED_KERNEL}
48 # Build glibc with custom cflags
49 GLIBC_FLAGS = -O2 -g -DNDEBUG -pipe
51 if "%{DISTRO_ARCH}" == "x86_64"
52 GLIBC_FLAGS += -mtune=generic
55 export CFLAGS = %{GLIBC_FLAGS}
56 export CXXFLAGS = %{GLIBC_FLAGS}
59 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
60 # unknown whether this is a bash bug or a Glibc problem. Disable
61 # installation of this locale in order to avoid the problem.
62 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
64 # The ldd shell script contains Bash-specific syntax. Change its default
65 # program interpreter to /bin/bash in case another /bin/sh is installed.
66 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
68 # We don't install pt_chown(1) on the final system
69 sed -e "/^install.*pt_chown/d" -i login/Makefile
71 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
72 sed -e "s/fstack-protector/&-strong/" -i nscd/Makefile
76 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
78 # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
79 sed -e "s/PIC/SHARED/g" -i sysdeps/arm/{set,__long}jmp.S
83 --build=%{DISTRO_BUILDTARGET} \
85 --libexecdir=%{libdir}/glibc \
88 --enable-kernel=%{OPTIMIZED_KERNEL} \
91 --enable-stack-protector=strong \
93 --enable-obsolete-rpc \
94 --with-bugurl=https://bugtracker.ipfire.org \
95 --enable-lock-elision \
99 mkdir -p %{DIR_SRC}/glibc-build
100 cd %{DIR_SRC}/glibc-build
102 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
103 ../%{thisapp}/configure \
106 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
107 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
111 cd %{DIR_SRC}/glibc-build
112 make install install_root=%{BUILDROOT}
115 mkdir -pv %{BUILDROOT}/usr/lib/locale
116 # This would install all locales that are supported
117 make localedata/install-locales install_root=%{BUILDROOT}
120 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
121 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
123 # Remove unused binaries
124 rm -vf %{BUILDROOT}/sbin/sln \
125 %{BUILDROOT}/usr/bin/rpcinfo
127 # Don't distribute linker cache
128 rm -vf %{BUILDROOT}/etc/ld.so.cache
130 # Include /usr/lib/gconv/gconv-modules.cache
131 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
132 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
134 strip -g %{BUILDROOT}%{libdir}/*.o
136 # Move some libs to correct place
137 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
139 # Fix library permissions.
140 chmod 755 %{BUILDROOT}%{libdir}/lib*.so*
142 # rquota.x and rquota.h are now provided by quota
143 rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx]
147 %{libdir}/libc_nonshared.a
148 %{libdir}/libmvec_nonshared.a
149 %{libdir}/libpthread_nonshared.a
160 kernel < %{OPTIMIZED_KERNEL}
164 glibc-common < %{thisver}
173 glibc-headers = %{thisver}
174 kernel-headers >= %{OPTIMIZED_KERNEL}
178 glibc-headers = %{thisver}
182 glibc-headers < %{thisver}
185 files += %{libdir}/*.[ao]
189 summary = A Name Service Caching Daemon (nscd).
191 Nscd caches name service lookups and can dramatically improve
192 performance with NIS+, and may help with DNS as well.
194 group = System/Daemons
201 package %{name}-utils
202 summary = Development utilities from GNU C library.
204 The glibc-utils package contains memusage, a memory usage profiler,
205 mtrace, a memory leak tracer and xtrace, a function call tracer
206 which can be helpful during program debugging.
208 group = Development/Tools
212 /usr/bin/memusagestat
214 /usr/bin/pcprofiledump
216 %{libdir}/libmemusage.so
217 %{libdir}/libpcprofile.so
221 package %{name}-debuginfo