]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
examples: standalone: Fix build with LLVM toolchain
authorAlistair Delva <adelva@google.com>
Mon, 26 Sep 2022 20:47:10 +0000 (20:47 +0000)
committerTom Rini <trini@konsulko.com>
Mon, 10 Oct 2022 22:01:23 +0000 (18:01 -0400)
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 <adelva@google.com>
Cc: Rick Chen <rick@andestech.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
examples/standalone/stubs.c

index ce05f41b0ce9287facc0d5000dde1cde29f57452..65115570e8eb537892a6e4dfe375b03325f42ad1 100644 (file)
@@ -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, ...) \