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 # The version of the ports addon.
29 ports_version = %{version}
31 source_dl = http://ftp.gnu.org/gnu/glibc/
32 sources = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz
35 # Optimize glibc for kernel
36 OPTIMIZED_KERNEL = 2.6.32
43 kernel-headers>=%{OPTIMIZED_KERNEL}
49 # Build glibc with custom cflags
50 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
52 if "%{DISTRO_ARCH}" == "i686"
53 GLIBC_FLAGS += -march=i686 -mtune=generic
54 elif "%{DISTRO_ARCH}" == "x86_64"
55 GLIBC_FLAGS += -mtune=generic
58 export CFLAGS = %{GLIBC_FLAGS}
59 export CXXFLAGS = %{GLIBC_FLAGS}
61 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
64 ln -svf ../glibc-ports-%{ports_version} ports
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
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
75 # We don't install pt_chown(1) on the final system, so why install it to
77 sed -e "/^install.*pt_chown/d" -i login/Makefile
79 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
80 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
82 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
86 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
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"
92 # stdio-common/bug22 hits timeout.
93 sed -i stdio-common/bug22.c \
94 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
96 # These tests don't work or need more investigation:
97 sed -i dlfcn/Makefile -e "s/default //g"
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"
112 # These are known to fail on x86:
114 -e "s/tst-cpuclock1 //g" \
115 -e "s/tst-cpuclock2 //g"
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" \
126 -e "s/lateglobal //g" \
128 -e "s/dblunload //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"
136 sed -i signal/Makefile \
137 -e "s/tst-sigset2//g"
140 configure_options = \
141 --build=%{DISTRO_BUILDTARGET} \
142 --host=%{DISTRO_BUILDTARGET} \
144 --libexecdir=/usr/lib/glibc \
147 --enable-kernel=%{OPTIMIZED_KERNEL} \
153 --enable-experimental-malloc \
157 if "%{DISTRO_ARCH}" == "armv5tel"
158 # Disable hardware FP for ARM.
159 configure_options += \
164 mkdir -p %{DIR_SRC}/glibc-build
165 cd %{DIR_SRC}/glibc-build
167 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
168 ../%{thisapp}/configure \
172 -e "s/^build-pic-default=.*/build-pic-default=yes/"
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
180 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
181 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
182 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
184 # Then build the programs with hardening, so everything possible in
186 echo "# Nothing in here :D" > configparms
187 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
188 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
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"
199 cd %{DIR_SRC}/glibc-build
200 make install install_root=%{BUILDROOT}
203 mkdir -pv %{BUILDROOT}/usr/lib/locale
204 # This would install all locales that are supported
205 make localedata/install-locales install_root=%{BUILDROOT}
208 cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
209 %{BUILDROOT}/etc/localtime
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
216 # Remove unused binaries
217 rm -vf %{BUILDROOT}/sbin/sln \
218 %{BUILDROOT}/usr/bin/rpcinfo
220 # Don't distribute linker cache
221 rm -vf %{BUILDROOT}/etc/ld.so.cache
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
227 strip -g %{BUILDROOT}/usr/lib/*.o
229 # Move some libs to correct place
230 mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
234 /usr/lib/libc_nonshared.a
235 /usr/lib/libpthread_nonshared.a
241 requires = glibc-common=%{thisver}
245 # XXX description and summary are missing
256 summary = Object files for development using standard C libraries.
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
265 Install glibc-devel if you are going to develop programs which will
266 use the standard C libraries.
268 group = Development/Libraries
270 requires = glibc-headers=%{thisver}
272 files = /usr/lib/*.a /usr/lib/*.o
275 package glibc-headers
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
284 Install glibc-headers if you are going to develop programs which will
285 use the standard C libraries.
288 requires = kernel-headers
292 !/usr/include/linuxthreads
293 !/usr/include/gnu/stubs-[32164]*.h
298 summary = A Name Service Caching Daemon (nscd).
300 Nscd caches name service lookups and can dramatically improve
301 performance with NIS+, and may help with DNS as well.
303 group = System/Daemons
310 package %{name}-utils
311 summary = Development utilities from GNU C library.
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.
317 group = Development/Tools
321 /usr/bin/memusagestat
323 /usr/bin/pcprofiledump
325 /usr/lib/libmemusage.so
326 /usr/lib/libpcprofile.so