]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - glibc/glibc.nm
glibc: Fix patching the ports addon.
[people/amarx/ipfire-3.x.git] / glibc / glibc.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 # TODO tzdata
7
8 name = glibc
9 version = 2.14
10 release = 5
11
12 maintainer = Michael Tremer <michael.tremer@ipfire.org>
13 groups = System/Base
14 url = http://sources.redhat.com/glibc/
15 license = GPLv2+ LGPLv2+
16 summary = The GNU libc libraries.
17
18 description
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.
26 end
27
28 # The version of the ports addon.
29 ports_version = %{version}
30
31 source_dl = http://ftp.gnu.org/gnu/glibc/
32 sources = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz
33
34 build
35 # Optimize glibc for kernel
36 OPTIMIZED_KERNEL = 2.6.32
37
38 requires
39 audit-devel
40 autoconf
41 automake
42 gettext
43 kernel-headers>=%{OPTIMIZED_KERNEL}
44 libcap-devel
45 libselinux-devel
46 texinfo
47 end
48
49 # Build glibc with custom cflags
50 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
51
52 if "%{DISTRO_ARCH}" == "i686"
53 GLIBC_FLAGS += -march=i686 -mtune=generic
54 elif "%{DISTRO_ARCH}" == "x86_64"
55 GLIBC_FLAGS += -mtune=generic
56 end
57
58 export CFLAGS = %{GLIBC_FLAGS}
59 export CXXFLAGS = %{GLIBC_FLAGS}
60
61 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
62
63 prepare
64 # Extract source tarballs.
65 %{MACRO_EXTRACT_TARBALL}
66
67 # Create link for ports addon.
68 ln -svf ../glibc-ports-%{ports_version} ports
69
70 # Apply the patches.
71 %{MACRO_PATCHES}
72
73 if [ "%{DISTRO_ARCH}" = "armv5tel" ]; then
74 sed -i configure \
75 -e "s/libc_cv_gcc_static_libgcc=-static-libgcc/libc_cv_gcc_static_libgcc=/"
76 fi
77
78 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
79 # unknown whether this is a bash bug or a Glibc problem. Disable
80 # installation of this locale in order to avoid the problem.
81 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
82
83 # The ldd shell script contains Bash-specific syntax. Change its default
84 # program interpreter to /bin/bash in case another /bin/sh is installed.
85 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
86
87 # We don't install pt_chown(1) on the final system, so why install it to
88 # $(TOOLS_DIR):
89 sed -e "/^install.*pt_chown/d" -i login/Makefile
90
91 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
92 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
93
94 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
95
96 # Use gnu hash style
97 sed -i Makeconfig \
98 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
99
100 # stdlib/tst-putenvmod is not linked against libc.
101 sed -i stdlib/Makefile \
102 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
103
104 # stdio-common/bug22 hits timeout.
105 sed -i stdio-common/bug22.c \
106 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
107
108 # These tests don't work or need more investigation:
109 sed -i dlfcn/Makefile -e "s/default //g"
110
111 sed -i nptl/Makefile \
112 -e "s/tst-mutex5 //g" \
113 -e "s/tst-mutex5a //g" \
114 -e "s/tst-cond11 //g" \
115 -e "s/tst-rwlock6 //g" \
116 -e "s/tst-rwlock7 //g" \
117 -e "s/tst-sem5 //g" \
118 -e "s/tst-cancelx4 //g" \
119 -e "s/tst-cancelx5 //g" \
120 -e "s/tst-cancelx10 //g" \
121 -e "s/tst-cancelx18 //g" \
122 -e "s/tst-signal1 //g"
123
124 # These are known to fail on x86:
125 sed -i rt/Makefile \
126 -e "s/tst-cpuclock1 //g" \
127 -e "s/tst-cpuclock2 //g"
128
129 sed -i elf/Makefile \
130 -e "s/tst-tls1 //g" \
131 -e "s/tst-tls1-static //g" \
132 -e "s/tst-tls2 //g" \
133 -e "s/tst-tls2-static //g" \
134 -e "s/tst-tls3 //g" \
135 -e "s/resolvfail //g" \
136 -e "s/constload1 //g" \
137 -e "s/order //g" \
138 -e "s/lateglobal //g" \
139 -e "s/dblload //g" \
140 -e "s/dblunload //g" \
141 -e "s/reldep6 //g" \
142 -e "s/circleload1 //g" \
143 -e "s/tst-global1 //g" \
144 -e "s/tst-audit2 //g" \
145 -e "s/check-localplt //g" \
146 -e "s/check-localplt.out$$//g"
147
148 sed -i signal/Makefile \
149 -e "s/tst-sigset2//g"
150 end
151
152 configure_options = \
153 --build=%{DISTRO_BUILDTARGET} \
154 --host=%{DISTRO_BUILDTARGET} \
155 --prefix=/usr \
156 --libexecdir=/usr/lib/glibc \
157 --disable-profile \
158 --enable-add-ons \
159 --enable-kernel=%{OPTIMIZED_KERNEL} \
160 --with-selinux \
161 --disable-werror \
162 --enable-bind-now \
163 --enable-__thread \
164 --enable-tls \
165 --enable-experimental-malloc \
166 --with-gd \
167 --with-nss-crypt
168
169 if "%{DISTRO_ARCH}" == "armv5tel"
170 # Disable hardware FP for ARM.
171 configure_options += \
172 --without-fp
173 end
174
175 build
176 mkdir -p %{DIR_SRC}/glibc-build
177 cd %{DIR_SRC}/glibc-build
178
179 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
180 ../%{thisapp}/configure \
181 %{configure_options}
182
183 sed -i config.make \
184 -e "s/^build-pic-default=.*/build-pic-default=yes/"
185
186 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
187 # LDFLAGS.so is appended to so we don't build shared libraries with
188 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
189 # the libraries, not the programs:
190 echo "build-programs=no" >> configparms
191
192 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
193 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
194 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
195
196 # Then build the programs with hardening, so everything possible in
197 # is hardened:
198 echo "# Nothing in here :D" > configparms
199 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
200 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
201 end
202
203 #test
204 # cd $(DIR_SRC)/glibc-build
205 # make check TIMEOUTFACTOR=16 \
206 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
207 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
208 #end
209
210 install
211 cd %{DIR_SRC}/glibc-build
212 make install install_root=%{BUILDROOT}
213
214 # Locales
215 mkdir -pv %{BUILDROOT}/usr/lib/locale
216 # This would install all locales that are supported
217 make localedata/install-locales install_root=%{BUILDROOT}
218
219 # Timezone
220 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
221 %{BUILDROOT}/etc/localtime
222
223 # Configuration
224 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
225 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
226 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
227
228 # Remove unused binaries
229 rm -vf %{BUILDROOT}/sbin/sln \
230 %{BUILDROOT}/usr/bin/rpcinfo
231
232 # Don't distribute linker cache
233 rm -vf %{BUILDROOT}/etc/ld.so.cache
234
235 # Include /usr/lib/gconv/gconv-modules.cache
236 > %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
237 chmod 644 %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
238
239 strip -g %{BUILDROOT}/usr/lib/*.o
240
241 # Move some libs to correct place
242 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
243 end
244
245 keep_libraries
246 /usr/lib/libc_nonshared.a
247 /usr/lib/libpthread_nonshared.a
248 end
249 end
250
251 packages
252 package glibc
253 requires = glibc-common=%{thisver}
254 end
255
256 package glibc-common
257 # XXX description and summary are missing
258
259 files
260 /usr/bin
261 /usr/sbin
262 /usr/share
263 !/usr/share/zoneinfo
264 end
265 end
266
267 package glibc-devel
268 summary = Object files for development using standard C libraries.
269 description
270 The glibc-devel package contains the object files necessary
271 for developing programs which use the standard C libraries (which are
272 used by nearly all programs). If you are developing programs which
273 will use the standard C libraries, your system needs to have these
274 standard object files available in order to create the
275 executables.
276
277 Install glibc-devel if you are going to develop programs which will
278 use the standard C libraries.
279 end
280 group = Development/Libraries
281
282 requires = glibc-headers=%{thisver}
283
284 files = /usr/lib/*.a /usr/lib/*.o
285 end
286
287 package glibc-headers
288 description
289 The glibc-headers package contains the header files necessary
290 for developing programs which use the standard C libraries (which are
291 used by nearly all programs). If you are developing programs which
292 will use the standard C libraries, your system needs to have these
293 standard header files available in order to create the
294 executables.
295
296 Install glibc-headers if you are going to develop programs which will
297 use the standard C libraries.
298 end
299
300 requires = kernel-headers
301
302 files
303 /usr/include
304 !/usr/include/linuxthreads
305 !/usr/include/gnu/stubs-[32164]*.h
306 end
307 end
308
309 package nscd
310 summary = A Name Service Caching Daemon (nscd).
311 description
312 Nscd caches name service lookups and can dramatically improve
313 performance with NIS+, and may help with DNS as well.
314 end
315 group = System/Daemons
316
317 files
318 /usr/sbin/nscd
319 end
320 end
321
322 package %{name}-utils
323 summary = Development utilities from GNU C library.
324 description
325 The glibc-utils package contains memusage, a memory usage profiler,
326 mtrace, a memory leak tracer and xtrace, a function call tracer
327 which can be helpful during program debugging.
328 end
329 group = Development/Tools
330
331 files
332 /usr/bin/memusage
333 /usr/bin/memusagestat
334 /usr/bin/mtrace
335 /usr/bin/pcprofiledump
336 /usr/bin/xtrace
337 /usr/lib/libmemusage.so
338 /usr/lib/libpcprofile.so
339 end
340 end
341 end