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}" == "i686"
52 GLIBC_FLAGS += -march=i686 -mtune=generic
55 if "%{DISTRO_ARCH}" == "x86_64"
56 GLIBC_FLAGS += -mtune=generic
59 export CFLAGS = %{GLIBC_FLAGS}
60 export CXXFLAGS = %{GLIBC_FLAGS}
62 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
65 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
66 # unknown whether this is a bash bug or a Glibc problem. Disable
67 # installation of this locale in order to avoid the problem.
68 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
70 # The ldd shell script contains Bash-specific syntax. Change its default
71 # program interpreter to /bin/bash in case another /bin/sh is installed.
72 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
74 # We don't install pt_chown(1) on the final system
75 sed -e "/^install.*pt_chown/d" -i login/Makefile
77 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
78 sed -e "s/fstack-protector/&-strong/" -i nscd/Makefile
82 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
84 # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
85 sed -e "s/PIC/SHARED/g" -i sysdeps/arm/{set,__long}jmp.S
89 --build=%{DISTRO_BUILDTARGET} \
91 --libexecdir=%{libdir}/glibc \
94 --enable-kernel=%{OPTIMIZED_KERNEL} \
96 --enable-stack-protector=strong \
98 --enable-obsolete-rpc \
99 --with-bugurl=http://bugtracker.ipfire.org \
100 --enable-lock-elision \
103 if "%{DISTRO_ARCH}" == "armv5tel"
104 # Disable hardware FP for ARM.
105 configure_options += \
110 mkdir -p %{DIR_SRC}/glibc-build
111 cd %{DIR_SRC}/glibc-build
113 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
114 ../%{thisapp}/configure \
117 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
118 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
122 cd %{DIR_SRC}/glibc-build
123 make install install_root=%{BUILDROOT}
126 mkdir -pv %{BUILDROOT}/usr/lib/locale
127 # This would install all locales that are supported
128 make localedata/install-locales install_root=%{BUILDROOT}
131 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
132 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
133 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
135 if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then
136 ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3
139 # Remove unused binaries
140 rm -vf %{BUILDROOT}/sbin/sln \
141 %{BUILDROOT}/usr/bin/rpcinfo
143 # Don't distribute linker cache
144 rm -vf %{BUILDROOT}/etc/ld.so.cache
146 # Include /usr/lib/gconv/gconv-modules.cache
147 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
148 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
150 strip -g %{BUILDROOT}%{libdir}/*.o
152 # Move some libs to correct place
153 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
155 # Fix library permissions.
156 chmod 755 %{BUILDROOT}%{libdir}/lib*.so*
158 # rquota.x and rquota.h are now provided by quota
159 rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx]
163 %{libdir}/libc_nonshared.a
164 %{libdir}/libmvec_nonshared.a
165 %{libdir}/libpthread_nonshared.a
171 if "%{DISTRO_ARCH}" == "armv7hl"
172 provides += ld-linux.so.3
173 provides += ld-linux.so.3(GLIBC_2.4)
174 provides += ld-linux.so.3(GLIBC_PRIVATE)
182 kernel < %{OPTIMIZED_KERNEL}
186 glibc-common < %{thisver}
195 glibc-headers = %{thisver}
196 kernel-headers >= %{OPTIMIZED_KERNEL}
200 glibc-headers = %{thisver}
204 glibc-headers < %{thisver}
207 files += %{libdir}/*.[ao]
211 summary = A Name Service Caching Daemon (nscd).
213 Nscd caches name service lookups and can dramatically improve
214 performance with NIS+, and may help with DNS as well.
216 group = System/Daemons
223 package %{name}-utils
224 summary = Development utilities from GNU C library.
226 The glibc-utils package contains memusage, a memory usage profiler,
227 mtrace, a memory leak tracer and xtrace, a function call tracer
228 which can be helpful during program debugging.
230 group = Development/Tools
234 /usr/bin/memusagestat
236 /usr/bin/pcprofiledump
238 %{libdir}/libmemusage.so
239 %{libdir}/libpcprofile.so
243 package %{name}-debuginfo