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 -fPIC -DPIC
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 # Extract source tarballs.
66 %{MACRO_EXTRACT_TARBALL}
68 # Create link for ports addon.
69 ln -svf ../glibc-ports-%{ports_version} ports
74 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
75 # unknown whether this is a bash bug or a Glibc problem. Disable
76 # installation of this locale in order to avoid the problem.
77 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
79 # The ldd shell script contains Bash-specific syntax. Change its default
80 # program interpreter to /bin/bash in case another /bin/sh is installed.
81 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
83 # We don't install pt_chown(1) on the final system, so why install it to
85 sed -e "/^install.*pt_chown/d" -i login/Makefile
87 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
88 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
90 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
94 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
96 # stdlib/tst-putenvmod is not linked against libc.
97 sed -i stdlib/Makefile \
98 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
100 # stdio-common/bug22 hits timeout.
101 sed -i stdio-common/bug22.c \
102 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
104 # These tests don't work or need more investigation:
105 sed -i dlfcn/Makefile -e "s/default //g"
107 sed -i nptl/Makefile \
108 -e "s/tst-mutex5 //g" \
109 -e "s/tst-mutex5a //g" \
110 -e "s/tst-cond11 //g" \
111 -e "s/tst-rwlock6 //g" \
112 -e "s/tst-rwlock7 //g" \
113 -e "s/tst-sem5 //g" \
114 -e "s/tst-cancelx4 //g" \
115 -e "s/tst-cancelx5 //g" \
116 -e "s/tst-cancelx10 //g" \
117 -e "s/tst-cancelx18 //g" \
118 -e "s/tst-signal1 //g"
120 # These are known to fail on x86:
122 -e "s/tst-cpuclock1 //g" \
123 -e "s/tst-cpuclock2 //g"
125 sed -i elf/Makefile \
126 -e "s/tst-tls1 //g" \
127 -e "s/tst-tls1-static //g" \
128 -e "s/tst-tls2 //g" \
129 -e "s/tst-tls2-static //g" \
130 -e "s/tst-tls3 //g" \
131 -e "s/resolvfail //g" \
132 -e "s/constload1 //g" \
134 -e "s/lateglobal //g" \
136 -e "s/dblunload //g" \
138 -e "s/circleload1 //g" \
139 -e "s/tst-global1 //g" \
140 -e "s/tst-audit2 //g" \
141 -e "s/check-localplt //g" \
142 -e "s/check-localplt.out$$//g"
144 sed -i signal/Makefile \
145 -e "s/tst-sigset2//g"
148 configure_options = \
149 --build=%{DISTRO_BUILDTARGET} \
151 --libexecdir=%{libdir}/glibc \
154 --enable-kernel=%{OPTIMIZED_KERNEL} \
157 --enable-experimental-malloc \
161 if "%{DISTRO_ARCH}" == "armv5tel"
162 # Disable hardware FP for ARM.
163 configure_options += \
168 mkdir -p %{DIR_SRC}/glibc-build
169 cd %{DIR_SRC}/glibc-build
171 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
172 ../%{thisapp}/configure \
176 -e "s/^build-pic-default=.*/build-pic-default=yes/"
178 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
179 # LDFLAGS.so is appended to so we don't build shared libraries with
180 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
181 # the libraries, not the programs:
182 echo "build-programs=no" >> configparms
184 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
185 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
186 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
188 # Then build the programs with hardening, so everything possible in
190 echo "# Nothing in here :D" > configparms
191 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
192 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
196 # cd $(DIR_SRC)/glibc-build
197 # make check TIMEOUTFACTOR=16 \
198 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
199 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
203 cd %{DIR_SRC}/glibc-build
204 make install install_root=%{BUILDROOT}
207 mkdir -pv %{BUILDROOT}/usr/lib/locale
208 # This would install all locales that are supported
209 make localedata/install-locales install_root=%{BUILDROOT}
212 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
213 %{BUILDROOT}/etc/localtime
214 rm -rf %{BUILDROOT}/usr/share/zoneinfo
217 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
218 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
219 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
221 # Remove unused binaries
222 rm -vf %{BUILDROOT}/sbin/sln \
223 %{BUILDROOT}/usr/bin/rpcinfo
225 # Don't distribute linker cache
226 rm -vf %{BUILDROOT}/etc/ld.so.cache
228 # Include /usr/lib/gconv/gconv-modules.cache
229 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
230 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
232 strip -g %{BUILDROOT}%{libdir}/*.o
234 # Move some libs to correct place
235 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
239 %{libdir}/libc_nonshared.a
240 %{libdir}/libpthread_nonshared.a
246 requires = glibc-common=%{thisver}
250 # XXX description and summary are missing
263 summary = Object files for development using standard C libraries.
265 The glibc-devel package contains the object files necessary
266 for developing programs which use the standard C libraries (which are
267 used by nearly all programs). If you are developing programs which
268 will use the standard C libraries, your system needs to have these
269 standard object files available in order to create the
272 Install glibc-devel if you are going to develop programs which will
273 use the standard C libraries.
275 group = Development/Libraries
277 requires = glibc-headers=%{thisver}
279 files = %{libdir}/*.a %{libdir}/*.o
282 package glibc-headers
284 The glibc-headers package contains the header files necessary
285 for developing programs which use the standard C libraries (which are
286 used by nearly all programs). If you are developing programs which
287 will use the standard C libraries, your system needs to have these
288 standard header files available in order to create the
291 Install glibc-headers if you are going to develop programs which will
292 use the standard C libraries.
295 requires = kernel-headers
299 !/usr/include/linuxthreads
300 !/usr/include/gnu/stubs-[32164]*.h
305 summary = A Name Service Caching Daemon (nscd).
307 Nscd caches name service lookups and can dramatically improve
308 performance with NIS+, and may help with DNS as well.
310 group = System/Daemons
317 package %{name}-utils
318 summary = Development utilities from GNU C library.
320 The glibc-utils package contains memusage, a memory usage profiler,
321 mtrace, a memory leak tracer and xtrace, a function call tracer
322 which can be helpful during program debugging.
324 group = Development/Tools
328 /usr/bin/memusagestat
330 /usr/bin/pcprofiledump
332 %{libdir}/libmemusage.so
333 %{libdir}/libpcprofile.so
337 package %{name}-debuginfo