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://sources.redhat.com/glibc/
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 # The version of the ports addon.
27 ports_version = %{version}
29 source_dl = http://ftp.gnu.org/gnu/glibc/
30 sources = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz
33 # Optimize glibc for kernel
34 OPTIMIZED_KERNEL = 2.6.32
41 kernel-headers>=%{OPTIMIZED_KERNEL}
48 # Build glibc with custom cflags
49 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
51 if "%{DISTRO_ARCH}" == "i686"
52 GLIBC_FLAGS += -march=i686 -mtune=generic
53 elif "%{DISTRO_ARCH}" == "x86_64"
54 GLIBC_FLAGS += -mtune=generic
57 export CFLAGS = %{GLIBC_FLAGS}
58 export CXXFLAGS = %{GLIBC_FLAGS}
60 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
63 # Extract source tarballs.
64 %{MACRO_EXTRACT_TARBALL}
66 # Create link for ports addon.
67 ln -svf ../glibc-ports-%{ports_version} ports
72 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
73 # unknown whether this is a bash bug or a Glibc problem. Disable
74 # installation of this locale in order to avoid the problem.
75 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
77 # The ldd shell script contains Bash-specific syntax. Change its default
78 # program interpreter to /bin/bash in case another /bin/sh is installed.
79 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
81 # We don't install pt_chown(1) on the final system, so why install it to
83 sed -e "/^install.*pt_chown/d" -i login/Makefile
85 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
86 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
88 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
92 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
94 # stdlib/tst-putenvmod is not linked against libc.
95 sed -i stdlib/Makefile \
96 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
98 # stdio-common/bug22 hits timeout.
99 sed -i stdio-common/bug22.c \
100 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
102 # These tests don't work or need more investigation:
103 sed -i dlfcn/Makefile -e "s/default //g"
105 sed -i nptl/Makefile \
106 -e "s/tst-mutex5 //g" \
107 -e "s/tst-mutex5a //g" \
108 -e "s/tst-cond11 //g" \
109 -e "s/tst-rwlock6 //g" \
110 -e "s/tst-rwlock7 //g" \
111 -e "s/tst-sem5 //g" \
112 -e "s/tst-cancelx4 //g" \
113 -e "s/tst-cancelx5 //g" \
114 -e "s/tst-cancelx10 //g" \
115 -e "s/tst-cancelx18 //g" \
116 -e "s/tst-signal1 //g"
118 # These are known to fail on x86:
120 -e "s/tst-cpuclock1 //g" \
121 -e "s/tst-cpuclock2 //g"
123 sed -i elf/Makefile \
124 -e "s/tst-tls1 //g" \
125 -e "s/tst-tls1-static //g" \
126 -e "s/tst-tls2 //g" \
127 -e "s/tst-tls2-static //g" \
128 -e "s/tst-tls3 //g" \
129 -e "s/resolvfail //g" \
130 -e "s/constload1 //g" \
132 -e "s/lateglobal //g" \
134 -e "s/dblunload //g" \
136 -e "s/circleload1 //g" \
137 -e "s/tst-global1 //g" \
138 -e "s/tst-audit2 //g" \
139 -e "s/check-localplt //g" \
140 -e "s/check-localplt.out$$//g"
142 sed -i signal/Makefile \
143 -e "s/tst-sigset2//g"
146 configure_options = \
147 --build=%{DISTRO_BUILDTARGET} \
149 --libexecdir=/usr/lib/glibc \
152 --enable-kernel=%{OPTIMIZED_KERNEL} \
155 --enable-experimental-malloc \
159 if "%{DISTRO_ARCH}" == "armv5tel"
160 # Disable hardware FP for ARM.
161 configure_options += \
166 mkdir -p %{DIR_SRC}/glibc-build
167 cd %{DIR_SRC}/glibc-build
169 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
170 ../%{thisapp}/configure \
174 -e "s/^build-pic-default=.*/build-pic-default=yes/"
176 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
177 # LDFLAGS.so is appended to so we don't build shared libraries with
178 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
179 # the libraries, not the programs:
180 echo "build-programs=no" >> configparms
182 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
183 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
184 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
186 # Then build the programs with hardening, so everything possible in
188 echo "# Nothing in here :D" > configparms
189 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
190 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
194 # cd $(DIR_SRC)/glibc-build
195 # make check TIMEOUTFACTOR=16 \
196 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
197 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
201 cd %{DIR_SRC}/glibc-build
202 make install install_root=%{BUILDROOT}
205 mkdir -pv %{BUILDROOT}/usr/lib/locale
206 # This would install all locales that are supported
207 make localedata/install-locales install_root=%{BUILDROOT}
210 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
211 %{BUILDROOT}/etc/localtime
212 rm -rf %{BUILDROOT}/usr/share/zoneinfo
215 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
216 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
217 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
219 # Remove unused binaries
220 rm -vf %{BUILDROOT}/sbin/sln \
221 %{BUILDROOT}/usr/bin/rpcinfo
223 # Don't distribute linker cache
224 rm -vf %{BUILDROOT}/etc/ld.so.cache
226 # Include /usr/lib/gconv/gconv-modules.cache
227 > %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
228 chmod 644 %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
230 strip -g %{BUILDROOT}/usr/lib/*.o
232 # Move some libs to correct place
233 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
237 /usr/lib/libc_nonshared.a
238 /usr/lib/libpthread_nonshared.a
244 requires = glibc-common=%{thisver}
248 # XXX description and summary are missing
261 summary = Object files for development using standard C libraries.
263 The glibc-devel package contains the object files necessary
264 for developing programs which use the standard C libraries (which are
265 used by nearly all programs). If you are developing programs which
266 will use the standard C libraries, your system needs to have these
267 standard object files available in order to create the
270 Install glibc-devel if you are going to develop programs which will
271 use the standard C libraries.
273 group = Development/Libraries
275 requires = glibc-headers=%{thisver}
277 files = /usr/lib/*.a /usr/lib/*.o
280 package glibc-headers
282 The glibc-headers package contains the header files necessary
283 for developing programs which use the standard C libraries (which are
284 used by nearly all programs). If you are developing programs which
285 will use the standard C libraries, your system needs to have these
286 standard header files available in order to create the
289 Install glibc-headers if you are going to develop programs which will
290 use the standard C libraries.
293 requires = kernel-headers
297 !/usr/include/linuxthreads
298 !/usr/include/gnu/stubs-[32164]*.h
303 summary = A Name Service Caching Daemon (nscd).
305 Nscd caches name service lookups and can dramatically improve
306 performance with NIS+, and may help with DNS as well.
308 group = System/Daemons
315 package %{name}-utils
316 summary = Development utilities from GNU C library.
318 The glibc-utils package contains memusage, a memory usage profiler,
319 mtrace, a memory leak tracer and xtrace, a function call tracer
320 which can be helpful during program debugging.
322 group = Development/Tools
326 /usr/bin/memusagestat
328 /usr/bin/pcprofiledump
330 /usr/lib/libmemusage.so
331 /usr/lib/libpcprofile.so
335 package %{name}-debuginfo