From patchwork Mon Oct 16 17:08:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 826431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FKOyeUUj"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yG4Y93WSXz9t2c for ; Tue, 17 Oct 2017 04:09:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0B7B52E02D; Mon, 16 Oct 2017 17:08:59 +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 B75HW9gQ2+RP; Mon, 16 Oct 2017 17:08:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id F3EEC2DD2E; Mon, 16 Oct 2017 17:08:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B17EE1C3F97 for ; Mon, 16 Oct 2017 17:08:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AC7B186686 for ; Mon, 16 Oct 2017 17:08:56 +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 t1db3sO4ViIC for ; Mon, 16 Oct 2017 17:08:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 3416C8662F for ; Mon, 16 Oct 2017 17:08:55 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id k7so3628133wre.2 for ; Mon, 16 Oct 2017 10:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=u4mkb2F9jqLwxLXNIOrFMGnuO9UyEdnMvocp57AdGwo=; b=FKOyeUUjgifuhLi2cKAwPUcGv9TTYrzfYA9/RKIIFFR5sbaxi+o+RZySd6LkBua+eX n1FjyjvG1BTUYZSAxavrM1HKcxetTcvVsG9j8Jr22lnUK5t4OJISSkY1W2aRvszZEGCs SPNGO8UICM+JUFG85AFpWvh4CzSkdMXs+zyyyotdNTQ+rAhoosbVeAShYy+1cIndjFp8 zYDUER6Jj6i/3fbBeRtJ0REKTwf9mUlSD7uA3UnntQVWHCxj++hHUII+7Xd2wzFx/F/P wig3dJKnV9GVE2Q2R4o5K51zzBHGvQ2K8/tiCQGfotFM3s2UC66AGtH4mju244io0H+C zlyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=u4mkb2F9jqLwxLXNIOrFMGnuO9UyEdnMvocp57AdGwo=; b=KfXyK8nItUoOppHhgrIy752nG73j6cfKXFkPwWyhKUFTuE8i2gYz6FV7PmgiGkja0T 3U8QzQLjc6ut7SWgrc3or4C1Nc8e15H541AJgOIoerAeUGpl6I5RlkuA4jt/PGQ3M4Pq Ta6w7wh/50wMSJ402CUnQwZrTXZaDAHpXvCRHhxSb/Xb3ok7Df0w9GOQfhKTbq9iH3iA QTivFiqQAt0k8PgOri2kp8UiZ2/PmS5eisKZuE1Mvtl2q5BfYyDUWkJ2ihLD5QdJkNT/ XFady9AjgbIYg2zMdojVzkwAPdlWI+eiySYuPCreiQ7CGGDXREWBfJq3Si6hvxTVe1Lu kMqQ== X-Gm-Message-State: AMCzsaWVv6Cz9cUJukNadMK9F+v1l3Us30/h431zgj4z+ImejTPfgY98 iT43f3PuZBd4NO7AkMm/OVrQhM3D X-Google-Smtp-Source: ABhQp+SI671yk8Ynlkrq/nXgKYwim0/dmIYPetsf96FNqMkwrjTElpWfe97ciwRZk8V1TSPsjrgfog== X-Received: by 10.223.147.135 with SMTP id 7mr1297923wrp.237.1508173733055; Mon, 16 Oct 2017 10:08:53 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id d195sm4539553wmd.0.2017.10.16.10.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Oct 2017 10:08:51 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Mon, 16 Oct 2017 19:08:45 +0200 Message-Id: <1508173728-29181-1-git-send-email-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [RFC v2 1/4] package/go: fixing crosscompilation settings 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" This patch fixes a bug with the BR2_TOOLCHAIN_HAS_THREADS variable handling which causes CGO_ENABLED to be always 0. Furthermore, it fixes the cross compilation options for the go compiler: setting CGO_ENABLED should be done only for the target compiler not the host one. Signed-off-by: Angelo Compagnucci --- package/go/go.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package/go/go.mk b/package/go/go.mk index 0781dff..6035164 100644 --- a/package/go/go.mk +++ b/package/go/go.mk @@ -52,7 +52,7 @@ HOST_GO_TARGET_ENV = \ # set, build in cgo support for any go programs that may need it. Note that # any target package needing cgo support must include # 'depends on BR2_TOOLCHAIN_HAS_THREADS' in its config file. -ifeq (BR2_TOOLCHAIN_HAS_THREADS,y) +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) HOST_GO_CGO_ENABLED = 1 else HOST_GO_CGO_ENABLED = 0 @@ -74,8 +74,8 @@ HOST_GO_MAKE_ENV = \ GOARCH=$(GO_GOARCH) \ $(if $(GO_GOARM),GOARM=$(GO_GOARM)) \ GOOS=linux \ - CGO_ENABLED=$(HOST_GO_CGO_ENABLED) \ - CC=$(HOSTCC_NOCCACHE) + CC=$(HOSTCC_NOCCACHE) \ + CXX=$(HOSTCXX_NOCCACHE) HOST_GO_TARGET_CC = \ CC_FOR_TARGET="$(TARGET_CC)" \ @@ -83,16 +83,18 @@ HOST_GO_TARGET_CC = \ HOST_GO_HOST_CC = \ CC_FOR_TARGET=$(HOSTCC_NOCCACHE) \ - CXX_FOR_TARGET=$(HOSTCC_NOCCACHE) + CXX_FOR_TARGET=$(HOSTCXX_NOCCACHE) HOST_GO_TMP = $(@D)/host-go-tmp define HOST_GO_BUILD_CMDS - cd $(@D)/src && $(HOST_GO_MAKE_ENV) $(HOST_GO_HOST_CC) ./make.bash + cd $(@D)/src && \ + $(HOST_GO_MAKE_ENV) $(HOST_GO_HOST_CC) CGO_ENABLED=0 ./make.bash mkdir -p $(HOST_GO_TMP) mv $(@D)/pkg/tool $(HOST_GO_TMP)/ mv $(@D)/bin/ $(HOST_GO_TMP)/ - cd $(@D)/src && $(HOST_GO_MAKE_ENV) $(HOST_GO_TARGET_CC) ./make.bash + cd $(@D)/src && \ + $(HOST_GO_MAKE_ENV) $(HOST_GO_TARGET_CC) CGO_ENABLED=$(HOST_GO_CGO_ENABLED) ./make.bash endef define HOST_GO_INSTALL_CMDS