Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE62EC07E9D for ; Mon, 26 Sep 2022 20:47:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 919F884E1E; Mon, 26 Sep 2022 22:47:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="MFHVQFCf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A4CFE84DD8; Mon, 26 Sep 2022 22:47:15 +0200 (CEST) Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1A7B684E14 for ; Mon, 26 Sep 2022 22:47:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3zw8yYwYKBtY256DN28GG8D6.4GEM-3GGLDAKLK.56FP.56@flex--adelva.bounces.google.com Received: by mail-yb1-xb49.google.com with SMTP id r62-20020a252b41000000b006af00577c42so6884462ybr.10 for ; Mon, 26 Sep 2022 13:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=Co7bobbi58T0tt5s2EM2t4NxdX+5WoVpDUDLseqo1G4=; b=MFHVQFCfK/nMIFf/Kh1vFx8BYbtNmzUTVCLnRD82FNiAT3+aY7gli+iSlFIWhct3/v 33J/GgOGEgdRmW91yJffzXAFqq1TIcOhGOx/nTv3/qvsDHtOKSUZH6aMYyjDNgmKCM/x u0VPpubAksuXLi+N5ha6MdNUmum3OMJuelTtJS2zCvIkSfomknMV8INkPDC9a9adh4Ve G6Szu4OVyl5+TVjYLV9dsX7TwKj/2QbGqXE7sBl9kjuD/kRO2zIKfgGxxcsT6/pgKu3T jvpLbRqgGoxebk2lH+Z5FJ8sZHo2hKfk5vTHMsBPSesbJHrFvS7QKJHjuVapKkNc9OlT QMfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=Co7bobbi58T0tt5s2EM2t4NxdX+5WoVpDUDLseqo1G4=; b=R3CGbMjOazgQt4yQ9KofVw2h2Xks5YNEOLm5b9efBiDUT8XnXzxjQk9rTIHEWLL4V1 Udrmqx5M9NoyMe9MSqrQITXyTc/0ErqY4XkCqMIsMiSkCFzyZXm2BmVIQ/fOGIURRe86 Woy5cidSXs+EYg6Fwo8Vyct1lmo6p7EBwcXE2M4/ksBGUWgOREPg6u59n3spCOhuF79N xEgtV8cuhcffjzoebznYTz6tgQlx1XXdsw/AoUDwW0YAbTdXgtc2VN8kDb6J9cg3g2l8 xpWOl48DRE5I2kKUAH0Q6+Gy7UY38NmjuEho5ogLjy+hErKXlvXfDZFFQhF1V4hUE1rt 8cTw== X-Gm-Message-State: ACrzQf3cuXYd+Oi4eL1iKpsoeT1QaoWC/k7YPooU+bk+UgDx4JoTv8vv b4fwEtfW64I35xCelsyOc8gTXRzHL54ITA2RMJbIGuRsOT0juAMgzv4YKk8cYi4aO4wBvU1vwxs hIHBstcdPlPhPblMugiJTKx0cYeNxee6xO2Zvg+K2QrpO10epXgTAx02FBdc= X-Google-Smtp-Source: AMsMyM529AoEm83tUaJbX18QJhcuJcbkTPsL+SQramXbtZ7YkOIphMKJfZEHmtJxFRjD0xEauLqHeDlwYX4= X-Received: from adelva.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:47a8]) (user=adelva job=sendgmr) by 2002:a5b:50b:0:b0:6af:d9d9:ef96 with SMTP id o11-20020a5b050b000000b006afd9d9ef96mr23008095ybp.637.1664225231663; Mon, 26 Sep 2022 13:47:11 -0700 (PDT) Date: Mon, 26 Sep 2022 20:47:10 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog Message-ID: <20220926204710.860923-1-adelva@google.com> Subject: [PATCH] examples: standalone: Fix build with LLVM toolchain From: Alistair Delva To: u-boot@lists.denx.de Cc: Rick Chen , Simon Glass , Tom Rini , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean When building the standalone example with llvm, the link step fails: examples/standalone/libstubs.o: In function `dummy': include/_exports.h:10: undefined reference to `jt' include/_exports.h:11: undefined reference to `jt' include/_exports.h:12: undefined reference to `jt' include/_exports.h:13: undefined reference to `jt' include/_exports.h:14: undefined reference to `jt' examples/standalone/libstubs.o:include/_exports.h:15: more undefined references to `jt' follow Indeed, the standalone libstubs.o does use the jt symbol, but it was marked 'static' in stubs.c. It's strange how gcc builds are working. Signed-off-by: Alistair Delva Cc: Rick Chen Cc: Simon Glass Cc: Tom Rini Cc: Nick Desaulniers --- examples/standalone/stubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index ce05f41b0c..65115570e8 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -14,7 +14,7 @@ struct cmd_tbl; * from flash memory. The global_data address is passed as argv[-1] * to the application program. */ -static struct jt_funcs *jt; +struct jt_funcs *jt; gd_t *global_data; #define EXPORT_FUNC(f, a, x, ...) \ -- 2.30.2