semigodking / redsocks

transparent redirector of any TCP/UDP connection to proxy
Apache License 2.0
1.17k stars 247 forks source link

compile failed on bcm53xx using chaos_calmer MUSL libc SDK #23

Closed nyanshell closed 8 years ago

nyanshell commented 9 years ago

Tried cross compile wrapper from https://github.com/aa65535/openwrt-redsocks2 and https://github.com/wongsyrone/openwrt-1/tree/master/package/external/redsocks2 but both of them lead to same error.

Compile on SDK OpenWrt-SDK-15.05-rc3-bcm53xx_gcc-4.8-linaro_uClibc-0.9.33.2_eabi.Linux-x86_64 is OK, but I am using dd-wrt, it's uClibc incompatible.

Output:

[someone@localhost OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64]$ make package/redsocks2/compile V=99
#
# configuration written to .config
#
make[1]: Entering directory `/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64'
make[2]: Entering directory `/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/package/redsocks2'
CFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/usr/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/usr/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/include/fortify -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/include " CXXFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/usr/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/usr/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/include/fortify -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/include " LDFLAGS="-L/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/usr/lib -L/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/lib -L/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/usr/lib -L/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/lib -znow -zrelro " make -j1 -C /home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9_musl-1.1.10_eabi/redsocks2//redsocks2-0.60/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" ;
make[3]: Entering directory `/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9_musl-1.1.10_eabi/redsocks2/redsocks2-0.60'
arm-openwrt-linux-muslgnueabi-gcc -Os -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/usr/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9_musl-1.1.10_eabi/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/usr/include -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/include/fortify -I/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9_gcc-4.8-linaro_musl-1.1.10_eabi/include  -fPIC -O3  -std=gnu99 -Wall   -c -o parser.o parser.c
In file included from parser.c:29:0:
utils.h:43:41: warning: 'struct evbuffer' declared inside parameter list [enabled by default]
 char *redsocks_evbuffer_readline(struct evbuffer *buf);
                                         ^
utils.h:43:41: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
utils.h:46:33: error: unknown type name 'evbuffercb'
                                 evbuffercb readcb,
                                 ^
utils.h:47:33: error: unknown type name 'evbuffercb'
                                 evbuffercb writecb,
                                 ^
utils.h:48:33: error: unknown type name 'everrorcb'
                                 everrorcb errorcb,
                                 ^
utils.h:50:65: error: unknown type name 'evbuffercb'
 struct bufferevent* red_connect_relay(struct sockaddr_in *addr, evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
                                                                 ^
utils.h:50:84: error: unknown type name 'evbuffercb'
 struct bufferevent* red_connect_relay(struct sockaddr_in *addr, evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
                                                                                    ^
utils.h:50:104: error: unknown type name 'everrorcb'
 struct bufferevent* red_connect_relay(struct sockaddr_in *addr, evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
                                                                                                        ^
In file included from parser.c:29:0:
utils.h:51:66: error: unknown type name 'evbuffercb'
 struct bufferevent* red_connect_relay2(struct sockaddr_in *addr, evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg, const struct timeval *timeout_write);
                                                                  ^
utils.h:51:85: error: unknown type name 'evbuffercb'
 struct bufferevent* red_connect_relay2(struct sockaddr_in *addr, evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg, const struct timeval *timeout_write);
                                                                                     ^
utils.h:51:105: error: unknown type name 'everrorcb'
 struct bufferevent* red_connect_relay2(struct sockaddr_in *addr, evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg, const struct timeval *timeout_write);
                                                                                                         ^
make[3]: *** [parser.o] Error 1
make[3]: Leaving directory `/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9_musl-1.1.10_eabi/redsocks2/redsocks2-0.60'
make[2]: *** [/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9_musl-1.1.10_eabi/redsocks2//redsocks2-0.60/.built] Error 2
make[2]: Leaving directory `/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64/package/redsocks2'
make[1]: *** [package/redsocks2/compile] Error 2
make[1]: Leaving directory `/home/someone/code/OpenWrt-SDK-bcm53xx_gcc-4.8-linaro_musl-1.1.10_eabi.Linux-x86_64'
make: *** [package/redsocks2/compile] Error 2

And I just noticed that it's maybe a same error on openwrt buildbot: http://buildbot.openwrt.org:8010/broken_packages/ar71xx/redsocks/compile.txt

wongsyrone commented 9 years ago

缺少 libevent2 相关的头文件,我的包是没问题的,不知道编译了多少回,看看 -I 和 -L 指定的参数吧

conupefox commented 9 years ago

已经装了libevent2的库,还要怎样弄? ubuntu14.04lts

ls -al /usr/lib |grep libevent lrwxrwxrwx 1 root root 21 9月 16 2011 libevent-1.4.so.2 -> libevent-1.4.so.2.2.0 -rw-r--r-- 1 root root 105048 9月 16 2011 libevent-1.4.so.2.2.0 lrwxrwxrwx 1 root root 21 10月 15 09:40 libevent-2.0.so.5 -> libevent-2.0.so.5.1.9 -rwxr-xr-x 1 root root 1198357 10月 15 09:40 libevent-2.0.so.5.1.9 -rw-r--r-- 1 root root 2315392 10月 15 09:40 libevent.a lrwxrwxrwx 1 root root 26 9月 16 2011 libevent_core-1.4.so.2 -> libevent_core-1.4.so.2.2.0 -rw-r--r-- 1 root root 43296 9月 16 2011 libevent_core-1.4.so.2.2.0 lrwxrwxrwx 1 root root 26 10月 15 09:40 libevent_core-2.0.so.5 -> libevent_core-2.0.so.5.1.9 -rwxr-xr-x 1 root root 717068 10月 15 09:40 libevent_core-2.0.so.5.1.9 -rw-r--r-- 1 root root 1438280 10月 15 09:40 libevent_core.a -rwxr-xr-x 1 root root 974 10月 15 09:40 libevent_core.la lrwxrwxrwx 1 root root 26 10月 15 09:40 libevent_core.so -> libevent_core-2.0.so.5.1.9 lrwxrwxrwx 1 root root 27 9月 16 2011 libevent_extra-1.4.so.2 -> libevent_extra-1.4.so.2.2.0 -rw-r--r-- 1 root root 84672 9月 16 2011 libevent_extra-1.4.so.2.2.0 lrwxrwxrwx 1 root root 27 10月 15 09:40 libevent_extra-2.0.so.5 -> libevent_extra-2.0.so.5.1.9 -rwxr-xr-x 1 root root 507631 10月 15 09:40 libevent_extra-2.0.so.5.1.9 -rw-r--r-- 1 root root 877184 10月 15 09:40 libevent_extra.a -rwxr-xr-x 1 root root 981 10月 15 09:40 libevent_extra.la lrwxrwxrwx 1 root root 27 10月 15 09:40 libevent_extra.so -> libevent_extra-2.0.so.5.1.9 -rwxr-xr-x 1 root root 939 10月 15 09:40 libevent.la lrwxrwxrwx 1 root root 29 10月 15 09:40 libevent_openssl-2.0.so.5 -> libevent_openssl-2.0.so.5.1.9 -rwxr-xr-x 1 root root 106366 10月 15 09:40 libevent_openssl-2.0.so.5.1.9 -rw-r--r-- 1 root root 195788 10月 15 09:40 libevent_openssl.a -rwxr-xr-x 1 root root 1010 10月 15 09:40 libevent_openssl.la lrwxrwxrwx 1 root root 29 10月 15 09:40 libevent_openssl.so -> libevent_openssl-2.0.so.5.1.9 lrwxrwxrwx 1 root root 30 10月 15 09:40 libevent_pthreads-2.0.so.5 -> libevent_pthreads-2.0.so.5.1.9 -rwxr-xr-x 1 root root 23987 10月 15 09:40 libevent_pthreads-2.0.so.5.1.9 -rw-r--r-- 1 root root 21990 10月 15 09:40 libevent_pthreads.a -rwxr-xr-x 1 root root 1002 10月 15 09:40 libevent_pthreads.la lrwxrwxrwx 1 root root 30 10月 15 09:40 libevent_pthreads.so -> libevent_pthreads-2.0.so.5.1.9 lrwxrwxrwx 1 root root 21 10月 15 09:40 libevent.so -> libevent-2.0.so.5.1.9

semigodking commented 9 years ago

还要安 openssl-dev 2015年10月15日 上午9:43,"conupefox" notifications@github.com写道:

已经装了libevent2的库,还要怎样弄? ubuntu14.04lts

ls -al /usr/lib |grep libevent lrwxrwxrwx 1 root root 21 9月 16 2011 libevent-1.4.so.2 -> libevent-1.4.so.2.2.0 -rw-r--r-- 1 root root 105048 9月 16 2011 libevent-1.4.so.2.2.0 lrwxrwxrwx 1 root root 21 10月 15 09:40 libevent-2.0.so.5 -> libevent-2.0.so.5.1.9 -rwxr-xr-x 1 root root 1198357 10月 15 09:40 libevent-2.0.so.5.1.9 -rw-r--r-- 1 root root 2315392 10月 15 09:40 libevent.a lrwxrwxrwx 1 root root 26 9月 16 2011 libevent_core-1.4.so.2 -> libevent_core-1.4.so.2.2.0 -rw-r--r-- 1 root root 43296 9月 16 2011 libevent_core-1.4.so.2.2.0 lrwxrwxrwx 1 root root 26 10月 15 09:40 libevent_core-2.0.so.5 -> libevent_core-2.0.so.5.1.9 -rwxr-xr-x 1 root root 717068 10月 15 09:40 libevent_core-2.0.so.5.1.9 -rw-r--r-- 1 root root 1438280 10月 15 09:40 libevent_core.a -rwxr-xr-x 1 root root 974 10月 15 09:40 libevent_core.la lrwxrwxrwx 1 root root 26 10月 15 09:40 libevent_core.so -> libevent_core-2.0.so.5.1.9 lrwxrwxrwx 1 root root 27 9月 16 2011 libevent_extra-1.4.so.2 -> libevent_extra-1.4.so.2.2.0 -rw-r--r-- 1 root root 84672 9月 16 2011 libevent_extra-1.4.so.2.2.0 lrwxrwxrwx 1 root root 27 10月 15 09:40 libevent_extra-2.0.so.5 -> libevent_extra-2.0.so.5.1.9 -rwxr-xr-x 1 root root 507631 10月 15 09:40 libevent_extra-2.0.so.5.1.9 -rw-r--r-- 1 root root 877184 10月 15 09:40 libevent_extra.a -rwxr-xr-x 1 root root 981 10月 15 09:40 libevent_extra.la lrwxrwxrwx 1 root root 27 10月 15 09:40 libevent_extra.so -> libevent_extra-2.0.so.5.1.9 -rwxr-xr-x 1 root root 939 10月 15 09:40 libevent.la lrwxrwxrwx 1 root root 29 10月 15 09:40 libevent_openssl-2.0.so.5 -> libevent_openssl-2.0.so.5.1.9 -rwxr-xr-x 1 root root 106366 10月 15 09:40 libevent_openssl-2.0.so.5.1.9 -rw-r--r-- 1 root root 195788 10月 15 09:40 libevent_openssl.a -rwxr-xr-x 1 root root 1010 10月 15 09:40 libevent_openssl.la lrwxrwxrwx 1 root root 29 10月 15 09:40 libevent_openssl.so -> libevent_openssl-2.0.so.5.1.9 lrwxrwxrwx 1 root root 30 10月 15 09:40 libevent_pthreads-2.0.so.5 -> libevent_pthreads-2.0.so.5.1.9 -rwxr-xr-x 1 root root 23987 10月 15 09:40 libevent_pthreads-2.0.so.5.1.9 -rw-r--r-- 1 root root 21990 10月 15 09:40 libevent_pthreads.a -rwxr-xr-x 1 root root 1002 10月 15 09:40 libevent_pthreads.la lrwxrwxrwx 1 root root 30 10月 15 09:40 libevent_pthreads.so -> libevent_pthreads-2.0.so.5.1.9 lrwxrwxrwx 1 root root 21 10月 15 09:40 libevent.so -> libevent-2.0.so.5.1.9

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/23#issuecomment-148251875 .

semigodking commented 8 years ago

请仔细阅读wiki上的安装说明