From patchwork Tue Oct 3 22:47:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 23310 Received: (qmail 67067 invoked by alias); 3 Oct 2017 22:48:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 66970 invoked by uid 89); 3 Oct 2017 22:48:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f47.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=A6/d5eYYQptlmC+HG9hXaM3c577mWKhHIdOhXOF4yJg=; b=GQaIum1sVftSo3e8KzFt7Yd0bu29huMCMlMT+ezpDGuKCSIwOAvDsBLOm7mKHEXnIw RujaDTbBOeoglzPqSiUj+6jy2M+Wm66CKu1g5fcW9rrZHOwyj+EkBmJIpWF1jNvBCCsR NJR6NW+gVGmXbrORr78r94JMm+uaTcH/YwtQUbV7eI70U/Rg712TYrSoYTJf7EwKOK/q L6Wjc6o51ZrksCPn+47N28ZCIo4XZyTKuTEccdyXcoSoLt96Qtx4VoaXdb4F8GfTpDXJ JFaBYIds+wfHeuQLt0be+r21mBQK/Z7DAWj0/zVcwp4DIbenODwNJ6Ya/FptzXDJvE01 4jmw== X-Gm-Message-State: AMCzsaUK7HvGQ+cQeut46GAPetCII6wGQpKml+2UC/rxaVi8r7aPUdHE FYotB7SjlFmGki8Y3nw7sjUw8gB3 X-Google-Smtp-Source: AOwi7QAQNxVKMlniJ8ZDB85Gf/D710koX+7dzJZAlmZ5t7rjFlG/aviKBu7Q8MgFe/n/k2cUKu7U/w== X-Received: by 10.157.20.141 with SMTP id d13mr9712043ote.361.1507070879023; Tue, 03 Oct 2017 15:47:59 -0700 (PDT) Date: Tue, 3 Oct 2017 15:47:51 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Use $(DEFAULT-LDFLAGS-$(@F)) in +link-static-before-libc Message-ID: <20171003224751.GA23183@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.0 (2017-09-02) Use $(LDFLAGS-$(@F)) with tst-tls1-static-non-pie may not be sufficient when static PIE is built by default. Use $(DEFAULT-LDFLAGS-$(@F)) in +link-static-before-libc to make sure that tst-tls1-static-non-pie is always built as non-PIE static executable. Any comments? H.J. --- * Makeconfig (+link-static-before-libc): Use $(DEFAULT-LDFLAGS-$(@F)). * elf/Makefile (LDFLAGS-tst-tls1-static-non-pie): Renamed to ... (DEFAULT-LDFLAGS-tst-tls1-static-non-pie): This. --- Makeconfig | 1 + elf/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makeconfig b/Makeconfig index b51904b797..0ceff92a3d 100644 --- a/Makeconfig +++ b/Makeconfig @@ -435,6 +435,7 @@ endif # Command for statically linking programs with the C library. ifndef +link-static +link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \ + $(DEFAULT-LDFLAGS-$(@F)) \ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ $(addprefix $(csu-objpfx),$(static-start-installed-name)) \ $(+preinit) $(+prectorT) \ diff --git a/elf/Makefile b/elf/Makefile index c6edebd4ee..06e2e4cd08 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -152,7 +152,7 @@ tests-static-internal := tst-tls1-static tst-tls2-static \ tst-ptrguard1-static tst-stackguard1-static \ tst-tls1-static-non-pie -LDFLAGS-tst-tls1-static-non-pie = $(no-pie-ldflag) +DEFAULT-LDFLAGS-tst-tls1-static-non-pie = $(no-pie-ldflag) tests := tst-tls9 tst-leaks1 \ tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \