examples: standalone: Fix build with LLVM toolchain
PATCH 1/1 examples: standalone: Fix build with LLVM toolchain
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.
--- examples/standalone/stubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/standalone/stubs.c +1 -1
@@ -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, ...) \
Signature · 1 line
2.30.2
Quoted 11 lines · Alistair Delva
When building the standalone example with llvm, the link step fails:
examples/standalone/libstubs.o: In function `dummy':include/_exports.h:10: undefined reference tojt' include/_exports.h:11: undefined reference tojt'include/_exports.h:12: undefined reference tojt' include/_exports.h:13: undefined reference tojt'include/_exports.h:14: undefined reference to `jt' examples/standalone/libstubs.o:include/_exports.h:15:
more undefined references to `jt' follow
Quoted 8 lines
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 <[email protected]>Cc Rick Chen <[email protected]>Cc Simon Glass <[email protected]>Cc Tom Rini <[email protected]>Cc Nick Desaulniers <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom