https://github.com/shadowsocks/simple-obfs

因为没有配置好的win环境,所以题主尝试在Debian上对simple-obfs进行了交叉编译,却在最终步骤不幸遇坑,遂前来求助万能的locer~

宿主机已正确配置libpthread,但执行configure时一直提示 "configure: error: Can not find pthreads.",stackoverflow上的各种hack也没有效果。

详细信息如下:

OS:Debian 8
编译器:gcc-4.9
win32 library: mingw

编译指令如下:

  • ver=0.0.3
  • git clone https://github.com/shadowsocks/simple-obfs
  • cd simple-obfs
  • git checkout v$ver -b v$ver
  • git submodule init && git submodule update
  • ./autogen.sh
  • LIBS="-lpthread -lm" LDFLAGS="-Wl,-static -static -static-libgcc -L/projects/dists/libsodium/lib -L/projects/dists/libudns/lib -L/projects/dists/libev/lib" CFLAGS="-I/projects/dists/libsodium/include -I/projects/dists/libudns/include -I/projects/dists/libev/include" ./configure --host=i686-w64-mingw32 --prefix=/projects/dists/shadowsocks-libev --disable-ssp --disable-documentation
  • make && make install复制代码

错误日志如下:

  • checking how to convert x86_64-pc-linux-gnu file names to i686-w64-mingw32 format... func_convert_file_nix_to_w32
  • checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
  • checking for /usr/bin/ld option to reload object files... -r
  • checking for i686-w64-mingw32-objdump... no
  • checking for objdump... objdump
  • checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
  • checking for i686-w64-mingw32-dlltool... no
  • checking for dlltool... no
  • checking how to associate runtime and link libraries... func_cygming_dll_for_implib_fallback
  • checking for i686-w64-mingw32-ar... ar
  • checking for archiver @FILE support... @
  • checking for i686-w64-mingw32-strip... no
  • checking for strip... strip
  • checking for i686-w64-mingw32-ranlib... no
  • checking for ranlib... ranlib
  • checking command to parse nm output from gcc object... ok
  • checking for sysroot... no
  • checking for a working dd... /bin/dd
  • checking how to truncate binary pipes... /bin/dd bs=4096 count=1
  • checking for i686-w64-mingw32-mt... no
  • checking for mt... mt
  • checking if mt is a manifest tool... no
  • checking for dlfcn.h... yes
  • checking for objdir... .libs
  • checking if gcc supports -fno-rtti -fno-exceptions... no
  • checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
  • checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
  • checking if gcc static flag -static works... yes
  • checking if gcc supports -c -o file.o... yes
  • checking if gcc supports -c -o file.o... (cached) yes
  • checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
  • checking dynamic linker characteristics... Win32 ld.exe
  • checking how to hardcode library paths into programs... immediate
  • checking whether stripping libraries is possible... yes
  • checking if libtool supports shared libraries... yes
  • checking whether to build shared libraries... no
  • checking whether to build static libraries... yes
  • checking for i686-w64-mingw32-gcc... gcc
  • checking whether we are using the GNU C compiler... (cached) yes
  • checking whether gcc accepts -g... (cached) yes
  • checking for gcc option to accept ISO C89... (cached) none needed
  • checking whether gcc understands -c and -o together... (cached) yes
  • checking whether ln -s works... yes
  • checking whether make sets $(MAKE)... (cached) yes
  • checking for thread local storage (TLS) class... __thread
  • checking for C/C++ restrict keyword... __restrict
  • checking for netdb.h... yes
  • checking for library containing inet_ntop... no
  • checking for inet_ntop... no
  • checking whether inet_ntop is declared... yes
  • checking for what kind of host... MinGW
  • checking if compiler needs -Werror to reject unknown flags... no
  • checking for the pthreads library -lpthreads... no
  • checking whether pthreads work without any flags... no
  • checking whether pthreads work with -Kthread... no
  • checking whether pthreads work with -kthread... no
  • checking for the pthreads library -llthread... no
  • checking whether pthreads work with -pthread... no
  • checking whether pthreads work with -pthreads... no
  • checking whether pthreads work with -mthreads... no
  • checking for the pthreads library -lpthread... no
  • checking whether pthreads work with --thread-safe... no
  • checking whether pthreads work with -mt... no
  • checking for pthread-config... no
  • configure: error: Can not find pthreads. This is required.
  • 复制代码