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.gane...@gmail.com>
wrote:

> Hi Kenton - Thanks for the reply.
>
> Here are the steps I did:
>
> 1. cd /root
> 2. curl -O https://capnproto.org/capnproto-c++-0.8.0.tar.gz
> 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
>
>
> On Sun, Nov 15, 2020 at 7:26 PM Kenton Varda <ken...@cloudflare.com>
> wrote:
>
>> 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
>>
>> On Sun, Nov 15, 2020 at 6:22 PM Sundar Palani <sundara.gane...@gmail.com>
>> wrote:
>>
>>> 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).
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/capnproto/a58a4bc0-92d1-499b-b1e6-398f4b8d7e3fn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/capnproto/a58a4bc0-92d1-499b-b1e6-398f4b8d7e3fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQm%2BFAFMAyZao2qst9rYi4q6rwdTxfVsFd%2Bh5vjUJ4coKA%40mail.gmail.com.

Reply via email to