On Sat, Apr 2, 2016 at 7:14 PM, Francisco D' Agostino <[email protected]> wrote: > Hi folks, I'm new to this list any advice is well received. > > I'm trying to cross-compile libuv as a shared library for an embedded device > with mipsel/uclibc toolchain. > > My build enviroment is the following: > > - Windows XP / Mingw32 > - The toolchain is provided by vendor: "mipsel-linux-uclibc--" (cygwin) > - mipsel-linux-uclibc-gcc --version: 3.4.6. > > I'm getting the following errors: > > --- OUTPUT BEGIN -- > > mipsel-linux-uclibc-gcc -Wall -Wextra -Wno-unused-parameter -Iinclude > -Isrc -Isrc/unix -D_GNU_SOURCE -c -o src/unix/async.o src/unix/async.c > In file included from src/unix/async.c:27: > src/unix/atomic-ops.h: In function `cmpxchgi': > src/unix/atomic-ops.h:46: warning: implicit declaration of function > `__sync_val_compare_and_swap' > > mipsel-linux-uclibc-gcc -Wall -Wextra -Wno-unused-parameter -Iinclude > -Isrc -Isrc/unix -D_GNU_SOURCE -c -o src/unix/thread.o src/unix/thread.c > src/unix/thread.c: In function `uv_cond_init': > src/unix/thread.c:340: warning: implicit declaration of function > `pthread_condattr_setclock' > src/unix/thread.c: In function `uv_barrier_init': > src/unix/thread.c:487: warning: implicit declaration of function > `pthread_barrier_init' > src/unix/thread.c: In function `uv_barrier_destroy': > src/unix/thread.c:492: warning: implicit declaration of function > `pthread_barrier_destroy' > src/unix/thread.c: In function `uv_barrier_wait': > src/unix/thread.c:498: warning: implicit declaration of function > `pthread_barrier_wait' > > mipsel-linux-uclibc-gcc -Wall -Wextra -Wno-unused-parameter -Iinclude > -Isrc -Isrc/unix -D_GNU_SOURCE -c -o src/unix/tty.o src/unix/tty.c > In file included from src/unix/spinlock.h:20, > from src/unix/tty.c:24: > src/unix/atomic-ops.h: In function `cmpxchgi': > src/unix/atomic-ops.h:46: warning: implicit declaration of function > `__sync_val_compare_and_swap' > > --- OUTPUT END --- > > I'm getting this because indeed this functions are not declared/implemented > for my platform. > > What I've researched so far is to workaround this creating a library > declaring and implementing this functions and linking libuv against it as > mentioned in > http://vincesoft.blogspot.com.ar/2012/04/how-to-solve-undefined-reference-to.html. > Is this the best way? > > I think that I can obtain missing pthread related functions from a newer > uclibc version. > > My doubt is with __sync_val_compare_and_swap function. > Can someone guide me on what is this function supposed to do in order to > implement it for my platform? > Current platform atomic.h and pthread.h can be found in [1] and [2], > perhaps I can use any function declared there? > > Thanks, > Francisco > > [1] atomic.h: > https://gist.github.com/fdagostino/53a7c1bdd821ee41c1a50b7fb0c1efba > [2] pthread.h: > https://gist.github.com/fdagostino/ae3aa7182615942baa67be998cae382b
The `__sync_val_compare_and_swap` error means your compiler is too old. You're going to need gcc 4.2 or 4.3 at the very least. The implicit declaration warnings probably mean there is a missing `-pthread` flag in uv.gyp or common.gypi somewhere. -- 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.
