~ubuntu-branches/ubuntu/trusty/eglibc/trusty

« back to all changes in this revision

Viewing changes to .pc/any/local-rtld.diff/Makeconfig

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-10 18:39:35 UTC
  • mfrom: (1.5.2) (4.4.24 experimental)
  • Revision ID: package-import@ubuntu.com-20130110183935-afsgfxkmg7wk5eaj
Tags: 2.17-0ubuntu1
* Merge with Debian, bringing in a new upstream and many small fixes:
  - patches/any/cvs-malloc-deadlock.diff: Dropped, merged upstream.
  - patches/ubuntu/lddebug-scopes.diff: Rebase for upstream changes.
  - patches/ubuntu/local-CVE-2012-3406.diff: Rebased against upstream.
  - patches/ubuntu/no-asm-mtune-i686.diff: Fixed in recent binutils.
* This upstream merge fixes a nasty hang in pulseaudio (LP: #1085342)
* Bump MIN_KERNEL_SUPPORTED to 2.6.32 on ARM, now that we no longer
  have to support shonky 2.6.31 kernels on imx51 babbage builders.
* Drop patches/ubuntu/local-disable-nscd-host-caching.diff, as these
  issues were apparently resolved upstream a while ago (LP: #613662)
* Fix the compiled-in bug URL to point to launchpad.net, not Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
.. := ../
34
34
endif
35
35
 
36
 
# If config.make exists, the source directory was configured,
37
 
# so don't try to be clever and find another directory to build in.
38
 
ifneq (,$(wildcard $(..)config.make))
39
 
ARCH =
40
 
machine =
41
 
else    # Not configured.
42
 
ifndef ARCH
43
 
ifdef machine
44
 
ARCH = $(machine)
45
 
endif # machine
46
 
endif # ARCH
47
 
endif # config.make
48
 
 
49
 
# Directory for object files and libc.a.  If this is not defined, the
50
 
# object files live in the subdirectories where their sources live, and
51
 
# libc.a lives in the parent directory (this probably doesn't work any
52
 
# more).
53
 
ifdef ARCH
54
 
ifeq ($(filter /%,$(ARCH)),)
55
 
objdir := $(..)$(ARCH)
56
 
else
57
 
objdir = $(ARCH)
58
 
endif
59
 
endif
60
 
 
61
36
# $(common-objdir) is the place to put objects and
62
37
# such that are not specific to a single subdir.
63
38
ifdef objdir
65
40
common-objpfx = $(objdir)/
66
41
common-objdir = $(objdir)
67
42
else
68
 
objpfx :=
69
 
ifdef ..
70
 
common-objpfx = $(..)
71
 
common-objdir = ..
72
 
else
73
 
# This is a kludge.  make wizards might grok.
74
 
common-objpfx = sysdeps/../
75
 
common-objdir = .
76
 
endif
 
43
objdir must be defined by the build-directory Makefile.
77
44
endif
78
45
 
79
46
# Root of the sysdeps tree.
89
56
# What flags to give to tests which test stack alignment
90
57
stack-align-test-flags =
91
58
 
92
 
# We have a special subdir for each binary format.
93
 
# For now, only ELF is fully supported.
94
 
binfmt-subdir = elf
95
 
 
96
59
# Complete path to sysdep dirs.
97
60
# `configure' writes a definition of `config-sysdirs' in `config.make'.
98
61
sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D))
420
383
LDFLAGS-rtld += $(hashstyle-LDFLAGS)
421
384
endif
422
385
 
423
 
# Command for linking programs with the C library.
424
 
ifndef +link
425
 
+link = $(CC) -nostdlib -nostartfiles -o $@ \
426
 
              $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
427
 
              $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
428
 
              $(addprefix $(csu-objpfx),$(start-installed-name)) \
429
 
              $(+preinit) $(+prector) \
430
 
              $(filter-out $(addprefix $(csu-objpfx),start.o \
431
 
                                                     $(start-installed-name))\
432
 
                           $(+preinit) $(link-extra-libs) \
433
 
                           $(common-objpfx)libc% $(+postinit),$^) \
434
 
              $(link-extra-libs) $(link-libc) $(+postctor) $(+postinit)
435
 
endif
436
386
# Command for linking PIE programs with the C library.
437
387
ifndef +link-pie
438
388
+link-pie = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
448
398
endif
449
399
# Command for statically linking programs with the C library.
450
400
ifndef +link-static
451
 
+link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
 
401
+link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
452
402
              $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F))  \
453
403
              $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
454
 
              $(+preinit) $(+prector) \
 
404
              $(+preinit) $(+prectorT) \
455
405
              $(filter-out $(addprefix $(csu-objpfx),start.o \
456
406
                                                     $(start-installed-name))\
457
407
                           $(+preinit) $(link-extra-libs-static) \
458
408
                           $(common-objpfx)libc% $(+postinit),$^) \
459
 
              $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
 
409
              $(link-extra-libs-static)
 
410
+link-static-after-libc = $(+postctorT) $(+postinit)
 
411
+link-static = $(+link-static-before-libc) $(link-libc-static) \
 
412
               $(+link-static-after-libc)
 
413
+link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
 
414
                     $(+link-static-after-libc)
 
415
endif
 
416
# Commands for linking programs with the C library.
 
417
ifndef +link
 
418
ifeq (yes,$(build-shared))
 
419
+link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
 
420
              $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
 
421
              $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
 
422
              $(addprefix $(csu-objpfx),$(start-installed-name)) \
 
423
              $(+preinit) $(+prector) \
 
424
              $(filter-out $(addprefix $(csu-objpfx),start.o \
 
425
                                                     $(start-installed-name))\
 
426
                           $(+preinit) $(link-extra-libs) \
 
427
                           $(common-objpfx)libc% $(+postinit),$^) \
 
428
              $(link-extra-libs)
 
429
+link-after-libc = $(+postctor) $(+postinit)
 
430
+link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
 
431
+link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
 
432
else
 
433
+link = $(+link-static)
 
434
+link-tests = $(+link-static-tests)
 
435
endif
460
436
endif
461
437
# Command for statically linking bounded-pointer programs with the C library.
462
438
ifndef +link-bounded
463
439
+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
464
440
              $(sysdep-LDFLAGS) $(LDFLAGS)  \
465
441
              $(addprefix $(csu-objpfx),b$(static-start-installed-name)) \
466
 
              $(+preinit) $(+prector) \
 
442
              $(+preinit) $(+prectorT) \
467
443
              $(filter-out $(addprefix $(csu-objpfx),start.ob \
468
444
                                                     $(start-installed-name))\
469
445
                           $(+preinit) $(link-extra-libs-bounded) \
470
446
                           $(common-objpfx)libc% $(+postinit),$^) \
471
 
              $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctor) $(+postinit)
 
447
              $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
472
448
endif
473
449
ifndef config-LDFLAGS
474
450
ifeq (yes,$(build-shared))
480
456
# We need the versioned name of libc.so in the deps of $(others) et al
481
457
# so that the symlink to libc.so is created before anything tries to
482
458
# run the linked programs.
483
 
link-libc = -Wl,-rpath-link=$(rpath-link) \
 
459
link-libc-before-gnulib = -Wl,-rpath-link=$(rpath-link) \
484
460
            $(common-objpfx)libc.so$(libc.so-version) \
485
461
            $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
486
 
            $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib)
 
462
            $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed)
 
463
link-libc = $(link-libc-before-gnulib) $(gnulib)
 
464
link-libc-tests = $(link-libc-before-gnulib) $(gnulib-tests)
487
465
# This is how to find at build-time things that will be installed there.
488
466
rpath-dirs = math elf dlfcn nss nis rt resolv crypt
489
467
rpath-link = \
490
468
$(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
 
469
else
 
470
link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
 
471
link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
 
472
endif
 
473
endif
 
474
 
491
475
elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
492
 
else
493
 
nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
494
 
resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
495
 
link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
496
 
endif
497
 
endif
498
476
 
499
477
# Differences in the linkers on the various platforms.
500
478
LDFLAGS-rpath-ORIGIN = -Wl,-rpath,'$$ORIGIN'
522
500
 
523
501
# The static libraries.
524
502
link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
 
503
link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
525
504
link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
526
505
 
 
506
# How to link against libgcc.  Some libgcc functions, such as those
 
507
# for "long long" arithmetic or software floating point, can always be
 
508
# built without use of C library headers and do not have any global
 
509
# state so can safely be linked statically into any executable or
 
510
# shared library requiring them; these functions are in libgcc.a.
 
511
# Other functions, relating to exception handling, may require C
 
512
# library headers to build and it may not be safe to have more than
 
513
# one copy of them in a process; these functions are only in
 
514
# libgcc_s.so and libgcc_eh.a.
 
515
#
 
516
# To avoid circular dependencies when bootstrapping, it is desirable
 
517
# to avoid use of libgcc_s and libgcc_eh in building glibc.  Where any
 
518
# glibc functionality (in particular, thread cancellation) requires
 
519
# exception handling, this is implemented through dlopen of libgcc_s
 
520
# to avoid unnecessary dependencies on libgcc_s by programs not using
 
521
# that functionality; executables built with glibc do not use
 
522
# exception handling other than through thread cancellation.
 
523
#
 
524
# Undefined references to functions from libgcc_eh or libgcc_s may
 
525
# arise for code built with -fexceptions.  In the case of statically
 
526
# linked programs installed by glibc, unwinding will never actually
 
527
# occur at runtime and the use of elf/static-stubs.c to resolve these
 
528
# references is safe.  In the case of statically linked test programs
 
529
# and test programs built with -fexceptions, unwinding may occur in
 
530
# some cases and it is preferable to link with libgcc_eh or libgcc_s
 
531
# so that the testing is as similar as possible to how programs will
 
532
# be built with the installed glibc.
 
533
#
 
534
# Some architectures have architecture-specific systems for exception
 
535
# handling that may involve undefined references to
 
536
# architecture-specific functions.  On those architectures,
 
537
# gnulib-arch and static-gnulib-arch may be defined in sysdeps
 
538
# makefiles to use additional libraries for linking executables and
 
539
# shared libraries built by glibc.
527
540
ifndef gnulib
528
541
ifneq ($(have-cc-with-libunwind),yes)
529
542
  libunwind =
531
544
  libunwind = -lunwind
532
545
endif
533
546
libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
534
 
gnulib := -lgcc $(libgcc_eh)
535
 
static-gnulib := -lgcc -lgcc_eh $(libunwind)
 
547
gnulib-arch =
 
548
gnulib = -lgcc $(gnulib-arch)
 
549
gnulib-tests := -lgcc $(libgcc_eh)
 
550
static-gnulib-arch =
 
551
# By default, elf/static-stubs.o, instead of -lgcc_eh, is used to
 
552
# statically link programs.  When --disable-shared is used, we use
 
553
# -lgcc_eh since elf/static-stubs.o isn't sufficient.
 
554
ifeq (yes,$(build-shared))
 
555
static-gnulib = -lgcc $(static-gnulib-arch)
 
556
else
 
557
static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch)
 
558
endif
 
559
static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
536
560
libc.so-gnulib := -lgcc
537
561
endif
538
562
+preinit = $(addprefix $(csu-objpfx),crti.o)
542
566
# Variants of the two previous definitions for linking PIE programs.
543
567
+prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
544
568
+postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
 
569
# Variants of the two previous definitions for statically linking programs.
 
570
+prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
 
571
+postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
545
572
+interp = $(addprefix $(elf-objpfx),interp.os)
546
573
csu-objpfx = $(common-objpfx)csu/
547
574
elf-objpfx = $(common-objpfx)elf/
548
575
 
 
576
# A command that, prepended to the name and arguments of a program,
 
577
# and run on the build system, causes that program with those
 
578
# arguments to be run on the host for which the library is built.
 
579
ifndef test-wrapper
 
580
test-wrapper = $(cross-test-wrapper)
 
581
endif
 
582
# Likewise, but the name of the program is preceded by
 
583
# <variable>=<value> assignments for environment variables.
 
584
ifndef test-wrapper-env
 
585
test-wrapper-env = $(test-wrapper) env
 
586
endif
 
587
 
 
588
# Whether to run test programs built for the library's host system.
 
589
ifndef run-built-tests
 
590
ifeq (yes|,$(cross-compiling)|$(test-wrapper))
 
591
run-built-tests = no
 
592
else
 
593
run-built-tests = yes
 
594
endif
 
595
endif
 
596
 
549
597
# How to run a program we just linked with our library.
550
598
# The program binary is assumed to be $(word 2,$^).
551
599
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
555
603
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
556
604
                                       $(filter -Wl$(comma)-rpath-link=%,\
557
605
                                                $(sysdep-LDFLAGS)))))
558
 
# Never use $(run-via-rtld-prefix) for the statically-linked %-bp test
559
 
# programs, or for tests listed in tests-static or xtests-static.
 
606
# $(run-via-rtld-prefix) is a command that, when prepended to the name
 
607
# of a program built with the newly built library, produces a command
 
608
# that, executed on the host for which the library is built, runs that
 
609
# program.  For the statically-linked %-bp test programs, and for
 
610
# tests listed in tests-static or xtests-static, it is empty.
560
611
run-via-rtld-prefix =                                                         \
561
612
  $(if $(strip $(filter $(notdir $(built-program-file)),                      \
562
613
                        $(tests-static) $(xtests-static))                     \
566
617
else
567
618
run-via-rtld-prefix =
568
619
endif
569
 
run-program-prefix = $(cross-test-wrapper) $($*-WRAPPER) \
570
 
                     $(run-via-rtld-prefix)
571
 
built-program-cmd = $(cross-test-wrapper) $($*-WRAPPER) \
 
620
# $(run-program-prefix) is a command that, when prepended to the name
 
621
# of a program built with the newly built library, produces a command
 
622
# that, executed on the build system on which "make" is run, runs that
 
623
# program.
 
624
run-program-prefix = $(test-wrapper) $(run-via-rtld-prefix)
 
625
# $(built-program-cmd) is a command that, executed on the build system
 
626
# on which "make" is run, runs the newly built program that is the
 
627
# second dependency of the makefile target in which
 
628
# $(built-program-cmd) is used.
 
629
built-program-cmd = $(test-wrapper) \
572
630
                    $(run-via-rtld-prefix) $(built-program-file)
573
 
 
574
 
# Same as built-program-cmd, but without the cross-test-wrapper.  Used 
575
 
# to run programs from the test machine, as in nptl/tst-cancel7.
576
 
local-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
 
631
# $(host-built-program-cmd) is a command that, executed on the host
 
632
# for which the library is built, runs the newly built program that is
 
633
# the second dependency of the makefile target in which
 
634
# $(host-built-program-cmd) is used.
 
635
host-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
577
636
 
578
637
ifndef LD
579
638
LD := ld -X
769
828
 
770
829
# The assembler can generate debug information too.
771
830
ifndef ASFLAGS
772
 
ifeq ($(have-cpp-asm-debuginfo),yes)
773
831
ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
774
 
else
775
 
ASFLAGS :=
776
 
endif
777
832
endif
778
833
ASFLAGS += $(ASFLAGS-config) $(asflags-cpu)
779
834
 
922
977
endif # build-shared
923
978
 
924
979
 
925
 
dlfcn = dlfcn
926
980
ifeq ($(build-shared),yes)
927
981
libdl = $(common-objpfx)dlfcn/libdl.so$(libdl.so-version)
928
982
else
961
1015
              grp pwd posix io termios resource misc socket sysvipc gmon    \
962
1016
              gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
963
1017
              crypt nss localedata timezone rt conform debug                \
964
 
              $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
 
1018
              $(add-on-subdirs) dlfcn elf
965
1019
 
966
1020
ifndef avoid-generated
967
1021
all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\
995
1049
sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
996
1050
                                         $(firstword $(subst :, ,$p))))
997
1051
 
 
1052
# A sysdeps Makeconfig fragment may set libc-reentrant to yes.
 
1053
ifeq (yes,$(libc-reentrant))
 
1054
defines += -D_LIBC_REENTRANT
 
1055
 
 
1056
libio-mtsafe = -D_IO_MTSAFE_IO
 
1057
endif
 
1058
 
998
1059
endif # Makeconfig not yet included
999
1060
 
1000
1061
# Local Variables: