From patchwork Wed Jul 11 11:49:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 170441 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 946432C01FA for ; Wed, 11 Jul 2012 21:49:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 58FF932232; Wed, 11 Jul 2012 11:49:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kQWPslnmgyUf; Wed, 11 Jul 2012 11:49:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4424E32202; Wed, 11 Jul 2012 11:49:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 215D38F753 for ; Wed, 11 Jul 2012 11:49:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1659B8F0E8 for ; Wed, 11 Jul 2012 11:49:38 +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 DayE3hCveNAq for ; Wed, 11 Jul 2012 11:49:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from viper.mind.be (132.79-246-81.adsl-static.isp.belgacom.be [81.246.79.132]) by whitealder.osuosl.org (Postfix) with ESMTPS id 03DCF8F068 for ; Wed, 11 Jul 2012 11:49:33 +0000 (UTC) Received: from [172.16.2.6] (helo=vandecaa-laptop) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1SovQ9-0003NZ-Ba; Wed, 11 Jul 2012 13:49:30 +0200 Received: from arnout by vandecaa-laptop with local (Exim 4.80) (envelope-from ) id 1SovQ8-0002Kz-JV; Wed, 11 Jul 2012 13:49:28 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@busybox.net Date: Wed, 11 Jul 2012 13:49:19 +0200 Message-Id: <1342007359-8910-1-git-send-email-arnout@mind.be> X-Mailer: git-send-email 1.7.10.4 Subject: [Buildroot] [PATCH v2] Remove -fPIC on x86_64 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 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-bounces@busybox.net The -fPIC breaks the purgatory of kexec (= the code that passes command-line arguments to the kernel): kexec doesn't know how to handle the GOT and PLT relocation entries. There is also no reason at all to pass -fPIC. Shared libraries that require it will add it to their local Makefiles, and normal executables have no business with -fPIC (plus it adds overhead...). The -fPIC was added by Bernhard Reutner-Fischer in commit 8027784c. That commit adds sysroot parameters to CFLAGS. There is no explanation why -fPIC is also added for x86_64. The removal of -fPIC exposes a problem in the configuration of some packages when ccache is enabled, because the compilation of conftest.c is reused. To circumvent this problem, disable ccache in the configure step. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- Build-tested with Sourcery toolchain and full-featured internal toolchain on a x86_64 host with allyesconfig (but without the packages that fail to build in the first place). v2: - Add CCACHE_DISABLE to TARGET_CONFIGURE_ARGS - Test with allyesconfig package/Makefile.in | 9 ++------- package/libgcrypt/libgcrypt.mk | 9 --------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/package/Makefile.in b/package/Makefile.in index c5ad00a..4a59d64 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -87,12 +87,6 @@ endif TARGET_CFLAGS=$(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) -ifneq ($(BR2_PREFER_STATIC_LIB),y) -ifeq ($(BR2_x86_64),y) -TARGET_CFLAGS+=-fPIC -DPIC -endif # PIC for dynamic objects on x86_64 -endif - ifeq ($(findstring yy,$(BR2_mips)$(BR2_MIPS_ABI64)),yy) TARGET_CFLAGS+=-fno-pic -mno-abicalls endif @@ -269,7 +263,8 @@ TARGET_CONFIGURE_ARGS= \ ac_cv_func_calloc_0_nonnull=yes \ ac_cv_func_realloc_0_nonnull=yes \ lt_cv_sys_lib_search_path_spec="" \ - $(BR2_AC_CV_C_BIGENDIAN) + $(BR2_AC_CV_C_BIGENDIAN) \ + CCACHE_DISABLE=1 ####################################################################### diff --git a/package/libgcrypt/libgcrypt.mk b/package/libgcrypt/libgcrypt.mk index 2671819..68c6c47 100644 --- a/package/libgcrypt/libgcrypt.mk +++ b/package/libgcrypt/libgcrypt.mk @@ -17,13 +17,4 @@ LIBGCRYPT_CONF_OPT = \ LIBGCRYPT_DEPENDENCIES = libgpg-error -# libgcrypt doesn't use pkg-config but instead has its own -# libgcrypt-config. Install this in the host directory so -# packages depending on libgcrypt can find it. -define LIBGCRYPT_HOST_INSTALL_LIBGCRYPT_CONFIG - $(INSTALL) -D -m 0755 $(STAGING_DIR)/usr/bin/libgcrypt-config $(HOST_DIR)/usr/bin/libgcrypt-config -endef - -LIBGCRYPT_POST_INSTALL_STAGING_HOOKS += LIBGCRYPT_HOST_INSTALL_LIBGCRYPT_CONFIG - $(eval $(call AUTOTARGETS))