packaging: add support option for -fstack-protector-strong
[platform/upstream/glibc.git] / packaging / glibc.spec
1 #
2 # spec file for package glibc
3 #
4 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14
15 %if 0%{?run_tests}
16 %define glibc_run_tests 1
17 %endif
18
19 # This will avoid building some parts of glibc
20 %define asan_arch x86_64 armv7l aarch64
21 %bcond_with    fast_build
22 Name:           glibc
23 Summary:        Standard Shared Libraries (from the GNU C Library)
24 License:        LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+
25 Group:          Base/Libraries
26 BuildRequires:  fdupes
27 BuildRequires:  makeinfo
28 BuildRequires:  xz
29 BuildRequires:  gcc-c++
30 BuildRequires:  gettext-tools
31 BuildRequires:  libstdc++-devel
32 BuildRequires:  bison
33 BuildRequires:  python3-base
34 %{?asan:
35 %ifarch %asan_arch
36 #BuildRequires:  python
37 BuildRequires:  glibc-devel-static
38 %endif
39 }
40 #BuildRequires:  pkgconfig(systemd)
41 %define _filter_GLIBC_PRIVATE 1
42 %if %_target_cpu == "i686"
43 # For i686 let's only build what's different from i586, so
44 # no need to build documentation
45 %define build_profile 1
46 %define build_locales 0
47 %define build_html 0
48 %else
49 %if %{with fast_build}
50 %define build_profile 0
51 %define build_locales 0
52 %define build_html 0
53 %else
54 # Default:
55 %define build_profile 1
56 %define build_locales 0
57 %define build_html 1
58 %endif
59 %endif
60
61 %define disable_assert 0
62 %define enable_stackguard_randomization 1
63 %define multiarcharches %{ix86} x86_64
64
65 %ifarch x86_64
66 %define enablekernel 2.6.16
67 %else
68 %define enablekernel 2.6.16
69 %endif
70 Conflicts:      kernel < %{enablekernel}
71 %ifarch armv7l armv7hl
72 # The old runtime linker link gets not provided by rpm find.provides, but it exists
73 Provides:       ld-linux.so.3
74 Provides:       ld-linux.so.3(GLIBC_2.4)
75 %endif
76 Version:        2.30
77 Release:        0
78 %define glibc_major_version %{version}
79 %define git_id 0a8262a1b2
80
81 Url:            http://www.gnu.org/software/libc/libc.html
82 Source:         glibc-%{version}.tar.xz
83 Source5:        nsswitch.conf
84 Source7:        bindresvport.blacklist
85 Source8:        glibc_post_upgrade.c
86 Source9:        glibc.rpmlintrc
87 Source10:       baselibs.conf
88 # For systemd 
89 Source1001:     glibc.manifest
90
91 Requires(pre):  filesystem
92 Provides:       rtld(GNU_HASH)
93
94 %description
95 The GNU C Library provides the most important standard libraries used
96 by nearly all programs: the standard C library, the standard math
97 library, and the POSIX thread library. A system is not functional
98 without these libraries.
99
100 %package info
101 Summary:        Info Files for the GNU C Library
102 License:        GFDL-1.1
103 Group:          Documentation
104 BuildArch:      noarch
105
106 %description info
107 This package contains the documentation for the GNU C library stored as
108 info files. Due to a lack of resources, this documentation is not
109 complete and is partially out of date.
110
111 %package html
112 Summary:        HTML Documentation for the GNU C Library
113 License:        GFDL-1.1
114 Group:          Documentation
115 BuildArch:      noarch
116
117 %description html
118 This package contains the HTML documentation for the GNU C library. Due
119 to a lack of resources, this documentation is not complete and is
120 partially out of date.
121
122 %package i18ndata
123 Summary:        Database Sources for 'locale'
124 License:        GPL-2.0+ and MIT
125 Group:          Base/Libraries
126 BuildArch:      noarch
127
128 %description i18ndata
129 This package contains the data needed to build the locale data files to
130 use the internationalization features of the GNU libc. It is normally
131 not necessary to install this packages, the data files are already
132 created.
133
134 %package locale
135 Summary:        Locale Data for Localized Programs
136 License:        GPL-2.0+ and MIT and LGPL-2.1+
137 Requires(post): /usr/bin/cat
138 Requires:       glibc = %{version}
139 %description locale
140 Locale data for the internationalisation features of the GNU C library.
141
142 %package profile
143 Summary:        Libc Profiling and Debugging Versions
144 License:        LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+
145 Group:          Base/Utilities
146 Requires:       glibc = %{version}
147
148 %description profile
149 This package contains special versions of the GNU C library which are
150 necessary for profiling and debugging.
151
152 %package devel
153 Summary:        Include Files and Libraries Mandatory for Development
154 License:        BSD-3-Clause and LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+
155 Requires:       glibc = %{version}
156 Requires:       linux-kernel-headers
157
158 %description devel
159 These libraries are needed to develop programs which use the standard C
160 library.
161
162 %package devel-static
163 Summary:        C library static libraries for -static linking
164 License:        BSD-3-Clause and LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+
165 Requires:       %{name}-devel = %{version}
166 # Provide Fedora name for package to make packaging easier
167 Provides:       %{name}-static = %version
168
169 %description devel-static
170 The glibc-devel-static package contains the C library static libraries
171 for -static linking.  You don't need these, unless you link statically,
172 which is highly discouraged.
173
174 %package devel-utils
175 Summary:        Development utilities from GNU C library
176 License:        LGPL-2.1+
177 Requires:       glibc = %{version}
178
179 %description devel-utils
180 The glibc-devel-utils package contains various binaries which can be helpful during program
181 debugging.
182
183 If you are unsure if you need this, don't install this package.
184
185 %package extra
186 Summary:        Extra binaries from GNU C Library
187 License:        LGPL-2.1+
188 Requires:       glibc = %{version}
189
190 %description extra
191 The glibc-extra package contains some extra binaries for glibc that
192 are not essential but recommend to use.
193
194 makedb: A program to create a database for nss
195
196 %package obsolete
197 Summary:        Obsolete Shared Libraries from the GNU C Library
198 License:        LGPL-2.0+
199 Requires:       glibc = %{version}
200
201 %description obsolete
202 This package provides some old libraries from the GNU C Library which
203 are no longer supported. Additional it provides a compatibility library
204 for old binaries linked against glibc 2.0.
205
206 Install this package if you need one of this libraries to get old
207 binaries working, but since this libraries are not supported and there
208 is no gurantee that they work for you, you should try to get newer
209 versions of your software.
210
211 %package testresults
212 Summary:       Testsuite results
213 License:       LGPL-2.1+
214 Group:         Development/Languages
215 %description testresults
216 Results from running the glibc testsuites.
217
218 %{?asan:
219 %ifarch %asan_arch
220 %package asan
221 Summary:     glibc with ASan instrumentation
222 License:     LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+
223 Requires:    glibc = %{version}
224
225 %description asan
226 This package provides glibc with ASan instrumentation
227
228 %post asan
229 ln -s --force /%{_lib}/libc-2.24-asan.so /%{_lib}/libc.so.6
230
231 %preun asan
232 ln -s --force /%{_lib}/libc-2.24.so /%{_lib}/libc.so.6
233
234 %endif
235 }
236
237 %prep
238 %setup -n glibc-%{version} -q 
239 cp %{SOURCE1001} .
240
241 %build
242 %{?asan:%gcc_unforce_options}
243 if [ -x /bin/uname.bin ]; then
244         /bin/uname.bin -a
245 else
246         uname -a
247 fi
248 uptime || :
249 ulimit -a
250 nice
251 # We do not want configure to figure out the system its building one
252 # to support a common ground and thus set build and host to the
253 # target_cpu.
254 %ifarch %arm
255 %define target %{_target_cpu}-tizen-linux-gnueabi
256 %else
257 %define target %{_target_cpu}-tizen-linux
258 %endif
259 # Don't use as-needed, it breaks glibc assumptions
260 # Before enabling it, run the testsuite and verify that it
261 # passes completely
262 export LD_AS_NEEDED=0
263 # Adjust glibc version.h
264 echo "#define CONFHOST \"%{target}\"" >> version.h
265 echo "#define GITID \"%{git_id}\"" >> version.h
266 #
267 # Default CFLAGS and Compiler
268 #
269 BuildFlags=$(echo %{optflags} | sed -e "s/-Wp,-D_FORTIFY_SOURCE=2//g" | sed -e "s/-ffast-math//" | sed -e "s/atom/i686/g" | sed -e "s/-fexceptions//" | sed -e "s/-fno-omit-frame-pointer//" )
270 BuildFlags="$BuildFlags -O2 -g -U_FORTIFY_SOURCE"
271 BuildFlags="$(echo $BuildFlags | sed -e 's#-ffortify=[0-9]*##')"
272 BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector-strong##')"
273 BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector##')"
274 BuildFlags="$(echo $BuildFlags | sed -e 's/-Wa,-mimplicit-it=thumb//g' | sed -e 's/-mthumb//g')"
275 # Turn off all -Wformat enable flags as there are glibc tests that explicitly
276 # append -Wno-format and with enabled Wformat options that produced warnings
277 # that turns into errors. Remove -Wformat=1|2 or -Wformat-..-arg
278 BuildFlags="$(echo $BuildFlags | sed -re 's/-Wformat((=[1-2])|((-\w+)+))?(\s|$)//g')"
279
280 BuildCC="%__cc"
281 BuildCCplus="%__cxx"
282 add_ons=",libidn"
283
284 BuildFlags="$BuildFlags -g"
285
286 %ifarch %arm
287 # Glibc must have both functions' implementations
288 BuildFlags="$BuildFlags -U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
289 %endif
290 %if %{disable_assert}
291         BuildFlags="$BuildFlags -DNDEBUG=1"
292 %endif
293 %ifarch %ix86
294         BuildFlags="$(echo $BuildFlags | sed -e 's/-g2//g' | sed -e 's/-g//g')"
295         add_ons=$add_ons
296 %endif
297 %ifarch %arm aarch64
298         add_ons=$add_ons
299 %endif
300 %ifarch mipsel
301         # fails to build otherwise - need to recheck and fix
302         %define enable_stackguard_randomization 0
303 %endif
304
305 configure_and_build_glibc() {
306         local dirname="$1"; shift
307         local cflags="$1"; shift
308         local addons="$1"; shift
309         mkdir "cc-$dirname"
310         cd "cc-$dirname"
311         conf_cflags="$cflags -funwind-tables -fPIC"
312         %{?asan: conf_cflags="$conf_cflags -DASAN_INIT_FIRST "}
313
314         profile="--disable-profile"
315 %if %{build_profile}
316         if [ "$dirname" = "base" ] ; then
317             profile="--enable-profile"
318         fi
319 %endif
320         CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \
321         CC="$BuildCC" CXX="$BuildCCplus"  ../configure \
322                 --prefix=%{_prefix} \
323                 --libexecdir=%{_libexecdir} --infodir=%{_infodir} \
324                 --enable-add-ons=$addons \
325                 $profile \
326                 "$@" \
327 %if %{enable_stackguard_randomization}
328                 --enable-stackguard-randomization \
329 %endif
330                 --build=%{target} --host=%{target} \
331 %ifnarch %{multiarcharches}
332                 --disable-multi-arch \
333 %endif
334 %ifarch %{ix86} x86_64 
335                 --disable-mathvec \
336 %endif
337                 --enable-kernel=%{enablekernel} \
338                 --enable-bind-now  --enable-obsolete-rpc \
339                 --disable-nscd \
340                 --disable-experimental-malloc \
341                 libc_cv_cc_pie_default=yes
342         # explicitly set CFLAGS to use the full CFLAGS (not the reduced one for configure)
343         make %{?_smp_mflags} #CFLAGS="$cflags" BUILD_CFLAGS="$cflags"
344         cd ..
345 }
346
347 configure_flags="--prefix=/usr --without-cvs --without-selinux --enable-stackguard-randomization --enable-obsolete-rpc --disable-mathvec"
348
349 configure_flags="$configure_flags --disable-sanity-checks"
350
351 build_asan() {
352   HERE=%{_builddir}/%{name}-%{version}
353   J=${J:-32}
354   GLIBC=$HERE
355   ASAN_BUILD=$HERE/asan-build
356   unset CXXFLAGS
357   unset CFLAGS
358   unset LDFLAGS
359   #chmod +x $HERE/asan-glibc-gcc-wrapper.py
360   #build static wrapper, because we don't want asan to intercept allocators
361   g++ -o gcc-wrapper gcc-wrapper.cc -O3 -funroll-loops -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions -static
362
363   rm -rf $ASAN_BUILD
364   mkdir -p $ASAN_BUILD
365   cd $ASAN_BUILD
366 #  CC=$HERE/asan-glibc-gcc-wrapper.py $GLIBC/configure $configure_flags
367   CC=$HERE/gcc-wrapper $GLIBC/configure $configure_flags
368
369   # Quick build - builds only libraries, but does not create symlinks.
370   make -r -j $J -C $GLIBC objdir=`pwd` subdir_lib
371   #make -r -j $J -C $GLIBC objdir=`pwd` install_root=$ASAN_INST install-lib
372   cd $HERE
373 }
374
375         #
376         # Build base glibc
377         #
378         configure_and_build_glibc base "$BuildFlags" "$add_ons"
379
380 %{?asan:
381 %ifarch %{asan_arch}
382 build_asan
383 %endif
384 }
385 #
386 # Build html documentation
387 #
388 %if %{build_html}
389 make -C cc-base html
390 %endif
391
392 #
393 # Build glibc_post_upgrade binary
394 #
395 $BuildCC -static %{optflags} -Os $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_post_upgrade \
396      -Lcc-base -Bcc-base/csu \
397     '-DREMOVE_TLS_DIRS' '-DREMOVE_PPC_OPTIMIZE_POWER5' \
398     '-DLIBDIR="/%{_lib}"' '-DGCONV_MODULES_DIR="%{_libdir}/gconv"'
399
400 #
401 # Build testsuite
402 #
403 # #check sections could be redefined/disabled, so keep this inside #build
404
405 %{?glibc_run_tests:
406   export LD_AS_NEEDED=0
407   (make %{?_smp_mflags} -C cc-base check || true) 2>&1 | tee check.log
408 }
409
410
411 #######################################################################
412 ###
413 ### CHECK
414 ###
415 #######################################################################
416
417 %check
418 # The testsuite will fail if asneeded is used
419 export LD_AS_NEEDED=0
420 # This has to pass on all platforms!
421 # Exceptions:
422 # None!
423 make %{?_smp_mflags} -C cc-base check-abi
424
425 #######################################################################
426 ###
427 ### INSTALL
428 ###
429 #######################################################################
430
431 %install
432 # We don't want to strip the .symtab from our libraries in find-debuginfo.sh,
433 # certainly not from libpthread.so.* because it is used by libthread_db to find
434 # some non-exported symbols in order to detect if threading support
435 # should be enabled.  These symbols are _not_ exported, and we can't easily
436 # export them retroactively without changing the ABI.  So we have to
437 # continue to "export" them via .symtab, instead of .dynsym :-(
438 # But we also want to keep .symtab and .strtab of other libraries since some
439 # debugging tools currently require these sections directly inside the main
440 # files - specifically valgrind and PurifyPlus.
441 export STRIP_KEEP_SYMTAB=*.so*
442
443 # Make sure we will create the gconv-modules.cache
444 mkdir -p %{buildroot}%{_libdir}/gconv
445 touch %{buildroot}%{_libdir}/gconv/gconv-modules.cache
446
447 # Install base glibc
448 make %{?_smp_mflags} install_root=%{buildroot} install -C cc-base
449
450 install_optimized_variant() {
451         local dirname="$1"; shift
452         local subdir="$1"; shift
453         local subdir_up="$1"; shift
454
455 cd "cc-$dirname"
456 destdir=$RPM_BUILD_ROOT/%{_lib}/$subdir
457 mkdir -p $destdir
458 # Don't run a complete make install, we know which libraries
459 # we want
460 for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db
461 do
462   libbase=${lib#*/}
463   libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so)
464   # Only install if different from base lib
465   if cmp -s ${lib}.so ../cc-base/${lib}.so; then
466     ln -sf $subdir_up/$libbaseso $destdir/$libbaseso
467   else
468     cp -a ${lib}.so $destdir/$libbaseso
469   fi
470   # Emulate ldconfig
471   ln -sf $libbaseso $destdir/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*)
472 done
473 cd ..
474 }
475
476
477 # Install locales
478 %if %{build_locales}
479         # XXX Do not install locales in parallel!
480         cd cc-base
481         # localedef creates hardlinks to other locales if possible
482         # this will not work if we generate them in parallel.
483         # thus we need to run fdupes on  /usr/lib/locale/
484         # Still, on my system this is a speed advantage:
485         # non-parallel build for install-locales: 9:34mins
486         # parallel build with fdupes: 7:08mins
487         make %{?_smp_mflags} install_root=%{buildroot} localedata/install-locales
488         %fdupes %{buildroot}/usr/lib/locale
489         cd ..
490 %endif
491 # Create file list for glibc-locale package
492 %{find_lang} libc
493
494 # Prepare obsolete/, used only on some architectures:
495 export RPM_BUILD_ROOT
496 %ifarch %ix86
497 mkdir -p %{buildroot}/%{_lib}/obsolete
498 %endif
499
500 # NPTL <bits/stdio-lock.h> is not usable outside of glibc, so include
501 # the generic one (RH#162634)
502 # cp -av bits/stdio-lock.h %{buildroot}%{_includedir}/bits/stdio-lock.h
503
504
505 # Miscelanna:
506
507 install -m 0700 glibc_post_upgrade %{buildroot}%{_sbindir}
508
509 install -m 644 %{SOURCE7} %{buildroot}/etc
510 install -m 644 %{SOURCE5} %{buildroot}/etc
511 install -m 644 posix/gai.conf %{buildroot}/etc
512
513 mkdir -p %{buildroot}/etc/default
514 install -m 644 nis/nss %{buildroot}/etc/default/
515
516 mkdir -p %{buildroot}%{_includedir}/resolv
517 install -m 0644 resolv/mapv4v6addr.h %{buildroot}%{_includedir}/resolv/
518 install -m 0644 resolv/mapv4v6hostent.h %{buildroot}%{_includedir}/resolv/
519
520 %if %{build_html}
521 mkdir -p %{buildroot}%{_datadir}/doc/glibc
522 cp -p cc-base/manual/libc/*.html %{buildroot}%{_datadir}/doc/glibc
523 %endif
524
525
526 #
527 # Create ld.so.conf
528 #
529 cat > %{buildroot}/etc/ld.so.conf <<EOF
530 %if "%{_lib}" == "lib64"
531 /usr/local/lib64
532 %endif
533 /usr/local/lib
534 include /etc/ld.so.conf.d/*.conf
535 # /lib64, /lib, /usr/lib64 and /usr/lib gets added
536 # automatically by ldconfig after parsing this file.
537 # So, they do not need to be listed.
538 EOF
539 # Add ldconfig cache directory for directory ownership
540 mkdir -p %{buildroot}/var/cache/ldconfig
541 # Empty the ld.so.cache:
542 rm -f %{buildroot}/etc/ld.so.cache
543 touch %{buildroot}/etc/ld.so.cache
544
545 # Don't look at ldd! We don't wish a /bin/sh requires
546 chmod 644 %{buildroot}%{_bindir}/ldd
547
548 # Remove timezone data, now coming in standalone package:
549 for i in sbin/sln usr/bin/tzselect usr/sbin/zic usr/sbin/zdump etc/localtime; do
550         rm -f %{buildroot}/$i
551 done
552 rm -rf %{buildroot}%{_datadir}/zoneinfo
553
554 %ifarch armv7hl
555 # Provide compatibility link
556 ln -s ld-%{glibc_major_version}.so %{buildroot}/lib/ld-linux.so.3
557 %endif
558
559 # Move getconf to %{_libexecdir}/getconf/ to avoid cross device link
560 mv %{buildroot}%{_bindir}/getconf %{buildroot}%{_libexecdir}/getconf/getconf
561 ln -s %{_libexecdir}/getconf/getconf %{buildroot}%{_bindir}/getconf
562
563 #######################################################################
564 ###
565 ### ...
566 ###
567 #######################################################################
568
569 %{?asan:
570 %ifarch %{asan_arch}
571 HERE=%{_builddir}/%{name}-%{version}
572 GLIBC=$HERE
573 ASAN_BUILD=$HERE/asan-build
574 cp $ASAN_BUILD/libc.so %{buildroot}/%{_lib}/libc-2.24-asan.so
575 %endif
576 }
577
578 %{?glibc_run_tests:
579   mkdir testresults
580   cp --parents $(find cc-base -name "*tests.sum") testresults/
581   cp check.log testresults/
582   chmod 644 $(find testresults/ -type f)
583 }
584
585 %post -p %{_sbindir}/glibc_post_upgrade
586
587 %postun -p /sbin/ldconfig
588
589 %post locale
590 for l in /usr/share/locale/locale.alias %{_libdir}/gconv/gconv-modules; do
591         [ -d "$l.d" ] || continue
592         echo "###X# The following is autogenerated from extra files in the .d directory:" >>"$l"
593         cat "$l.d"/* >>"$l"
594 done
595 /usr/sbin/iconvconfig
596
597 %post info
598 %install_info --info-dir=%{_infodir} %{_infodir}/libc.info.gz
599
600 %postun info
601 %install_info_delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz
602
603 %files
604 %manifest %{name}.manifest
605 # glibc
606 %defattr(-,root,root)
607 %license LICENSES COPYING COPYING.LIB
608 %config(noreplace) /etc/bindresvport.blacklist
609 %config /etc/ld.so.conf
610 %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
611 %config(noreplace) /etc/rpc
612 %verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf
613 %verify(not md5 size mtime) %config(noreplace) /etc/gai.conf
614 %config(noreplace) /etc/default/nss
615 /%{_lib}/ld-%{glibc_major_version}.so
616
617 # Each architecture has a different name for the dynamic linker:
618 %ifarch %arm
619 %ifarch armv7hl
620 /%{_lib}/ld-linux-armhf.so.3
621 # Keep compatibility link
622 /%{_lib}/ld-linux.so.3
623 %else
624 /%{_lib}/ld-linux.so.3
625 %endif
626 %endif
627 %ifarch x86_64
628 /%{_lib}/ld-linux-x86-64.so.2
629 %endif
630 %ifarch %ix86 %sparc
631 /%{_lib}/ld-linux.so.2
632 %endif
633 %ifarch aarch64
634 /lib/ld-linux-aarch64.so.1
635 /%{_lib}/ld-linux-aarch64.so.1
636 %endif
637
638 /%{_lib}/libanl-%{glibc_major_version}.so
639 /%{_lib}/libanl.so.1
640 /%{_lib}/libc-%{glibc_major_version}.so
641 /%{_lib}/libc.so.6*
642 /%{_lib}/libcrypt-%{glibc_major_version}.so
643 /%{_lib}/libcrypt.so.1
644 /%{_lib}/libdl-%{glibc_major_version}.so
645 /%{_lib}/libdl.so.2*
646 /%{_lib}/libm-%{glibc_major_version}.so
647 /%{_lib}/libm.so.6*
648 /%{_lib}/libnsl-%{glibc_major_version}.so
649 /%{_lib}/libnsl.so.1
650 /%{_lib}/libnss_compat-%{glibc_major_version}.so
651 /%{_lib}/libnss_compat.so.2
652 /%{_lib}/libnss_db-%{glibc_major_version}.so
653 /%{_lib}/libnss_db.so.2
654 /%{_lib}/libnss_dns-%{glibc_major_version}.so
655 /%{_lib}/libnss_dns.so.2
656 /%{_lib}/libnss_files-%{glibc_major_version}.so
657 /%{_lib}/libnss_files.so.2
658 /%{_lib}/libnss_optfiles-%{glibc_major_version}.so
659 /%{_lib}/libnss_optfiles.so.2
660 /%{_lib}/libnss_hesiod-%{glibc_major_version}.so
661 /%{_lib}/libnss_hesiod.so.2
662 /%{_lib}/libpthread-%{glibc_major_version}.so
663 /%{_lib}/libpthread.so.0
664 /%{_lib}/libthread_db-1.0.so
665 /%{_lib}/libthread_db.so.1
666 /%{_lib}/libresolv-%{glibc_major_version}.so
667 /%{_lib}/libresolv.so.2
668 /%{_lib}/librt-%{glibc_major_version}.so
669 /%{_lib}/librt.so.1
670 /%{_lib}/libutil-%{glibc_major_version}.so
671 /%{_lib}/libutil.so.1
672 %define optimized_libs() \
673         %dir %attr(0755,root,root) /%{_lib}/%1\
674         /%{_lib}/%1/libc-%{glibc_major_version}.so\
675         /%{_lib}/%1/libc.so.6*\
676         /%{_lib}/%1/libm-%{glibc_major_version}.so\
677         /%{_lib}/%1/libm.so.6*\
678         /%{_lib}/%1/libpthread-%{glibc_major_version}.so\
679         /%{_lib}/%1/libpthread.so.0\
680         /%{_lib}/%1/librt-%{glibc_major_version}.so\
681         /%{_lib}/%1/librt.so.1\
682         /%{_lib}/%1/libthread_db-1.0.so\
683         /%{_lib}/%1/libthread_db.so.1
684
685 %dir %attr(0700,root,root) /var/cache/ldconfig
686 /sbin/ldconfig
687 %{_bindir}/gencat
688 %{_bindir}/getconf
689 %{_bindir}/getent
690 %{_bindir}/iconv
691 %attr(755,root,root) %{_bindir}/ldd
692 %ifarch %ix86 sparc sparcv9
693         %{_bindir}/lddlibc4
694 %endif
695 %{_bindir}/locale
696 %{_bindir}/localedef
697 %dir %attr(0755,root,root) %{_libexecdir}/getconf
698 %{_libexecdir}/getconf/*
699 %{_sbindir}/glibc_post_upgrade
700 %{_sbindir}/iconvconfig
701 /%{_lib}/libBrokenLocale-%{glibc_major_version}.so
702 /%{_lib}/libBrokenLocale.so.1
703
704 %ifarch %ix86
705
706 %files obsolete
707 %manifest %{name}.manifest
708 %license COPYING.LIB
709 %defattr (755,root,root,755)
710 %dir /%{_lib}/obsolete/
711         #%dir /%{_lib}/obsolete/noversion
712         #/%{_lib}/obsolete/noversion/libNoVersion-%{glibc_major_version}.so
713         #/%{_lib}/obsolete/noversion/libNoVersion.so.1
714 %endif
715
716 %files locale -f libc.lang
717 %manifest %{name}.manifest
718 %license COPYING COPYING.LIB
719 %defattr(-,root,root)
720 %{_datadir}/locale/locale.alias
721 %if %{build_locales}
722 /usr/lib/locale/*
723 %endif
724 %{_libdir}/gconv
725
726 %{?asan:
727 %ifarch %{asan_arch}
728 %files asan
729 %manifest %{name}.manifest
730 /%{_lib}/libc-2.24-asan.so
731 %endif
732 }
733
734 %files devel
735 %manifest %{name}.manifest
736 %defattr(-,root,root)
737 %license COPYING COPYING.LIB 
738 %doc NEWS README
739 %{_bindir}/rpcgen
740 %{_includedir}/*
741 %{_libdir}/*.o
742 %{_libdir}/*.so
743 # These static libraries are needed even for shared builds
744 %{_libdir}/libc_nonshared.a
745 %{_libdir}/libg.a
746 %ifarch ppc ppc64 s390 s390x sparc sparcv8 sparcv9 sparcv9v
747 # This is not built on sparc64.
748         %{_libdir}/libnldbl_nonshared.a
749 %endif
750 %{_libdir}/libmcheck.a
751 %{_libdir}/librpcsvc.a
752
753 %files devel-static
754 %manifest %{name}.manifest
755 %defattr(-,root,root)
756 %{_libdir}/libBrokenLocale.a
757 %{_libdir}/libanl.a
758 %{_libdir}/libc.a
759 %{_libdir}/libcrypt.a
760 %{_libdir}/libdl.a
761 %{_libdir}/libm.a
762 %{_libdir}/libpthread.a
763 %{_libdir}/libresolv.a
764 %{_libdir}/librt.a
765 %{_libdir}/libutil.a
766
767 %files info
768 %manifest %{name}.manifest
769 %defattr(-,root,root)
770 %doc %{_infodir}/libc.info.gz
771 %doc %{_infodir}/libc.info-?.gz
772 %doc %{_infodir}/libc.info-??.gz
773
774 %if %{build_html}
775 %files html
776 %manifest %{name}.manifest
777 %defattr(-,root,root)
778 %doc %{_prefix}/share/doc/glibc
779 %endif
780
781 %files i18ndata
782 %manifest %{name}.manifest
783 %defattr(-,root,root)
784 %{_prefix}/share/i18n
785
786 %if %{build_profile}
787 %files profile
788 %manifest %{name}.manifest
789 %license COPYING COPYING.LIB
790 %defattr(-,root,root)
791 %{_libdir}/libc_p.a
792 %{_libdir}/libBrokenLocale_p.a
793 %{_libdir}/libanl_p.a
794 %{_libdir}/libm_p.a
795 %{_libdir}/libcrypt_p.a
796 %{_libdir}/libpthread_p.a
797 %{_libdir}/libresolv_p.a
798 %{_libdir}/librt_p.a
799 %{_libdir}/librpcsvc_p.a
800 %{_libdir}/libutil_p.a
801 %{_libdir}/libdl_p.a
802 %endif
803
804 %files devel-utils
805 %manifest %{name}.manifest
806 %defattr(-,root,root)
807 /%{_lib}/libmemusage.so
808 /%{_lib}/libpcprofile.so
809 /%{_libdir}/libBrokenLocale.so
810 /%{_lib}/libSegFault.so
811 /%{_lib}/libthread_db-1.0.so
812 /%{_lib}/libthread_db.so.1
813 /%{_libdir}/libthread_db.so
814 %dir /%{_libdir}/audit
815 /%{_libdir}/audit/sotruss-lib.so
816 # These need gd-devel for building
817 # %%{_bindir}/memusage
818 # %%{_bindir}/memusagestat
819 %{_bindir}/mtrace
820 %{_bindir}/pcprofiledump
821 %{_bindir}/sotruss
822 %{_bindir}/xtrace
823 %{_bindir}/pldd
824 %{_bindir}/catchsegv
825 %{_bindir}/sprof
826
827 %files extra
828 %manifest %{name}.manifest
829 %license COPYING.LIB
830 %defattr(-,root,root)
831 %{_bindir}/makedb
832 /var/db/Makefile
833
834 %{?glibc_run_tests:
835 %files testresults
836 %defattr(-,root,root)
837 %doc testresults/check.log
838 %doc testresults/*
839 }
840
841 %docs_package