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