1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
12 maintainer = Michael Tremer <michael.tremer@ipfire.org>
14 url = http://sources.redhat.com/glibc/
15 license = GPLv2+ LGPLv2+
16 summary = The GNU libc libraries.
19 The glibc package contains standard libraries which are used by
20 multiple programs on the system. In order to save disk space and
21 memory, as well as to make upgrading easier, common system code is
22 kept in one place and shared between programs. This particular package
23 contains the most important sets of shared libraries: the standard C
24 library and the standard math library. Without these two libraries, a
25 Linux system will not function.
28 # The version of the ports addon.
29 ports_version = %{version}
31 source_dl = http://ftp.gnu.org/gnu/glibc/
32 sources = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz
35 # Optimize glibc for kernel
36 OPTIMIZED_KERNEL = 2.6.32
43 kernel-headers>=%{OPTIMIZED_KERNEL}
49 # Build glibc with custom cflags
50 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
52 if "%{DISTRO_ARCH}" == "i686"
53 GLIBC_FLAGS += -march=i686 -mtune=generic
54 elif "%{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 # Extract source tarballs.
65 %{MACRO_EXTRACT_TARBALL}
67 # Create link for ports addon.
68 ln -svf ../glibc-ports-%{ports_version} ports
73 if [ "%{DISTRO_ARCH}" = "armv5tel" ]; then
75 -e "s/libc_cv_gcc_static_libgcc=-static-libgcc/libc_cv_gcc_static_libgcc=/"
78 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
79 # unknown whether this is a bash bug or a Glibc problem. Disable
80 # installation of this locale in order to avoid the problem.
81 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
83 # The ldd shell script contains Bash-specific syntax. Change its default
84 # program interpreter to /bin/bash in case another /bin/sh is installed.
85 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
87 # We don't install pt_chown(1) on the final system, so why install it to
89 sed -e "/^install.*pt_chown/d" -i login/Makefile
91 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
92 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
94 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
98 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
100 # stdlib/tst-putenvmod is not linked against libc.
101 sed -i stdlib/Makefile \
102 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
104 # stdio-common/bug22 hits timeout.
105 sed -i stdio-common/bug22.c \
106 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
108 # These tests don't work or need more investigation:
109 sed -i dlfcn/Makefile -e "s/default //g"
111 sed -i nptl/Makefile \
112 -e "s/tst-mutex5 //g" \
113 -e "s/tst-mutex5a //g" \
114 -e "s/tst-cond11 //g" \
115 -e "s/tst-rwlock6 //g" \
116 -e "s/tst-rwlock7 //g" \
117 -e "s/tst-sem5 //g" \
118 -e "s/tst-cancelx4 //g" \
119 -e "s/tst-cancelx5 //g" \
120 -e "s/tst-cancelx10 //g" \
121 -e "s/tst-cancelx18 //g" \
122 -e "s/tst-signal1 //g"
124 # These are known to fail on x86:
126 -e "s/tst-cpuclock1 //g" \
127 -e "s/tst-cpuclock2 //g"
129 sed -i elf/Makefile \
130 -e "s/tst-tls1 //g" \
131 -e "s/tst-tls1-static //g" \
132 -e "s/tst-tls2 //g" \
133 -e "s/tst-tls2-static //g" \
134 -e "s/tst-tls3 //g" \
135 -e "s/resolvfail //g" \
136 -e "s/constload1 //g" \
138 -e "s/lateglobal //g" \
140 -e "s/dblunload //g" \
142 -e "s/circleload1 //g" \
143 -e "s/tst-global1 //g" \
144 -e "s/tst-audit2 //g" \
145 -e "s/check-localplt //g" \
146 -e "s/check-localplt.out$$//g"
148 sed -i signal/Makefile \
149 -e "s/tst-sigset2//g"
152 configure_options = \
153 --build=%{DISTRO_BUILDTARGET} \
154 --host=%{DISTRO_BUILDTARGET} \
156 --libexecdir=/usr/lib/glibc \
159 --enable-kernel=%{OPTIMIZED_KERNEL} \
165 --enable-experimental-malloc \
169 if "%{DISTRO_ARCH}" == "armv5tel"
170 # Disable hardware FP for ARM.
171 configure_options += \
176 mkdir -p %{DIR_SRC}/glibc-build
177 cd %{DIR_SRC}/glibc-build
179 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
180 ../%{thisapp}/configure \
184 -e "s/^build-pic-default=.*/build-pic-default=yes/"
186 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
187 # LDFLAGS.so is appended to so we don't build shared libraries with
188 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
189 # the libraries, not the programs:
190 echo "build-programs=no" >> configparms
192 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
193 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
194 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
196 # Then build the programs with hardening, so everything possible in
198 echo "# Nothing in here :D" > configparms
199 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
200 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
204 # cd $(DIR_SRC)/glibc-build
205 # make check TIMEOUTFACTOR=16 \
206 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
207 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
211 cd %{DIR_SRC}/glibc-build
212 make install install_root=%{BUILDROOT}
215 mkdir -pv %{BUILDROOT}/usr/lib/locale
216 # This would install all locales that are supported
217 make localedata/install-locales install_root=%{BUILDROOT}
220 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
221 %{BUILDROOT}/etc/localtime
224 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
225 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
226 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
228 # Remove unused binaries
229 rm -vf %{BUILDROOT}/sbin/sln \
230 %{BUILDROOT}/usr/bin/rpcinfo
232 # Don't distribute linker cache
233 rm -vf %{BUILDROOT}/etc/ld.so.cache
235 # Include /usr/lib/gconv/gconv-modules.cache
236 > %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
237 chmod 644 %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
239 strip -g %{BUILDROOT}/usr/lib/*.o
241 # Move some libs to correct place
242 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
246 /usr/lib/libc_nonshared.a
247 /usr/lib/libpthread_nonshared.a
253 requires = glibc-common=%{thisver}
257 # XXX description and summary are missing
268 summary = Object files for development using standard C libraries.
270 The glibc-devel package contains the object files necessary
271 for developing programs which use the standard C libraries (which are
272 used by nearly all programs). If you are developing programs which
273 will use the standard C libraries, your system needs to have these
274 standard object files available in order to create the
277 Install glibc-devel if you are going to develop programs which will
278 use the standard C libraries.
280 group = Development/Libraries
282 requires = glibc-headers=%{thisver}
284 files = /usr/lib/*.a /usr/lib/*.o
287 package glibc-headers
289 The glibc-headers package contains the header files necessary
290 for developing programs which use the standard C libraries (which are
291 used by nearly all programs). If you are developing programs which
292 will use the standard C libraries, your system needs to have these
293 standard header files available in order to create the
296 Install glibc-headers if you are going to develop programs which will
297 use the standard C libraries.
300 requires = kernel-headers
304 !/usr/include/linuxthreads
305 !/usr/include/gnu/stubs-[32164]*.h
310 summary = A Name Service Caching Daemon (nscd).
312 Nscd caches name service lookups and can dramatically improve
313 performance with NIS+, and may help with DNS as well.
315 group = System/Daemons
322 package %{name}-utils
323 summary = Development utilities from GNU C library.
325 The glibc-utils package contains memusage, a memory usage profiler,
326 mtrace, a memory leak tracer and xtrace, a function call tracer
327 which can be helpful during program debugging.
329 group = Development/Tools
333 /usr/bin/memusagestat
335 /usr/bin/pcprofiledump
337 /usr/lib/libmemusage.so
338 /usr/lib/libpcprofile.so