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
32 # Optimize glibc for kernel
33 OPTIMIZED_KERNEL = 2.6.32
40 kernel-headers>=%{OPTIMIZED_KERNEL}
46 # Build glibc with custom cflags
47 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
49 if "%{DISTRO_ARCH}" == "i686"
50 GLIBC_FLAGS += -march=i686 -mtune=generic
51 elif "%{DISTRO_ARCH}" == "x86_64"
52 GLIBC_FLAGS += -mtune=generic
55 export CFLAGS = %{GLIBC_FLAGS}
56 export CXXFLAGS = %{GLIBC_FLAGS}
58 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
61 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
62 # unknown whether this is a bash bug or a Glibc problem. Disable
63 # installation of this locale in order to avoid the problem.
64 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
66 # The ldd shell script contains Bash-specific syntax. Change its default
67 # program interpreter to /bin/bash in case another /bin/sh is installed.
68 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
70 # We don't install pt_chown(1) on the final system, so why install it to
72 sed -e "/^install.*pt_chown/d" -i login/Makefile
74 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
75 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
77 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
81 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
83 # stdlib/tst-putenvmod is not linked against libc.
84 sed -i stdlib/Makefile \
85 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
87 # stdio-common/bug22 hits timeout.
88 sed -i stdio-common/bug22.c \
89 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
91 # These tests don't work or need more investigation:
92 sed -i dlfcn/Makefile -e "s/default //g"
94 sed -i nptl/Makefile \
95 -e "s/tst-mutex5 //g" \
96 -e "s/tst-mutex5a //g" \
97 -e "s/tst-cond11 //g" \
98 -e "s/tst-rwlock6 //g" \
99 -e "s/tst-rwlock7 //g" \
100 -e "s/tst-sem5 //g" \
101 -e "s/tst-cancelx4 //g" \
102 -e "s/tst-cancelx5 //g" \
103 -e "s/tst-cancelx10 //g" \
104 -e "s/tst-cancelx18 //g" \
105 -e "s/tst-signal1 //g"
107 # These are known to fail on x86:
109 -e "s/tst-cpuclock1 //g" \
110 -e "s/tst-cpuclock2 //g"
112 sed -i elf/Makefile \
113 -e "s/tst-tls1 //g" \
114 -e "s/tst-tls1-static //g" \
115 -e "s/tst-tls2 //g" \
116 -e "s/tst-tls2-static //g" \
117 -e "s/tst-tls3 //g" \
118 -e "s/resolvfail //g" \
119 -e "s/constload1 //g" \
121 -e "s/lateglobal //g" \
123 -e "s/dblunload //g" \
125 -e "s/circleload1 //g" \
126 -e "s/tst-global1 //g" \
127 -e "s/tst-audit2 //g" \
128 -e "s/check-localplt //g" \
129 -e "s/check-localplt.out$$//g"
131 sed -i signal/Makefile \
132 -e "s/tst-sigset2//g"
136 mkdir %{DIR_SRC}/glibc-build
137 cd %{DIR_SRC}/glibc-build
139 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
140 ../%{thisapp}/configure \
141 --build=%{DISTRO_BUILDTARGET} \
142 --host=%{DISTRO_BUILDTARGET} \
144 --libexecdir=/usr/lib/glibc \
147 --enable-kernel=%{OPTIMIZED_KERNEL} \
153 --enable-experimental-malloc \
158 -e "s/^build-pic-default=.*/build-pic-default=yes/"
160 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
161 # LDFLAGS.so is appended to so we don't build shared libraries with
162 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
163 # the libraries, not the programs:
164 echo "build-programs=no" >> configparms
166 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
167 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
168 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
170 # Then build the programs with hardening, so everything possible in
172 echo "# Nothing in here :D" > configparms
173 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
174 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
178 # cd $(DIR_SRC)/glibc-build
179 # make check TIMEOUTFACTOR=16 \
180 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
181 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
185 cd %{DIR_SRC}/glibc-build
186 make install install_root=%{BUILDROOT}
189 mkdir -pv %{BUILDROOT}/usr/lib/locale
190 # This would install all locales that are supported
191 make localedata/install-locales install_root=%{BUILDROOT}
194 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
195 %{BUILDROOT}/etc/localtime
198 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
199 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
200 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
202 # Remove unused binaries
203 rm -vf %{BUILDROOT}/sbin/sln \
204 %{BUILDROOT}/usr/bin/rpcinfo
206 # Don't distribute linker cache
207 rm -vf %{BUILDROOT}/etc/ld.so.cache
209 # Include /usr/lib/gconv/gconv-modules.cache
210 > %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
211 chmod 644 %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
213 strip -g %{BUILDROOT}/usr/lib/*.o
215 # Move some libs to correct place
216 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
220 /usr/lib/libc_nonshared.a
221 /usr/lib/libpthread_nonshared.a
227 requires = glibc-common=%{thisver}
231 # XXX description and summary are missing
242 summary = Object files for development using standard C libraries.
244 The glibc-devel package contains the object files necessary
245 for developing programs which use the standard C libraries (which are
246 used by nearly all programs). If you are developing programs which
247 will use the standard C libraries, your system needs to have these
248 standard object files available in order to create the
251 Install glibc-devel if you are going to develop programs which will
252 use the standard C libraries.
254 group = Development/Libraries
256 requires = glibc-headers=%{thisver}
258 files = /usr/lib/*.a /usr/lib/*.o
261 package glibc-headers
263 The glibc-headers package contains the header 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 header files available in order to create the
270 Install glibc-headers if you are going to develop programs which will
271 use the standard C libraries.
274 requires = kernel-headers
278 !/usr/include/linuxthreads
279 !/usr/include/gnu/stubs-[32164]*.h
284 summary = A Name Service Caching Daemon (nscd).
286 Nscd caches name service lookups and can dramatically improve
287 performance with NIS+, and may help with DNS as well.
289 group = System/Daemons
296 package %{name}-utils
297 summary = Development utilities from GNU C library.
299 The glibc-utils package contains memusage, a memory usage profiler,
300 mtrace, a memory leak tracer and xtrace, a function call tracer
301 which can be helpful during program debugging.
303 group = Development/Tools
307 /usr/bin/memusagestat
309 /usr/bin/pcprofiledump
311 /usr/lib/libmemusage.so
312 /usr/lib/libpcprofile.so