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