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