Build error in dockcross/linux-arm64 Docker

26 views
Skip to first unread message

Sundar Palani

unread,
Nov 15, 2020, 7:22:06 PM11/15/20
to Cap'n Proto
I have the following error while building inside dockcross/linux-arm64 docker running on my macOS x86-64.

/bin/bash ./libtool  --tag=CXX   --mode=link /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-g++ -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR='"/usr/local/include"' -pthread -O2 -DNDEBUG -pthread -release 0.9-dev -no-undefined  -o libcapnp-json.la -rpath /usr/local/lib src/capnp/compat/json.lo src/capnp/compat/json.capnp.lo libcapnp.la libkj.la -lpthread -lpthread
libtool: link: /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ar cru .libs/libcapnp-json.a  src/capnp/compat/json.o src/capnp/compat/json.capnp.o
libtool: link: ranlib .libs/libcapnp-json.a
libtool: link: ( cd ".libs" && rm -f "libcapnp-json.la" && ln -s "../libcapnp-json.la" "libcapnp-json.la" )
/bin/bash ./libtool  --tag=CXX   --mode=link /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-g++ -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR='"/usr/local/include"' -pthread -O2 -DNDEBUG -pthread -pthread  -o capnp src/capnp/compiler/module-loader.o src/capnp/compiler/capnp.o libcapnpc.la libcapnp-json.la libcapnp.la libkj.la -lpthread -lpthread
libtool: link: /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-g++ -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o capnp src/capnp/compiler/module-loader.o src/capnp/compiler/capnp.o  ./.libs/libcapnpc.a ./.libs/libcapnp-json.a /root/capnproto/c++/.libs/libcapnp.a ./.libs/libcapnp.a /root/capnproto/c++/.libs/libkj.a ./.libs/libkj.a -lpthread -pthread
./capnp compile --src-prefix=./src -o./capnpc-c++:src -I./src $(for FILE in src/capnp/test.capnp src/capnp/test-import.capnp src/capnp/test-import2.capnp src/capnp/compat/json-test.capnp; do echo ./$FILE; done)
./capnp compile: --src-prefix=./src: no such directory
Try './capnp compile --help' for more information.
Makefile:3801: recipe for target 'test_capnpc_middleman' failed
make: *** [test_capnpc_middleman] Error 1

Has anyone seen this error ? Any thoughts on how to solve this ?

PS: I was able to successfully compile this on my mac as well as aarch64 native machine (Jetson Nano).

Kenton Varda

unread,
Nov 15, 2020, 7:26:17 PM11/15/20
to Sundar Palani, Cap'n Proto
Hi Sundar,

Can you tell us the set of commands that led to this? I.e. what was your command-line for `configure` and `make`? And what directory did you run them in, relative to the source directory?

-Kenton

--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/a58a4bc0-92d1-499b-b1e6-398f4b8d7e3fn%40googlegroups.com.

Kenton Varda

unread,
Nov 16, 2020, 10:05:32 AM11/16/20
to Sundar Palani, Cap'n Proto
Hi Sundar,

Note that the step that is failing is when the build tries to invoke the capnp binary that it just built -- so it would be invoking an aarch64 binary.

Does this environment use qemu-user to emulate aarch64? I've noticed in the past that qemu-user has a lot of bugs emulating certain syscalls, including openat() which capnp uses for all filesystem access. The error message is pretty nonsensical (./src clearly exists), so my guess is this is a buggy qemu situation.

To avoid qemu problems when cross-compiling, I recommend compiling and installing cap'n proto for the host system first. Then, use `./configure --with-external-capnp`. This will use the installed capnp binary instead of using the one built in-tree.

If you don't want to install capnp on the host, you can use the environment variables CAPNP and CAPNPC_CXX to point at the `capnp` and `capnpc-c++` binaries located in some other location (together with `--with-external-capnp`).

-Kenton

On Sun, Nov 15, 2020 at 11:18 PM Sundar Palani <sundara...@gmail.com> wrote:
Hi Kenton - Thanks for the reply.

Here are the steps I did:

1. cd /root
3. cd capnproto-c++-0.8.0
4. ./configure (Also tried these options for configure, same behaviour: --host aarch64-linux-gnu --build x86_64-linux-gnu --enable-static --disable-shared LIBS="-lrt -lpthread -lgcc -lsupc++ -lstdc++")
5. make -j4 check -- failed at this step.

Attached the log file.


Regards,
Sundar
_________________________________________________________________________________
SundaraGanesh Palani
P   Please consider the environment before printing this e-mail or its attachments

Reply all
Reply to author
Forward
0 new messages