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 = http://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}
47 # Build glibc with custom cflags
48 GLIBC_FLAGS = -O2 -g -DNDEBUG -pipe
50 if "%{DISTRO_ARCH}" == "i686"
51 GLIBC_FLAGS += -march=i686 -mtune=generic
54 if "%{DISTRO_ARCH}" == "x86_64"
55 GLIBC_FLAGS += -mtune=generic
58 export CFLAGS = %{GLIBC_FLAGS}
59 export CXXFLAGS = %{GLIBC_FLAGS}
61 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
64 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
65 # unknown whether this is a bash bug or a Glibc problem. Disable
66 # installation of this locale in order to avoid the problem.
67 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
69 # The ldd shell script contains Bash-specific syntax. Change its default
70 # program interpreter to /bin/bash in case another /bin/sh is installed.
71 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
73 # We don't install pt_chown(1) on the final system
74 sed -e "/^install.*pt_chown/d" -i login/Makefile
76 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
77 sed -e "s/fstack-protector/&-strong/" -i nscd/Makefile
81 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
83 # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
84 sed -e "s/PIC/SHARED/g" -i sysdeps/arm/{set,__long}jmp.S
88 --build=%{DISTRO_BUILDTARGET} \
90 --libexecdir=%{libdir}/glibc \
93 --enable-kernel=%{OPTIMIZED_KERNEL} \
95 --enable-stack-protector=strong \
97 --enable-obsolete-rpc \
98 --with-bugurl=http://bugtracker.ipfire.org \
99 --enable-lock-elision \
102 if "%{DISTRO_ARCH}" == "armv5tel"
103 # Disable hardware FP for ARM.
104 configure_options += \
109 mkdir -p %{DIR_SRC}/glibc-build
110 cd %{DIR_SRC}/glibc-build
112 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
113 ../%{thisapp}/configure \
116 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
117 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
121 cd %{DIR_SRC}/glibc-build
122 make install install_root=%{BUILDROOT}
125 mkdir -pv %{BUILDROOT}/usr/lib/locale
126 # This would install all locales that are supported
127 make localedata/install-locales install_root=%{BUILDROOT}
130 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
131 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
132 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
134 if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then
135 ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3
138 # Remove unused binaries
139 rm -vf %{BUILDROOT}/sbin/sln \
140 %{BUILDROOT}/usr/bin/rpcinfo
142 # Don't distribute linker cache
143 rm -vf %{BUILDROOT}/etc/ld.so.cache
145 # Include /usr/lib/gconv/gconv-modules.cache
146 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
147 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
149 strip -g %{BUILDROOT}%{libdir}/*.o
151 # Move some libs to correct place
152 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
154 # Fix library permissions.
155 chmod 755 %{BUILDROOT}%{libdir}/lib*.so*
157 # rquota.x and rquota.h are now provided by quota
158 rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx]
162 %{libdir}/libc_nonshared.a
163 %{libdir}/libmvec_nonshared.a
164 %{libdir}/libpthread_nonshared.a
170 if "%{DISTRO_ARCH}" == "armv7hl"
171 provides += ld-linux.so.3
172 provides += ld-linux.so.3(GLIBC_2.4)
173 provides += ld-linux.so.3(GLIBC_PRIVATE)
181 kernel < %{OPTIMIZED_KERNEL}
185 glibc-common < %{thisver}
194 glibc-headers = %{thisver}
195 kernel-headers >= %{OPTIMIZED_KERNEL}
199 glibc-headers = %{thisver}
203 glibc-headers < %{thisver}
206 files += %{libdir}/*.[ao]
210 summary = A Name Service Caching Daemon (nscd).
212 Nscd caches name service lookups and can dramatically improve
213 performance with NIS+, and may help with DNS as well.
215 group = System/Daemons
222 package %{name}-utils
223 summary = Development utilities from GNU C library.
225 The glibc-utils package contains memusage, a memory usage profiler,
226 mtrace, a memory leak tracer and xtrace, a function call tracer
227 which can be helpful during program debugging.
229 group = Development/Tools
233 /usr/bin/memusagestat
235 /usr/bin/pcprofiledump
237 %{libdir}/libmemusage.so
238 %{libdir}/libpcprofile.so
242 package %{name}-debuginfo