Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error "Unknown endianness" in mingw32 cross make #76

Closed
LazyZhu opened this issue May 25, 2014 · 4 comments
Closed

error "Unknown endianness" in mingw32 cross make #76

LazyZhu opened this issue May 25, 2014 · 4 comments

Comments

@LazyZhu
Copy link

LazyZhu commented May 25, 2014

make  all-recursive
make[1]: Entering directory `/cross/mingw32/src/shadowsocks-libev'
Making all in libcork
make[2]: Entering directory `/cross/mingw32/src/shadowsocks-libev/libcork'
/bin/bash ../libtool  --tag=CC   --mode=compile i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I..    -Iinclude -DCORK_API=CORK_LOCAL -O2 -pipe -I/cross/mingw32/prebuilt/include -MT cli/libcork_la-commands.lo -MD -MP -MF cli/.deps/libcork_la-commands.Tpo -c -o cli/libcork_la-commands.lo `test -f 'cli/commands.c' || echo './'`cli/commands.c
libtool: compile:  i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude -DCORK_API=CORK_LOCAL -O2 -pipe -I/cross/mingw32/prebuilt/include -MT cli/libcork_la-commands.lo -MD -MP -MF cli/.deps/libcork_la-commands.Tpo -c cli/commands.c  -DDLL_EXPORT -DPIC -o cli/.libs/libcork_la-commands.o
In file included from include/libcork/core.h:17,
                 from cli/commands.c:16:
include/libcork/core/byte-order.h:46:2: error: #error "Unknown endianness"
make[2]: *** [cli/libcork_la-commands.lo] Error 1
make[2]: Leaving directory `/cross/mingw32/src/shadowsocks-libev/libcork'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cross/mingw32/src/shadowsocks-libev'
make: *** [all] Error 2

@madeye @linusyang

@LazyZhu
Copy link
Author

LazyZhu commented May 26, 2014

Good work but still get error: pthread.h: No such file or directory and lots of xxx ignored, see the full log here: https://gist.github.com/LazyZhu/73614c7681ce6668f162

@madeye
Copy link

madeye commented May 26, 2014

Make sure pthread is installed in your mingw.
On May 26, 2014 7:32 PM, "LazyZhu" notifications@github.com wrote:

Good work but still get error: pthread.h: No such file or directory and
lots of xxx ignored, see the full log here:
https://gist.github.com/LazyZhu/73614c7681ce6668f162


Reply to this email directly or view it on GitHubhttps://github.com/madeye/shadowsocks-libev/issues/76#issuecomment-44180986
.

@madeye madeye closed this as completed in cd68efa May 27, 2014
@LazyZhu
Copy link
Author

LazyZhu commented May 27, 2014

Thanks for the tip.
I precompile the libpthread(see http://clam-project.org/wiki/Devel/Windows_MinGW_cross_compile#pthreads) ,but there is some error needed to be fixed.

/bin/bash ../libtool --tag=CC   --mode=link i586-mingw32msvc-gcc -g -O2 -Wall -Werror -Wno-deprecated-declarations -fno-strict-aliasing -std=gnu99 -D_GNU_SOURCE -I../libev -I../libasyncns -I../libipset/include -I../libcork/include -DUDPRELAY_LOCAL -O2 -pipe -I/cross/mingw32/prebuilt/include -I/cross/mingw32/prebuilt/include -static -L/cross/mingw32/prebuilt/lib -lpthread -L/cross/mingw32/prebuilt/lib -o ss-local.exe ss_local-utils.o ss_local-jconf.o ss_local-json.o ss_local-encrypt.o ss_local-udprelay.o ss_local-cache.o ss_local-acl.o ss_local-local.o ss_local-win32.o ../libev/libev.la ../libipset/libipset.la ../libcork/libcork.la  -lpolarssl  -lgdi32 -lws2_32 -lcrypt32
libtool: link: i586-mingw32msvc-gcc -g -O2 -Wall -Werror -Wno-deprecated-declarations -fno-strict-aliasing -std=gnu99 -D_GNU_SOURCE -I../libev -I../libasyncns -I../libipset/include -I../libcork/include -DUDPRELAY_LOCAL -O2 -pipe -I/cross/mingw32/prebuilt/include -I/cross/mingw32/prebuilt/include -o ss-local.exe ss_local-utils.o ss_local-jconf.o ss_local-json.o ss_local-encrypt.o ss_local-udprelay.o ss_local-cache.o ss_local-acl.o ss_local-local.o ss_local-win32.o  -L/cross/mingw32/prebuilt/lib ../libev/.libs/libev.a ../libipset/.libs/libipset.a ../libcork/.libs/libcork.a -lpthread -lpolarssl -lgdi32 -lws2_32 -lcrypt32
../libcork/.libs/libcork.a(libcork_la-error.o):error.c:(.text+0x73): undefined reference to `___sync_val_compare_and_swap_4'
../libcork/.libs/libcork.a(libcork_la-error.o):error.c:(.text+0x9d): undefined reference to `___sync_val_compare_and_swap_4'
../libcork/.libs/libcork.a(libcork_la-error.o):error.c:(.text+0xc7): undefined reference to `___sync_val_compare_and_swap_4'
collect2: ld returned 1 exit status
make[2]: *** [ss-local.exe] Error 1
make[2]: Leaving directory `/cross/mingw32/src/shadowsocks-libev/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cross/mingw32/src/shadowsocks-libev'
make: *** [all] Error 2

see the full log here: https://gist.github.com/LazyZhu/73614c7681ce6668f162

@LazyZhu
Copy link
Author

LazyZhu commented May 27, 2014

OK,I found answer here : http://web.archiveorange.com/archive/v/yWJfLyOG2jySEiNfP2eT
Just need add -march=i686 to CFLAGS
:) Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants