From patchwork Thu Jul 9 09:38:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 493346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 9C30B140775 for ; Thu, 9 Jul 2015 19:39:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A87CBA4647; Thu, 9 Jul 2015 09:39:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KnpsNwpb77I2; Thu, 9 Jul 2015 09:39:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D53BCA45A9; Thu, 9 Jul 2015 09:39:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F18861C2DE9 for ; Thu, 9 Jul 2015 09:38:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E81AB8A759 for ; Thu, 9 Jul 2015 09:38:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IueN1etNYzMA for ; Thu, 9 Jul 2015 09:38:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (unknown [198.182.60.111]) by whitealder.osuosl.org (Postfix) with ESMTPS id 22D368A6CC for ; Thu, 9 Jul 2015 09:38:59 +0000 (UTC) Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id 4DEE610C0E92; Thu, 9 Jul 2015 02:38:58 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 40C0A4E213; Thu, 9 Jul 2015 02:38:58 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 077D54E202; Thu, 9 Jul 2015 02:38:58 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id E6DDEFC3; Thu, 9 Jul 2015 02:38:57 -0700 (PDT) Received: from abrodkin-e7440l.internal.synopsys.com (abrodkin-e7440l.internal.synopsys.com [10.121.8.55]) by mailhost.synopsys.com (Postfix) with ESMTP id D5623FBD; Thu, 9 Jul 2015 02:38:56 -0700 (PDT) From: Alexey Brodkin To: buildroot@busybox.net Date: Thu, 9 Jul 2015 12:38:51 +0300 Message-Id: <1436434731-2388-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.4.3 Cc: Thomas Petazzoni , Alexey Brodkin Subject: [Buildroot] [PATCH] pure-ftpd: disable PIE on ARC X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Even though ARC gcc understands "-pie" option and attempts to generate PIE binaries as of today PIE is not really supported for user-space applications. So we disable PIE detection if building for ARC. That first fixes http://autobuild.buildroot.net/results/57a/57a6180809bc51f7206280533f0b9898ce4cfbb4 and also prevents execution of non-supported PIE binary in runtime. Interesting enough reported build failure is not directly related to PIE it looks like if PIE is enabled then successful detection of explicit_bzero() happens erroneously. A simple test app that mentions explicit_bzero() while built with "-pie" gives this output: --------------------------------->8----------------------------- arc-linux-gcc test.c -pie /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/../../../../arc-snps-linux-uclibc/bin/ld: /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../arc-snps-linux-uclibc/sysroot/usr/lib/crt1.o: warning: unresolvable relocation against symbol `__uClibc_main' from .text section /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/../../../../arc-snps-linux-uclibc/bin/ld: /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/crtbegin.o: warning: unresolvable relocation against symbol `__deregister_frame_info@@GCC_3.0' from .text section /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/../../../../arc-snps-linux-uclibc/bin/ld: /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/crtbegin.o: warning: unresolvable relocation against symbol `__deregister_frame_info@@GCC_3.0' from .text section /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/../../../../arc-snps-linux-uclibc/bin/ld: /home/abrodkin/Tools/arc/gnu/2015.06-rc1-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/4.8.4/crtbegin.o: warning: unresolvable relocation against symbol `__register_frame_info@@GCC_3.0' from .text section --------------------------------->8----------------------------- And what's really interesting exist status is 0!: --------------------------------->8----------------------------- $ echo $? 0 --------------------------------->8----------------------------- With removal of "-pie" we're getting expected failure and exist status 1: --------------------------------->8----------------------------- $ arc-linux-gcc test.c /tmp/ccaWbKwc.o: In function `main': test.c:(.text+0x1c): undefined reference to `explicit_bzero' collect2: error: ld returned 1 exit status $ echo $? 1 --------------------------------->8----------------------------- We'll look into that strange issue separately internally. I filed internal STAR 9000925001 for that issue. Signed-off-by: Alexey Brodkin Cc: Thomas Petazzoni --- Note there will be a separate patch for pure-ftpd made from this pull-request: https://github.com/jedisct1/pure-ftpd/pull/28 --- package/pure-ftpd/pure-ftpd.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/pure-ftpd/pure-ftpd.mk b/package/pure-ftpd/pure-ftpd.mk index 8269327..b49f047 100644 --- a/package/pure-ftpd/pure-ftpd.mk +++ b/package/pure-ftpd/pure-ftpd.mk @@ -33,4 +33,8 @@ else PURE_FTPD_CONF_OPTS += --without-tls endif +ifeq ($(BR2_arc),y) +PURE_FTPD_CONF_ENV += ax_cv_check_cflags___fPIE=no ax_cv_check_ldflags___fPIE=no +endif + $(eval $(autotools-package))