From patchwork Thu Sep 28 07:38:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Potapenko X-Patchwork-Id: 819428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; 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="otUC/um6"; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y2mlf2SbGz9t5x for ; Thu, 28 Sep 2017 17:38:51 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 4E52E10737; Thu, 28 Sep 2017 09:38:47 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by helium.openadk.org (Postfix) with ESMTPS id C272C10737 for ; Thu, 28 Sep 2017 09:38:44 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id q132so340241wmd.2 for ; Thu, 28 Sep 2017 00:38:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=eu43SDDIbqQHKf84Z5XRhFBYVy2NU01ZdRoVmjwnwRs=; b=otUC/um619KRWK5VsfwHa724bZDcat8GsxtsRybrMSOqZNYDnYXeSo+CyPF9GdhJAH yaOoUfsEChrLXfuR6lFFlsdyGb9vyhbF8+Y9nUd5poqVEokpyxHP4UJYwLzaRGIIaOpU Epkz7zzfBkrUOYGxTmxwkDycvo/9NXpRDZQGIqb4P9fxaJj9wI+Z7f3gS2gHLNeCXUJc agFn7uhtjZinueaBPtkXHc/YkjjyF4dQhlOzHNUG3AH6jYG2w1/C0RTOGNuAxRgPpQ0q L4l6fx0M90Pxs/RFjTsdGJSSguhnhlPYNDZ+0I+Skyjavzb/r5Sb07aXFnk2ieWmK2mw oUWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eu43SDDIbqQHKf84Z5XRhFBYVy2NU01ZdRoVmjwnwRs=; b=clhOLdP5Dw7ublYXWNi3JDlqtyscqIgdKWtOA+zOz1Z/JYva5u4jcktS4Ns1NUiylc lCTTf++G2NsF9PH9T4a1KGYAlsE5n9aP1lAuZrSYj1wwYPd3wJJ8rBl0T0TPi4mMrGu6 bz/2X8TfW8nQ3cTLAjrSzI4tS72U3C9Z6lmqiZmGxG78GHWKwNpbRNeC9Y7ymPAHuLlE KLAjFE7kHs80zhUkR1dkULSmQowBnLHpTAUKuCEnA2HKF2rSp22mxlbVjj2Tnvkf5n4B rwTlCTvVo0EuvAj3SsxVOOMNeLV+/1hzmDVUDrbXNcAZ8X+ARUUbk3B737y93f08nayR n+zQ== X-Gm-Message-State: AMCzsaXWnCHOMIMy2V1WOwONzdKFImKq+k5KT0NXlA9G9QbryhuC4UB5 FoJAK2vbWAUUUEfNaKhkzUkn59aao8uG9o/lwSSQOQ== X-Google-Smtp-Source: AOwi7QCgGMTpHaOz+95WabQAMm+3NoSe3a1XHJAJ5JJeO4s7DanhryIQ4lS2lNNXKNcEASLQho/SXwTbz38cOLmyS+w= X-Received: by 10.28.211.69 with SMTP id k66mr120052wmg.1.1506584324166; Thu, 28 Sep 2017 00:38:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.184.10 with HTTP; Thu, 28 Sep 2017 00:38:43 -0700 (PDT) From: Alex Potapenko Date: Thu, 28 Sep 2017 10:38:43 +0300 Message-ID: To: devel-uclibc-ng Subject: [uclibc-ng-devel] [PATCH] GCC libgo compilation error X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Hi all, I'm facing a compilation error while building GCC 7.2.0 libgo with uClibc-ng 1.0.26 with this error: runtime_sysinfo.go:418:17: error: use of undefined type ‘___uclibc_locale_struct’ Here is the relevant build output: https://pastebin.com/B7urxS2m The problematic runtime_sysinfo.go is created using -fdump-go-spec: it's used to automatically generate Go declarations from C code (see https://golang.org/doc/install/gccgo#Automatic_generation_of_Go_declarations_from_C_source_code). The generated gen-sysinfo.go is indeed missing ___uclibc_locale_struct declaration. Looks like -fdump-go-spec generates types only from typedef declarations, ignoring structs, like "struct __uclibc_locale_struct;" in uClibc_locale.h. This simple change allows to build libgo fine: Does this change look sane? Or should I patch GCC libgo/sysinfo.c instead to add "typedef struct __uclibc_locale_struct __uclibc_locale_struct;" there? Thanks, Alex --- uClibc_locale.h.orig 2017-09-25 19:49:38.000000000 +0000 +++ uClibc_locale.h 2017-09-28 07:27:14.035517712 +0000 @@ -73,6 +73,7 @@ */ struct __uclibc_locale_struct; +typedef struct __uclibc_locale_struct __uclibc_locale_struct; typedef struct __uclibc_locale_struct *__locale_t; #endif /* !defined(__LOCALE_C_ONLY) */