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 source_dl = http://ftp.gnu.org/gnu/glibc/
29 sources = %{thisapp}.tar.xz
42 # Build glibc with custom cflags
43 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
45 if "%{DISTRO_ARCH}" == "i686"
46 GLIBC_FLAGS += -march=i686 -mtune=generic
47 elif "%{DISTRO_ARCH}" == "x86_64"
48 GLIBC_FLAGS += -mtune=generic
51 export CFLAGS = %{GLIBC_FLAGS}
52 export CXXFLAGS = %{GLIBC_FLAGS}
54 # Optimize glibc for kernel
55 OPTIMIZED_KERNEL = 2.6.32
57 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
60 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
61 # unknown whether this is a bash bug or a Glibc problem. Disable
62 # installation of this locale in order to avoid the problem.
63 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
65 # The ldd shell script contains Bash-specific syntax. Change its default
66 # program interpreter to /bin/bash in case another /bin/sh is installed.
67 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
69 # We don't install pt_chown(1) on the final system, so why install it to
71 sed -e "/^install.*pt_chown/d" -i login/Makefile
73 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
74 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
76 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
80 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
82 # stdlib/tst-putenvmod is not linked against libc.
83 sed -i stdlib/Makefile \
84 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
86 # stdio-common/bug22 hits timeout.
87 sed -i stdio-common/bug22.c \
88 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
90 # These tests don't work or need more investigation:
91 sed -i dlfcn/Makefile -e "s/default //g"
93 sed -i nptl/Makefile \
94 -e "s/tst-mutex5 //g" \
95 -e "s/tst-mutex5a //g" \
96 -e "s/tst-cond11 //g" \
97 -e "s/tst-rwlock6 //g" \
98 -e "s/tst-rwlock7 //g" \
100 -e "s/tst-cancelx4 //g" \
101 -e "s/tst-cancelx5 //g" \
102 -e "s/tst-cancelx10 //g" \
103 -e "s/tst-cancelx18 //g" \
104 -e "s/tst-signal1 //g"
106 # These are known to fail on x86:
108 -e "s/tst-cpuclock1 //g" \
109 -e "s/tst-cpuclock2 //g"
111 sed -i elf/Makefile \
112 -e "s/tst-tls1 //g" \
113 -e "s/tst-tls1-static //g" \
114 -e "s/tst-tls2 //g" \
115 -e "s/tst-tls2-static //g" \
116 -e "s/tst-tls3 //g" \
117 -e "s/resolvfail //g" \
118 -e "s/constload1 //g" \
120 -e "s/lateglobal //g" \
122 -e "s/dblunload //g" \
124 -e "s/circleload1 //g" \
125 -e "s/tst-global1 //g" \
126 -e "s/tst-audit2 //g" \
127 -e "s/check-localplt //g" \
128 -e "s/check-localplt.out$$//g"
130 sed -i signal/Makefile \
131 -e "s/tst-sigset2//g"
135 mkdir %{DIR_SRC}/glibc-build
136 cd %{DIR_SRC}/glibc-build
138 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
139 ../%{thisapp}/configure \
140 --build=%{DISTRO_BUILDTARGET} \
141 --host=%{DISTRO_BUILDTARGET} \
143 --libexecdir=/usr/lib/glibc \
146 --enable-kernel=%{OPTIMIZED_KERNEL} \
152 --enable-experimental-malloc \
157 -e "s/^build-pic-default=.*/build-pic-default=yes/"
159 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
160 # LDFLAGS.so is appended to so we don't build shared libraries with
161 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
162 # the libraries, not the programs:
163 echo "build-programs=no" >> configparms
165 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
166 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
167 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
169 # Then build the programs with hardening, so everything possible in
171 echo "# Nothing in here :D" > configparms
172 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
173 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
177 # cd $(DIR_SRC)/glibc-build
178 # make check TIMEOUTFACTOR=16 \
179 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
180 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
184 cd %{DIR_SRC}/glibc-build
185 make install install_root=%{BUILDROOT}
188 mkdir -pv %{BUILDROOT}/usr/lib/locale
189 # This would install all locales that are supported
190 make localedata/install-locales install_root=%{BUILDROOT}
193 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
194 %{BUILDROOT}/etc/localtime
197 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
198 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
199 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
201 # Remove unused binaries
202 rm -vf %{BUILDROOT}/sbin/sln \
203 %{BUILDROOT}/usr/bin/rpcinfo
205 # Don't distribute linker cache
206 rm -vf %{BUILDROOT}/etc/ld.so.cache
208 # Include /usr/lib/gconv/gconv-modules.cache
209 > %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
210 chmod 644 %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
212 strip -g %{BUILDROOT}/usr/lib/*.o
214 # Move some libs to correct place
215 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
221 requires = glibc-common=%{thisver}
225 # XXX description and summary are missing
236 summary = Object files for development using standard C libraries.
238 The glibc-devel package contains the object files necessary
239 for developing programs which use the standard C libraries (which are
240 used by nearly all programs). If you are developing programs which
241 will use the standard C libraries, your system needs to have these
242 standard object files available in order to create the
245 Install glibc-devel if you are going to develop programs which will
246 use the standard C libraries.
248 group = Development/Libraries
250 requires = glibc-headers=%{thisver}
252 files = /usr/lib/*.a /usr/lib/*.o
255 package glibc-headers
257 The glibc-headers package contains the header files necessary
258 for developing programs which use the standard C libraries (which are
259 used by nearly all programs). If you are developing programs which
260 will use the standard C libraries, your system needs to have these
261 standard header files available in order to create the
264 Install glibc-headers if you are going to develop programs which will
265 use the standard C libraries.
268 requires = kernel-headers
272 !/usr/include/linuxthreads
273 !/usr/include/gnu/stubs-[32164]*.h
278 summary = A Name Service Caching Daemon (nscd).
280 Nscd caches name service lookups and can dramatically improve
281 performance with NIS+, and may help with DNS as well.
283 group = System/Daemons
290 package %{name}-utils
291 summary = Development utilities from GNU C library.
293 The glibc-utils package contains memusage, a memory usage profiler,
294 mtrace, a memory leak tracer and xtrace, a function call tracer
295 which can be helpful during program debugging.
297 group = Development/Tools
301 /usr/bin/memusagestat
303 /usr/bin/pcprofiledump
305 /usr/lib/libmemusage.so
306 /usr/lib/libpcprofile.so