Please help me - can't build on ARM - lots of "/usr/bin/ld: skipping incompatible "

1,600 views
Skip to first unread message

Andrei

unread,
Feb 20, 2017, 7:40:22 AM2/20/17
to swup...@googlegroups.com

# make

  LD      core/built-in.o

  LD      handlers/built-in.o

  LD      swupdate_unstripped

Failed: -Wl,--start-group -lpthread -llua -lm -lcurl -lconfig -ljson-c -lcrypto -lssl -lcrypto -lssl -lubi -lmtd -lz -lubootenv -Wl,--end-group

Output of:

gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -fno-unwind-tables -fno-asynchronous-unwind-tables -g -Os -DNO_SSL -DUSE_LUA -DUSE_IPV6 -Wl,-E -o swupdate_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--gc-sections -Wl,--start-group core/built-in.o handlers/built-in.o archival/lib.a corelib/lib.a ipc/lib.a mongoose/lib.a parser/lib.a suricatta/lib.a -Wl,--end-group -Wl,--start-group -lpthread -llua -lm -lcurl -lconfig -ljson-c -lcrypto -lssl -lcrypto -lssl -lubi -lmtd -lz -lubootenv -Wl,--end-group

==========

/usr/bin/ld: skipping incompatible /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../../lib/liblua.so when searching for -llua

/usr/bin/ld: skipping incompatible /lib/../lib/liblua.so when searching for -llua

/usr/bin/ld: skipping incompatible /usr/lib/../lib/liblua.so when searching for -llua

/usr/bin/ld: skipping incompatible /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../liblua.so when searching for -llua

/usr/bin/ld: skipping incompatible /usr/lib/liblua.so when searching for -llua

/usr/bin/ld: cannot find -llua

/usr/bin/ld: skipping incompatible /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../../lib/libconfig.so when searching for -lconfig

/usr/bin/ld: skipping incompatible /lib/../lib/libconfig.so when searching for -lconfig

/usr/bin/ld: skipping incompatible /usr/lib/../lib/libconfig.so when searching for -lconfig

/usr/bin/ld: skipping incompatible /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../libconfig.so when searching for -lconfig

/usr/bin/ld: skipping incompatible /usr/lib/libconfig.so when searching for -lconfig

/usr/bin/ld: cannot find -lconfig

/usr/bin/ld: skipping incompatible /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../../lib/libjson-c.so when searching for -ljson-c

/usr/bin/ld: skipping incompatible /lib/../lib/libjson-c.so when searching for -ljson-c

/usr/bin/ld: skipping incompatible /usr/lib/../lib/libjson-c.so when searching for -ljson-c

/usr/bin/ld: skipping incompatible /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../libjson-c.so when searching for -ljson-c

/usr/bin/ld: skipping incompatible /usr/lib/libjson-c.so when searching for -ljson-c

/usr/bin/ld: cannot find -ljson-c

/usr/bin/ld: cannot find -lubi

/usr/bin/ld: cannot find -lmtd

/usr/bin/ld: cannot find -lubootenv

collect2: error: ld returned 1 exit status

make: *** [Makefile:372: swupdate_unstripped] Error 1

[root@alarm swupdate]# uname -a

Linux alarm 3.14.79-18-ARCH #1 SMP PREEMPT Tue Jan 31 18:25:56 MST 2017 aarch64 GNU/Linux

Stefano Babic

unread,
Feb 21, 2017, 4:00:49 AM2/21/17
to Andrei, swup...@googlegroups.com
Hi Andrei,

On 20/02/2017 13:40, Andrei wrote:
> # make
>
> LD core/built-in.o
>
> LD handlers/built-in.o
>
> LD swupdate_unstripped
>
> Failed: -Wl,--start-group -lpthread -llua -lm -lcurl -lconfig -ljson-c
> -lcrypto -lssl -lcrypto -lssl -lubi -lmtd -lz -lubootenv -Wl,--end-group

it is not clear what you are doing, if you are cross-compiling on PC or
you are building native on the target.

If you are not building inside the supported buildsystems (Yocto /
Buildroot), you have to provide yourself all required libraries, that I
see are missing on your system.

>
> Output of:
>
> gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused
> -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes
> -Wmissing-declarations -Wno-format-security -Wold-style-definition
> -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer
> -ffunction-sections -fdata-sections -fno-guess-branch-probability
> -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1
> -falign-labels=1 -falign-loops=1 -fno-unwind-tables
> -fno-asynchronous-unwind-tables -g -Os -DNO_SSL -DUSE_LUA -DUSE_IPV6
> -Wl,-E -o swupdate_unstripped -Wl,--sort-common
> -Wl,--sort-section,alignment -Wl,--gc-sections -Wl,--start-group
> core/built-in.o handlers/built-in.o archival/lib.a corelib/lib.a
> ipc/lib.a mongoose/lib.a parser/lib.a suricatta/lib.a -Wl,--end-group
> -Wl,--start-group -lpthread -llua -lm -lcurl -lconfig -ljson-c -lcrypto
> -lssl -lcrypto -lssl -lubi -lmtd -lz -lubootenv -Wl,--end-group
>
> ==========
>
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/aarch64-unknown-linux-gnu/6.3.1/../../../../lib/liblua.so
> when searching for -llua

It looks like you have not correctly set the toolchain and it was mixed
between host and target. Compiler has built for an architecture, then
you link for another one.

If you check a .o with "file <object>", you should get the same
architecture you are trying to link - as I presume it is not the case,
you get the "skipping incompatible" messages.
Then, of course, all libraries are not found.

> [root@alarm swupdate]# uname -a
>
> Linux alarm 3.14.79-18-ARCH #1 SMP PREEMPT Tue Jan 31 18:25:56 MST 2017
> aarch64 GNU/Linux

Best regards,
Stefano Babic

--
Meet DENX at the Embedded World Trade Show
14 Mar - 16 Mar 2017, Nuremberg Trade Fair Centre, Hall 4, Booth 581
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Stefano Babic

unread,
Feb 21, 2017, 6:32:03 AM2/21/17
to Andrei, Stefano Babic, swup...@googlegroups.com
On 21/02/2017 12:26, Andrei wrote:
> Thank you for the reply, Stefano
>
> My fault - I've installed arm32 libraries on arm64
>

ok - but please do not drop the ML from your reply. Issues can be
interesting for other people, too.

Best regards,
Stefano Babic
> Phone: +49-8142-66989-53 <tel:%2B49-8142-66989-53> Fax:
> +49-8142-66989-80 <tel:%2B49-8142-66989-80> Email: sba...@denx.de
> <mailto:sba...@denx.de>
> =====================================================================
Reply all
Reply to author
Forward
0 new messages