Tomatoware ARM 下静态编译 Pcap_DNSProxy

2015-11-05 – 5:14 下午 --- 5,519 次阅读

使用 Tomato 固件,先下载 tomatoware:

CMake:
./bootstrap --prefix=/mmc && make && make install

libsodium:
./configure --prefix=/mmc && make && make install

然后静态编译 DNSProxy" title="Pcap_DNSProxy GITHUB" rel="external">Pcap_DNSProxy ,需要修改下源码的 /Pcap_DNSProxy/Source/Pcap_DNSProxy/CMakeLists.txt 文件:

Executable file name
#static
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBRARIES OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static -pthread -Wl,--whole-archive 
-lpthread -Wl,--no-whole-archive")
#static
add_executable(Pcap_DNSProxy ${MAIN_SRC_FILES})
IF(PLATFORM_OPENWRT)
INSTALL(TARGETS Pcap_DNSProxy RUNTIME DESTINATION sbin)
ENDIF(PLATFORM_OPENWRT)

注意:单独使用 -static 编译出来的文件执行会出错,要结合后面那堆参数:

terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted

Pcap_DNSProxy

当然还是希望作者加一个静态编译的开关选项。

已提交,作者已添加:

* 使用 ./Linux_Build.sh 执行编译程序
* 添加参数 --enable-static 即 ./Linux_Build.sh --enable-static 可启用静态编译

点击显示引用框
引用本文,复制粘贴...

点击可把本文加入多个网络分享站点

您还可以参考以下文章:


Sorry, comments for this entry are closed at this time.