]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - glibc/glibc.nm
kernel: Update to 3.1.1.
[people/ms/ipfire-3.x.git] / glibc / glibc.nm
CommitLineData
166a6c21 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
166a6c21
MT
4###############################################################################
5
7f617709 6# TODO tzdata
166a6c21 7
802ea3af
MT
8name = glibc
9version = 2.14
8a3a777f 10release = 3
802ea3af
MT
11
12maintainer = Michael Tremer <michael.tremer@ipfire.org>
13groups = System/Base
14url = http://sources.redhat.com/glibc/
15license = GPLv2+ LGPLv2+
16summary = The GNU libc libraries.
17
18description
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
166a6c21 25 Linux system will not function.
802ea3af
MT
26end
27
28source_dl = http://ftp.gnu.org/gnu/glibc/
29sources = %{thisapp}.tar.xz
30
31build
16cbb54b
MT
32 # Optimize glibc for kernel
33 OPTIMIZED_KERNEL = 2.6.32
34
802ea3af
MT
35 requires
36 audit-devel
37 autoconf
38 automake
39 gettext
16cbb54b 40 kernel-headers>=%{OPTIMIZED_KERNEL}
802ea3af
MT
41 libcap-devel
42 libselinux-devel
43 texinfo
44 end
45
46 # Build glibc with custom cflags
47 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
48
49 if "%{DISTRO_ARCH}" == "i686"
50 GLIBC_FLAGS += -march=i686 -mtune=generic
51 elif "%{DISTRO_ARCH}" == "x86_64"
52 GLIBC_FLAGS += -mtune=generic
53 end
54
55 export CFLAGS = %{GLIBC_FLAGS}
56 export CXXFLAGS = %{GLIBC_FLAGS}
57
802ea3af
MT
58 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
59
60 prepare_cmds
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
65
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
69
70 # We don't install pt_chown(1) on the final system, so why install it to
71 # $(TOOLS_DIR):
72 sed -e "/^install.*pt_chown/d" -i login/Makefile
73
74 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
75 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
76
77 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
78
79 # Use gnu hash style
80 sed -i Makeconfig \
81 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
82
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"
86
87 # stdio-common/bug22 hits timeout.
88 sed -i stdio-common/bug22.c \
89 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
90
91 # These tests don't work or need more investigation:
92 sed -i dlfcn/Makefile -e "s/default //g"
93
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"
106
107 # These are known to fail on x86:
108 sed -i rt/Makefile \
109 -e "s/tst-cpuclock1 //g" \
110 -e "s/tst-cpuclock2 //g"
111
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" \
120 -e "s/order //g" \
121 -e "s/lateglobal //g" \
122 -e "s/dblload //g" \
123 -e "s/dblunload //g" \
124 -e "s/reldep6 //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"
130
131 sed -i signal/Makefile \
132 -e "s/tst-sigset2//g"
133 end
134
135 build
136 mkdir %{DIR_SRC}/glibc-build
137 cd %{DIR_SRC}/glibc-build
138
139 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
140 ../%{thisapp}/configure \
141 --build=%{DISTRO_BUILDTARGET} \
142 --host=%{DISTRO_BUILDTARGET} \
166a6c21
MT
143 --prefix=/usr \
144 --libexecdir=/usr/lib/glibc \
145 --disable-profile \
146 --enable-add-ons \
802ea3af 147 --enable-kernel=%{OPTIMIZED_KERNEL} \
2777fcb0 148 --with-selinux \
166a6c21
MT
149 --disable-werror \
150 --enable-bind-now \
70b63715
MT
151 --enable-__thread \
152 --enable-tls \
153 --enable-experimental-malloc \
154 --with-gd \
155 --with-nss-crypt
156
802ea3af
MT
157 sed -i config.make \
158 -e "s/^build-pic-default=.*/build-pic-default=yes/"
159
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
165
166 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
167 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
168 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
169
170 # Then build the programs with hardening, so everything possible in
171 # is hardened:
172 echo "# Nothing in here :D" > configparms
173 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
174 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
175 end
176
177 #test
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"
182 #end
183
184 install
185 cd %{DIR_SRC}/glibc-build
186 make install install_root=%{BUILDROOT}
187
188 # Locales
189 mkdir -pv %{BUILDROOT}/usr/lib/locale
190 # This would install all locales that are supported
191 make localedata/install-locales install_root=%{BUILDROOT}
192
193 # Timezone
194 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
195 %{BUILDROOT}/etc/localtime
196
197 # Configuration
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
201
202 # Remove unused binaries
203 rm -vf %{BUILDROOT}/sbin/sln \
204 %{BUILDROOT}/usr/bin/rpcinfo
205
206 # Don't distribute linker cache
207 rm -vf %{BUILDROOT}/etc/ld.so.cache
208
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
212
213 strip -g %{BUILDROOT}/usr/lib/*.o
214
215 # Move some libs to correct place
216 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
217 end
8a3a777f
MT
218
219 keep_libraries
220 /usr/lib/libc_nonshared.a
221 /usr/lib/libpthread_nonshared.a
222 end
802ea3af
MT
223end
224
225packages
226 package glibc
227 requires = glibc-common=%{thisver}
228 end
229
230 package glibc-common
231 # XXX description and summary are missing
232
233 files
234 /usr/bin
235 /usr/sbin
236 /usr/share
237 !/usr/share/zoneinfo
238 end
239 end
240
241 package glibc-devel
242 summary = Object files for development using standard C libraries.
243 description
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
249 executables.
250
251 Install glibc-devel if you are going to develop programs which will
252 use the standard C libraries.
253 end
254 group = Development/Libraries
255
256 requires = glibc-headers=%{thisver}
257
258 files = /usr/lib/*.a /usr/lib/*.o
259 end
260
261 package glibc-headers
262 description
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
268 executables.
269
270 Install glibc-headers if you are going to develop programs which will
271 use the standard C libraries.
272 end
273
274 requires = kernel-headers
275
276 files
277 /usr/include
278 !/usr/include/linuxthreads
279 !/usr/include/gnu/stubs-[32164]*.h
280 end
281 end
282
283 package nscd
284 summary = A Name Service Caching Daemon (nscd).
285 description
286 Nscd caches name service lookups and can dramatically improve
287 performance with NIS+, and may help with DNS as well.
288 end
289 group = System/Daemons
290
291 files
292 /usr/sbin/nscd
293 end
294 end
295
296 package %{name}-utils
297 summary = Development utilities from GNU C library.
298 description
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.
302 end
303 group = Development/Tools
304
305 files
306 /usr/bin/memusage
307 /usr/bin/memusagestat
308 /usr/bin/mtrace
309 /usr/bin/pcprofiledump
310 /usr/bin/xtrace
311 /usr/lib/libmemusage.so
312 /usr/lib/libpcprofile.so
313 end
314 end
315end