From patchwork Fri May 9 13:51:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lesiak X-Patchwork-Id: 347426 X-Patchwork-Delegate: thomas.petazzoni@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id F3337140078 for ; Sat, 10 May 2014 00:07:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1DCD188D2E; Fri, 9 May 2014 14:07:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d+B6fwxKIZJa; Fri, 9 May 2014 14:07:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 735E288F37; Fri, 9 May 2014 14:07: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 79B0D1BF9B9 for ; Fri, 9 May 2014 14:07:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 75DDA8B55C for ; Fri, 9 May 2014 14:07: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 DFbuwSNC8VWv for ; Fri, 9 May 2014 14:07:36 +0000 (UTC) X-Greylist: delayed 00:15:36 by SQLgrey-1.7.6 Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0186.outbound.protection.outlook.com [207.46.163.186]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9281C8B6BA for ; Fri, 9 May 2014 14:07:36 +0000 (UTC) Received: from BLUPRD0810HT002.namprd08.prod.outlook.com (10.255.125.37) by BLUPR08MB072.namprd08.prod.outlook.com (10.242.188.154) with Microsoft SMTP Server (TLS) id 15.0.934.12; Fri, 9 May 2014 13:51:57 +0000 Received: from bee.licor.com (208.82.105.200) by pod51019.outlook.com (10.255.125.37) with Microsoft SMTP Server (TLS) id 14.16.453.0; Fri, 9 May 2014 13:51:56 +0000 Date: Fri, 9 May 2014 08:51:55 -0500 From: Chris Lesiak To: Message-ID: <536cdd7b.ATs+iKVatjmU5yNL%chris.lesiak@licor.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 X-Originating-IP: [208.82.105.200] X-Forefront-PRVS: 02065A9E77 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009001)(6009001)(428001)(189002)(199002)(46102001)(92726001)(86362001)(4396001)(87936001)(76482001)(97756001)(50986999)(46406003)(85852003)(101416001)(77982001)(83072002)(83506001)(99396002)(54356999)(36756003)(83322001)(19580395003)(21056001)(66066001)(74502001)(74662001)(64706001)(20776003)(47776003)(81342001)(53416003)(23726002)(79102001)(81542001)(19580405001)(80022001)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR08MB072; H:BLUPRD0810HT002.namprd08.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (: licor.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=chris.lesiak@licor.com; X-OriginatorOrg: licor.com Subject: [Buildroot] [PATCH] Reduce need for BR2_HOSTARCH_NEEDS_IA32_COMPILER 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Reduce need for BR2_HOSTARCH_NEEDS_IA32_COMPILER When building grub and syslinux, the 32-bit host compiler is only needed when building for 64-bit target. For 32-bit targets, the target compiler will work. This change makes it less likely that a mulilib host is needed. Signed-off-by: Chris Lesiak --- boot/grub/Config.in | 2 +- boot/grub/grub.mk | 6 ++++++ boot/syslinux/Config.in | 2 +- boot/syslinux/syslinux.mk | 18 ++++++++++++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/boot/grub/Config.in b/boot/grub/Config.in index 4db8642..86e1753 100644 --- a/boot/grub/Config.in +++ b/boot/grub/Config.in @@ -1,7 +1,7 @@ config BR2_TARGET_GRUB bool "grub" depends on BR2_i386 || BR2_x86_64 - select BR2_HOSTARCH_NEEDS_IA32_COMPILER + select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_ARCH_IS_64 help The GRand Unified Bootloader for x86 systems. diff --git a/boot/grub/grub.mk b/boot/grub/grub.mk index dc11307..8c02fe3 100644 --- a/boot/grub/grub.mk +++ b/boot/grub/grub.mk @@ -71,9 +71,15 @@ endef GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES +ifeq ($(BR2_HOSTARCH_NEEDS_IA32_COMPILER),y) GRUB_CONF_ENV = \ $(HOST_CONFIGURE_OPTS) \ CFLAGS="$(HOST_CFLAGS) $(GRUB_CFLAGS) -m32" +else +GRUB_CONF_ENV = \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(GRUB_CFLAGS)" +endif GRUB_CONF_OPT = \ --disable-auto-linux-mem-opt \ diff --git a/boot/syslinux/Config.in b/boot/syslinux/Config.in index f4b9870..8d32214 100644 --- a/boot/syslinux/Config.in +++ b/boot/syslinux/Config.in @@ -1,7 +1,7 @@ config BR2_TARGET_SYSLINUX bool "syslinux" depends on BR2_i386 || BR2_x86_64 - select BR2_HOSTARCH_NEEDS_IA32_COMPILER + select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_ARCH_IS_64 help The syslinux bootloader for x86 systems. This includes: syslinux, pxelinux, extlinux. diff --git a/boot/syslinux/syslinux.mk b/boot/syslinux/syslinux.mk index 51b6417..c20a817 100644 --- a/boot/syslinux/syslinux.mk +++ b/boot/syslinux/syslinux.mk @@ -39,12 +39,22 @@ define SYSLINUX_CLEANUP endef SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP +ifeq ($(BR2_HOSTARCH_NEEDS_IA32_COMPILER),y) + SYSLINUX_CC = $(HOSTCC) + SYSLINUX_LDFLAGS = $(HOST_LDFLAGS) + SYSLINUX_AR = $(HOSTAR) +else + SYSLINUX_CC = $(TARGET_CC) + SYSLINUX_LDFLAGS = $(TARGET_LDFLAGS) + SYSLINUX_AR = $(TARGET_AR) +endif + # syslinux build system has no convenient way to pass CFLAGS, # and the internal zlib should take precedence so -I shouldn't # be used. define SYSLINUX_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \ - AR="$(HOSTAR)" SYSROOT=$(STAGING_DIR) -C $(@D) $(SYSLINUX_TARGET) + $(TARGET_MAKE_ENV) $(MAKE1) CC="$(SYSLINUX_CC) -idirafter $(HOST_DIR)/usr/include $(SYSLINUX_LDFLAGS)" \ + AR="$(SYSLINUX_AR)" SYSROOT=$(STAGING_DIR) -C $(@D) $(SYSLINUX_TARGET) endef # While the actual bootloader is compiled for the target, several @@ -53,8 +63,8 @@ endef # Repeat CC and AR, since syslinux really wants to check them at # install time define SYSLINUX_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \ - AR="$(HOSTAR)" SYSROOT=$(STAGING_DIR) INSTALLROOT=$(HOST_DIR) \ + $(TARGET_MAKE_ENV) $(MAKE1) CC="$(SYSLINUX_CC) -idirafter $(HOST_DIR)/usr/include $(SYSLINUX_LDFLAGS)" \ + AR="$(SYSLINUX_AR)" SYSROOT=$(STAGING_DIR) INSTALLROOT=$(HOST_DIR) \ -C $(@D) $(SYSLINUX_TARGET) install endef