glibc/gmon
H.J. Lu ce16eb52c0 Replece LDFLAGS-* = $(no-pie-ldflag) with tst-*-no-pie = yes [BZ #22630]
After

commit 9d7a3741c9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 15 16:59:33 2017 -0800

    Add --enable-static-pie configure option to build static PIE [BZ #19574]

and

commit 00c714df39
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Dec 18 12:24:26 2017 -0800

    Pass -no-pie to GCC only if GCC defaults to PIE [BZ #22614]

$(no-pie-ldflag) is no longer effective since no-pie-ldflag is defined
to -no-pie only if GCC defaults to PIE.  When --enable-static-pie is
used to configure glibc build and GCC doesn't default to PIE. no-pie-ldflag
is undefined and these tests:

elf/Makefile:LDFLAGS-tst-dlopen-aout = $(no-pie-ldflag)
elf/Makefile:LDFLAGS-tst-prelink = $(no-pie-ldflag)
elf/Makefile:LDFLAGS-tst-main1 = $(no-pie-ldflag)
gmon/Makefile:LDFLAGS-tst-gmon := $(no-pie-ldflag)

may fail to link.  This patch replaces "-pie" with

$(if $($(@F)-no-pie),$(no-pie-ldflag),-pie)

and repleces

LDFLAGS-* = $(no-pie-ldflag)

with

tst-*-no-pie = yes

so that tst-dlopen-aout, tst-prelink, tst-main1 and tst-gmon are always
built as non-PIE, with and without --enable-static-pie, regardless if
GCC defaults to PIE or non-PIE.

Tested with build-many-glibcs.py without --enable-static-pie as well as
with --enable-static-pie for x86_64, x32 and i686.

	[BZ #22630]
	* Makeconfig (link-pie-before-libc): Replace -pie with
	$(if $($(@F)-no-pie),$(no-pie-ldflag),-pie).
	* elf/Makefile (LDFLAGS-tst-dlopen-aout): Removed.
	(tst-dlopen-aout-no-pie): New.
	(LDFLAGS-tst-prelink): Removed.
	(tst-prelink-no-pie): New.
	(LDFLAGS-tst-main1): Removed.
	(tst-main1-no-pie): New.
	* gmon/Makefile (LDFLAGS-tst-gmon): Removed.
	(tst-gmon-no-pie): New.
2017-12-19 13:53:11 -08:00
..
sys Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gmon.c Support profiling PIE [BZ #22284] 2017-10-12 03:49:40 -07:00
Makefile Replece LDFLAGS-* = $(no-pie-ldflag) with tst-*-no-pie = yes [BZ #22630] 2017-12-19 13:53:11 -08:00
mcount.c Don't use catomic functions in mcount (BZ #16912) 2014-05-06 16:30:48 +02:00
prof-freq.c Moved to csu/errno-loc.c. 2005-12-14 15:06:39 +00:00
profil.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sprofil.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-gmon-gprof.sh gmon: Add test for basic mcount/gprof functionality 2017-08-15 15:49:45 +02:00
tst-gmon-pie.c Support profiling PIE [BZ #22284] 2017-10-12 03:49:40 -07:00
tst-gmon-static-gprof.sh Add a test for profiling static executable 2017-10-14 12:58:55 -07:00
tst-gmon-static-pie.c Add --enable-static-pie configure option to build static PIE [BZ #19574] 2017-12-15 17:12:14 -08:00
tst-gmon-static.c Add a test for profiling static executable 2017-10-14 12:58:55 -07:00
tst-gmon.c gmon: Add test for basic mcount/gprof functionality 2017-08-15 15:49:45 +02:00
tst-profile-static.c * elf/dl-reloc.c [PROF] (_dl_relocate_object): Define 2005-07-07 02:39:45 +00:00
tst-sprofil.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Versions Update. 2001-03-21 20:15:55 +00:00