Hi,

On 12/03/2016 11:33 AM, Patrick Mulder wrote:
> Hello,
> 
> I am trying to build libuv in the context of iot.js on my MacOS (this
> means crosscompile from x64_64 to ARM). But I am a bit confused how
> headers and Makefiles select the right target platform. Maybe some of
> you can help me understand what I need to do/learn.
> 

Quick question before we dive any deeper: didn't Samsung switch to their
"libtuv" fork?

> So, in iotj.s there is a script tools/build.py which add libuv as git
> submodule. Then Cmake files are setup. And everything is built. I have
> added already some missing defines by hand, but still when I know try to
> build I get this error:
> 
> -- Build files have been written to:
> /Users/pmu/projects/iotjs/build/x86_64-darwin/debug/deps/libtuv
> make -j
> 
> Scanning dependencies of target tuv
> [  3%] Building C object
> CMakeFiles/tuv.dir/source/unix/uv_unix_threadpool.c.o
> [  6%] Building C object CMakeFiles/tuv.dir/source/unix/uv_unix_stream.c.o
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_threadpool.c:146:11:
> error: expected expression
>   _once = UV_ONCE_INIT;
>           ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_threadpool.c:43:22:
> note: expanded from macro 'UV_ONCE_INIT'
> #define UV_ONCE_INIT PTHREAD_ONCE_INIT
>                      ^
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/pthread.h:204:27:
> note:
>       expanded from macro 'PTHREAD_ONCE_INIT'
> #define PTHREAD_ONCE_INIT {_PTHREAD_ONCE_SIG_init, {0}}
>                           ^
> 1 error generated.
> make[2]: *** [CMakeFiles/tuv.dir/source/unix/uv_unix_threadpool.c.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1227:15:
> error: no member named 'select' in 'struct uv_stream_s'
>   if (handle->select != NULL) {
>       ~~~~~~  ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1228:5:
> error: use of undeclared identifier 'uv__stream_select_t'; did
>       you mean 'uv__stream_connect'?
>     uv__stream_select_t* s;
>     ^~~~~~~~~~~~~~~~~~~
>     uv__stream_connect
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:972:13:
> note: 'uv__stream_connect' declared here
> static void uv__stream_connect(uv_stream_t* stream) {
>             ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1228:26:
> error: use of undeclared identifier 's'
>     uv__stream_select_t* s;
>                          ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1230:5:
> error: use of undeclared identifier 's'
>     s = handle->select;
>     ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1230:17:
> error: no member named 'select' in 'struct uv_stream_s'
>     s = handle->select;
>         ~~~~~~  ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1232:18:
> error: use of undeclared identifier 's'
>     uv_sem_post(&s->close_sem);
>                  ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1233:18:
> error: use of undeclared identifier 's'
>     uv_sem_post(&s->async_sem);
>                  ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1234:21:
> error: use of undeclared identifier 's'
>     uv_thread_join(&s->thread);
>                     ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1235:21:
> error: use of undeclared identifier 's'
>     uv_sem_destroy(&s->close_sem);
>                     ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1236:21:
> error: use of undeclared identifier 's'
>     uv_sem_destroy(&s->async_sem);
>                     ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1237:15:
> error: use of undeclared identifier 's'
>     uv__close(s->fake_fd);
>               ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1238:15:
> error: use of undeclared identifier 's'
>     uv__close(s->int_fd);
>               ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1239:30:
> error: use of undeclared identifier 's'
>     uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close);
>                              ^
> /Users/pmu/projects/iotjs/deps/libtuv/source/unix/uv_unix_stream.c:1241:13:
> error: no member named 'select' in 'struct uv_stream_s'
>     handle->select = NULL;
>     ~~~~~~  ^
> 14 errors generated.
> make[2]: *** [CMakeFiles/tuv.dir/source/unix/uv_unix_stream.c.o] Error 1
> make[1]: *** [CMakeFiles/tuv.dir/all] Error 2
> make: *** [all] Error 2
> 
> [Failed - 2] make -j
> 

Looks like the cross compiling toolchain is not properly setup. The
errors you get seem to be related to the fact that to some extent macOS
headers are being used. handle->select for example is only used in macOS.

I don't have experience with cross compiling with CMake or iot.js
itself, but I hope you can figure it out!


Cheers,


-- 
Saúl Ibarra Corretgé
bettercallsaghul.com


-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to