rtty移植到MTK OpenWRT平台

news2025/1/2 0:19:12

准备工具链

  • 使用MTK Openwrt 相应平台工具链,不能使用buildroot的工具链,否则程序无法运行,本文MTK7621为例
  • 工具链官网下载地址

在这里插入图片描述

构建libev

  • rtty依赖libev库,因此需要先构建libev
git clone https://github.com/enki/libev.git
cd libev

~/rtty/libev (master) $ ./configure --host=mipsel-linux CC=/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc CFLAGS=-I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mipsel-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for mipsel-linux-gcc... /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc accepts -g... yes
checking for /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc option to accept ISO C89... none needed
checking whether /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc... /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/mipsel-openwrt-linux-musl/bin/ld
checking if the linker (/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/mipsel-openwrt-linux-musl/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for mipsel-linux-dumpbin... no
checking for mipsel-linux-link... no
checking for dumpbin... no
checking for link... link -dump
configure: WARNING: using cross tools not prefixed with host triplet
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to mipsel-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/mipsel-openwrt-linux-musl/bin/ld option to reload object files... -r
checking for mipsel-linux-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for mipsel-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for mipsel-linux-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for mipsel-linux-strip... strip
checking for mipsel-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc object... ok
checking for sysroot... no
checking for mipsel-linux-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc supports -fno-rtti -fno-exceptions... no
checking for /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc option to produce PIC... -fPIC -DPIC
checking if /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc PIC flag -fPIC -DPIC works... yes
checking if /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc static flag -static works... yes
checking if /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc supports -c -o file.o... yes
checking if /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc supports -c -o file.o... (cached) yes
checking whether the /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc linker (/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/mipsel-openwrt-linux-musl/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
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... yes
checking whether to build static libraries... yes
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking port.h usability... no
checking port.h presence... no
checking for port.h... no
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/eventfd.h usability... yes
checking sys/eventfd.h presence... yes
checking for sys/eventfd.h... yes
checking sys/signalfd.h usability... yes
checking sys/signalfd.h presence... yes
checking for sys/signalfd.h... yes
checking for inotify_init... yes
checking for epoll_ctl... yes
checking for kqueue... no
checking for port_create... no
checking for poll... yes
checking for select... yes
checking for eventfd... yes
checking for signalfd... yes
checking for clock_gettime... yes
checking for nanosleep... yes
checking for library containing floor... none required
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev (master) $ DESTDIR=~/rtty/libev/op make install
/bin/bash ./libtool  --tag=CC   --mode=compile /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DHAVE_CONFIG_H -I.     -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -MT ev.lo -MD -MP -MF .deps/ev.Tpo -c -o ev.lo ev.c
libtool: compile:  /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DHAVE_CONFIG_H -I. -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -MT ev.lo -MD -MP -MF .deps/ev.Tpo -c ev.c  -fPIC -DPIC -o .libs/ev.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
ev.c:1825:31: warning: 'ev_default_loop_ptr' initialized and declared 'extern'
   EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
                               ^
libtool: compile:  /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DHAVE_CONFIG_H -I. -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -MT ev.lo -MD -MP -MF .deps/ev.Tpo -c ev.c -o ev.o >/dev/null 2>&1
mv -f .deps/ev.Tpo .deps/ev.Plo
/bin/bash ./libtool  --tag=CC   --mode=compile /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DHAVE_CONFIG_H -I.     -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -MT event.lo -MD -MP -MF .deps/event.Tpo -c -o event.lo event.c
libtool: compile:  /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DHAVE_CONFIG_H -I. -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -MT event.lo -MD -MP -MF .deps/event.Tpo -c event.c  -fPIC -DPIC -o .libs/event.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
libtool: compile:  /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DHAVE_CONFIG_H -I. -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -MT event.lo -MD -MP -MF .deps/event.Tpo -c event.c -o event.o >/dev/null 2>&1
mv -f .deps/event.Tpo .deps/event.Plo
/bin/bash ./libtool  --tag=CC   --mode=link /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc  -I/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include -version-info 4:0:0  -o libev.la -rpath /usr/local/lib ev.lo event.lo
libtool: link: /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -shared  -fPIC -DPIC  .libs/ev.o .libs/event.o      -Wl,-soname -Wl,libev.so.4 -o .libs/libev.so.4.0.0
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
libtool: link: (cd ".libs" && rm -f "libev.so.4" && ln -s "libev.so.4.0.0" "libev.so.4")
libtool: link: (cd ".libs" && rm -f "libev.so" && ln -s "libev.so.4.0.0" "libev.so")
libtool: link: ar cru .libs/libev.a  ev.o event.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libev.a
libtool: link: ( cd ".libs" && rm -f "libev.la" && ln -s "../libev.la" "libev.la" )
make[1]: Entering directory '/home/snow/rtty/libev'
 /usr/bin/mkdir -p '/home/snow/rtty/libev/op/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libev.la '/home/snow/rtty/libev/op/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libev.so.4.0.0 /home/snow/rtty/libev/op/usr/local/lib/libev.so.4.0.0
libtool: install: (cd /home/snow/rtty/libev/op/usr/local/lib && { ln -s -f libev.so.4.0.0 libev.so.4 || { rm -f libev.so.4 && ln -s libev.so.4.0.0 libev.so.4; }; })
libtool: install: (cd /home/snow/rtty/libev/op/usr/local/lib && { ln -s -f libev.so.4.0.0 libev.so || { rm -f libev.so && ln -s libev.so.4.0.0 libev.so; }; })
libtool: install: /usr/bin/install -c .libs/libev.lai /home/snow/rtty/libev/op/usr/local/lib/libev.la
libtool: install: /usr/bin/install -c .libs/libev.a /home/snow/rtty/libev/op/usr/local/lib/libev.a
libtool: install: chmod 644 /home/snow/rtty/libev/op/usr/local/lib/libev.a
libtool: install: ranlib /home/snow/rtty/libev/op/usr/local/lib/libev.a
libtool: install: warning: remember to run `libtool --finish /usr/local/lib'
 /usr/bin/mkdir -p '/home/snow/rtty/libev/op/usr/local/include'
 /usr/bin/install -c -m 644 ev.h ev++.h event.h '/home/snow/rtty/libev/op/usr/local/include'
 /usr/bin/mkdir -p '/home/snow/rtty/libev/op/usr/local/share/man/man3'
 /usr/bin/install -c -m 644 ev.3 '/home/snow/rtty/libev/op/usr/local/share/man/man3'
make[1]: Leaving directory '/home/snow/rtty/libev'
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev (master) $
~/rtty/libev/op (master) $ tree
.
├── config.log
└── usr
    └── local
        ├── include
        │   ├── event.h
        │   ├── ev++.h
        │   └── ev.h
        ├── lib
        │   ├── libev.a
        │   ├── libev.la
        │   ├── libev.so -> libev.so.4.0.0
        │   ├── libev.so.4 -> libev.so.4.0.0
        │   └── libev.so.4.0.0
        └── share
            └── man
                └── man3
                    └── ev.3

7 directories, 10 files
~/rtty/libev/op (master) $

构建rtty

  • rtty可以选择是否支持SSL编译

(一)生成不支持SSL的rtty

  • 由于涉及到交叉编译,在cmake选项中需要附带很多参数,每次cmake不方便,因此此处编写toolchain.cmake 文件,将需要指定的参数放入此文件
~/test/rtty/rtty/build (master) $ cat ../toolchain.cmake
# which C and C++ compiler to use
set(CMAKE_C_COMPILER /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc)

set(LIBEV_LIBRARY /home/snow/rtty/libev/op/usr/local/lib/libev.so)
set(LIBEV_INCLUDE_DIR /home/snow/rtty/libev/op/usr/local/include)



~/test/rtty/rtty/build (master) $
  • 注意 LIBEV_LIBRARY 设置为 /home/snow/rtty/libev/op/usr/local/lib/libev.so,否则后续cmake时报错如下:
~/test/rtty/rtty/build (master) $ cmake -DCMAKE_TOOLCHAIN_FILE=/home/snow/test/rtty/rtty/toolchain.cmake -DSSL_SUPPORT=OFF ..
-- The C compiler identification is GNU 5.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Libev: /home/snow/rtty/libev/op/usr/local/lib (found version "4.22")
-- Configuring done
WARNING: Target "rtty" requests linking to directory "/home/snow/rtty/libev/op/usr/local/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/snow/test/rtty/rtty/build
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $ make
[  9%] Building C object src/CMakeFiles/rtty.dir/command.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 18%] Building C object src/CMakeFiles/rtty.dir/file.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 27%] Building C object src/CMakeFiles/rtty.dir/filectl.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 36%] Building C object src/CMakeFiles/rtty.dir/http.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 45%] Building C object src/CMakeFiles/rtty.dir/main.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 54%] Building C object src/CMakeFiles/rtty.dir/net.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 63%] Building C object src/CMakeFiles/rtty.dir/rtty.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 72%] Building C object src/CMakeFiles/rtty.dir/utils.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 81%] Building C object src/CMakeFiles/rtty.dir/log/log.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 90%] Building C object src/CMakeFiles/rtty.dir/buffer/buffer.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[100%] Linking C executable rtty
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
CMakeFiles/rtty.dir/command.c.o: In function `task_free':
command.c:(.text+0x1a8): undefined reference to `ev_io_stop'
command.c:(.text+0x1d8): undefined reference to `ev_io_stop'
command.c:(.text+0x1f8): undefined reference to `ev_child_stop'
command.c:(.text+0x20c): undefined reference to `ev_timer_stop'
CMakeFiles/rtty.dir/command.c.o: In function `run_task':
command.c:(.text+0x46c): undefined reference to `ev_child_start'
command.c:(.text+0x4ac): undefined reference to `ev_io_start'
command.c:(.text+0x4e8): undefined reference to `ev_io_start'
command.c:(.text+0x534): undefined reference to `ev_timer_start'
CMakeFiles/rtty.dir/file.c.o: In function `detect_file_operation':
file.c:(.text+0x94c): undefined reference to `ev_io_start'
file.c:(.text+0xcdc): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/file.c.o: In function `parse_file_msg':
file.c:(.text+0x1014): undefined reference to `ev_io_start'
file.c:(.text+0x12a4): undefined reference to `ev_io_start'
file.c:(.text+0x141c): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/http.c.o: In function `on_net_write':
http.c:(.text+0x54): undefined reference to `ev_io_stop'
CMakeFiles/rtty.dir/http.c.o: In function `send_http_msg':
http.c:(.text+0x1c4): undefined reference to `ev_io_start'
http.c:(.text+0x1d0): undefined reference to `ev_now'
CMakeFiles/rtty.dir/http.c.o: In function `http_conn_free':
http.c:(.text+0x248): undefined reference to `ev_io_stop'
http.c:(.text+0x258): undefined reference to `ev_io_stop'
http.c:(.text+0x268): undefined reference to `ev_timer_stop'
CMakeFiles/rtty.dir/http.c.o: In function `on_connected':
http.c:(.text+0x340): undefined reference to `ev_io_start'
http.c:(.text+0x374): undefined reference to `ev_io_start'
http.c:(.text+0x3bc): undefined reference to `ev_timer_start'
CMakeFiles/rtty.dir/http.c.o: In function `on_timer_cb':
http.c:(.text+0x3f0): undefined reference to `ev_now'
CMakeFiles/rtty.dir/http.c.o: In function `http_request':
http.c:(.text+0x618): undefined reference to `ev_io_start'
http.c:(.text+0x690): undefined reference to `ev_now'
CMakeFiles/rtty.dir/main.c.o: In function `signal_cb':
main.c:(.text+0x18): undefined reference to `ev_break'
CMakeFiles/rtty.dir/main.c.o: In function `main':
main.c:(.text+0x108): undefined reference to `ev_default_loop'
main.c:(.text+0x464): undefined reference to `ev_signal_start'
main.c:(.text+0x484): undefined reference to `ev_run'
main.c:(.text+0x49c): undefined reference to `ev_loop_destroy'
CMakeFiles/rtty.dir/net.c.o: In function `sock_write_cb':
net.c:(.text+0x2c): undefined reference to `ev_io_stop'
net.c:(.text+0x3c): undefined reference to `ev_timer_stop'
CMakeFiles/rtty.dir/net.c.o: In function `timer_cb':
net.c:(.text+0x1d8): undefined reference to `ev_io_stop'
CMakeFiles/rtty.dir/net.c.o: In function `tcp_connect_sockaddr':
net.c:(.text+0x3a8): undefined reference to `ev_timer_start'
net.c:(.text+0x3dc): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/rtty.c.o: In function `del_tty':
rtty.c:(.text+0x2c): undefined reference to `ev_io_stop'
rtty.c:(.text+0x3c): undefined reference to `ev_io_stop'
rtty.c:(.text+0x4c): undefined reference to `ev_timer_stop'
rtty.c:(.text+0x5c): undefined reference to `ev_child_stop'
CMakeFiles/rtty.dir/rtty.c.o: In function `tty_timer_cb':
rtty.c:(.text+0x244): undefined reference to `ev_now'
rtty.c:(.text+0x28c): undefined reference to `ev_timer_stop'
CMakeFiles/rtty.dir/rtty.c.o: In function `pty_on_write':
rtty.c:(.text+0x3ac): undefined reference to `ev_io_stop'
CMakeFiles/rtty.dir/rtty.c.o: In function `pty_on_exit':
rtty.c:(.text+0x50c): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/rtty.c.o: In function `on_net_connected':
rtty.c:(.text+0x574): undefined reference to `ev_break'
rtty.c:(.text+0x5f0): undefined reference to `ev_io_start'
rtty.c:(.text+0x800): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/rtty.c.o: In function `pty_on_read':
rtty.c:(.text+0x850): undefined reference to `ev_now'
rtty.c:(.text+0x96c): undefined reference to `ev_io_stop'
rtty.c:(.text+0xac4): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/rtty.c.o: In function `rtty_exit':
rtty.c:(.text+0xb1c): undefined reference to `ev_io_stop'
rtty.c:(.text+0xb2c): undefined reference to `ev_io_stop'
rtty.c:(.text+0xbc4): undefined reference to `ev_break'
CMakeFiles/rtty.dir/rtty.c.o: In function `on_net_write':
rtty.c:(.text+0xc9c): undefined reference to `ev_io_stop'
CMakeFiles/rtty.dir/rtty.c.o: In function `on_net_read':
rtty.c:(.text+0xd9c): undefined reference to `ev_now'
rtty.c:(.text+0x13ec): undefined reference to `ev_io_start'
rtty.c:(.text+0x1448): undefined reference to `ev_child_start'
rtty.c:(.text+0x1484): undefined reference to `ev_timer_start'
rtty.c:(.text+0x1504): undefined reference to `ev_io_start'
rtty.c:(.text+0x1534): undefined reference to `ev_now'
rtty.c:(.text+0x158c): undefined reference to `ev_io_start'
rtty.c:(.text+0x16e8): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/rtty.c.o: In function `rtty_timer_cb':
rtty.c:(.text+0x1808): undefined reference to `ev_now'
rtty.c:(.text+0x1af4): undefined reference to `ev_io_start'
CMakeFiles/rtty.dir/rtty.c.o: In function `rtty_start':
rtty.c:(.text+0x1c5c): undefined reference to `ev_timer_start'
rtty.c:(.text+0x1cb4): undefined reference to `ev_now'
CMakeFiles/rtty.dir/rtty.c.o: In function `rtty_send_msg':
rtty.c:(.text+0x1db8): undefined reference to `ev_io_start'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/rtty.dir/build.make:241: src/rtty] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: src/CMakeFiles/rtty.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
  • 根本原因如下:target_link_libraries需要指定具体的库名称,否则无法链接
~/test/rtty/rtty (master) $ grep -nwr "LIBEV_LIBRARY"
src/CMakeLists.txt:17:target_link_libraries(rtty PRIVATE ${LIBEV_LIBRARY} util crypt m)
  • 如需要静态库方式链接libev,则将toolchain.cmake修改如下:
~/test/rtty/rtty/build (master) $ cat ../toolchain.cmake
# which C and C++ compiler to use
set(CMAKE_C_COMPILER /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc)

set(LIBEV_LIBRARY /home/snow/rtty/libev/op/usr/local/lib/libev.a)
set(LIBEV_INCLUDE_DIR /home/snow/rtty/libev/op/usr/local/include)



~/test/rtty/rtty/build (master) $

工程编译,也可以直接通过-D方式定义变量,无需toolchain.cmake

如,上述编译之类修改为:

~/test/rtty/rtty/build (master) $ cmake .. -DCMAKE_C_COMPILER=/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc -DLIBEV_LIBRARY=/home/snow/rtty/libev/op/usr/local/lib/libev.a -DLIBEV_INCLUDE_DIR=/home/snow/rtty/libev/op/usr/local/include  -DSSL_SUPPORT=OFF ..
-- The C compiler identification is GNU 5.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Libev: /home/snow/rtty/libev/op/usr/local/lib/libev.a (found version "4.22")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/snow/test/rtty/rtty/build
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $ make
[  9%] Building C object src/CMakeFiles/rtty.dir/command.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 18%] Building C object src/CMakeFiles/rtty.dir/file.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 27%] Building C object src/CMakeFiles/rtty.dir/filectl.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 36%] Building C object src/CMakeFiles/rtty.dir/http.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 45%] Building C object src/CMakeFiles/rtty.dir/main.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 54%] Building C object src/CMakeFiles/rtty.dir/net.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 63%] Building C object src/CMakeFiles/rtty.dir/rtty.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined

[ 72%] Building C object src/CMakeFiles/rtty.dir/utils.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 81%] Building C object src/CMakeFiles/rtty.dir/log/log.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[ 90%] Building C object src/CMakeFiles/rtty.dir/buffer/buffer.c.o
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[100%] Linking C executable rtty
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
[100%] Built target rtty
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $ ls src/rtty -alh
-rwxrwxr-x 1 snow snow 129K  62 19:41 src/rtty
~/test/rtty/rtty/build (master) $
~/test/rtty/rtty/build (master) $

(二)支持SSL的rtty

构建libssl

  • rtty支持openssl, mbedtls, CyaSSl(wolfssl),本文以openssl为例,构建libssl
~/rtty/openssl/openssl (master) $ ./config linux-mips32 no-asm  no-async shared   --prefix=/home/snow/rtty/openssl/openssl/build  --cross-compile-prefix=/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-
  • 注意点:
    (1)使用绝对路径,否则报错
~/rtty/openssl/openssl (master) $ ./config no-asm  no-async shared   --prefix=~/rtty/openssl/openssl/build  --cross-compile-prefix=~/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-

Failure!  build file wasn't produced.
Please read INSTALL.md and associated NOTES-* files.  You may also have to
look over your available compiler tool chain or change your configuration.

Directory given with --prefix MUST be absolute
~/rtty/openssl/openssl (master) $
~/rtty/openssl/openssl (master) $

(2)顶层Makefile去除m64选项

~/rtty/openssl/openssl (master) $ ./config no-asm  no-async shared   --prefix=/home/snow/rtty/openssl/openssl/build  --cross-compile-prefix=/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-
Configuring OpenSSL version 3.2.0-dev for target linux-x86_64
Using os-specific seed configuration


Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
~/rtty/openssl/openssl (master) $
~/rtty/openssl/openssl (master) $
~/rtty/openssl/openssl (master) $ make install
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1.h.in > include/openssl/asn1.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1t.h.in > include/openssl/asn1t.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/bio.h.in > include/openssl/bio.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cmp.h.in > include/openssl/cmp.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cms.h.in > include/openssl/cms.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/conf.h.in > include/openssl/conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crmf.h.in > include/openssl/crmf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crypto.h.in > include/openssl/crypto.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ct.h.in > include/openssl/ct.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/err.h.in > include/openssl/err.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ess.h.in > include/openssl/ess.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/fipskey.h.in > include/openssl/fipskey.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/lhash.h.in > include/openssl/lhash.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ocsp.h.in > include/openssl/ocsp.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/opensslv.h.in > include/openssl/opensslv.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs12.h.in > include/openssl/pkcs12.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs7.h.in > include/openssl/pkcs7.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/safestack.h.in > include/openssl/safestack.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/srp.h.in > include/openssl/srp.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ssl.h.in > include/openssl/ssl.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ui.h.in > include/openssl/ui.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509.h.in > include/openssl/x509.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509_vfy.h.in > include/openssl/x509_vfy.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509v3.h.in > include/openssl/x509v3.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" test/provider_internal_test.cnf.in > test/provider_internal_test.cnf
make depend && make _build_libs
make[1]: Entering directory '/home/snow/rtty/openssl/openssl'
make[1]: Leaving directory '/home/snow/rtty/openssl/openssl'
make[1]: Entering directory '/home/snow/rtty/openssl/openssl'
/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc  -I. -Iinclude -Iapps/include  -fPIC -pthread -m64 -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/home/snow/rtty/openssl/openssl/build/ssl\"" -DENGINESDIR="\"/home/snow/rtty/openssl/openssl/build/lib64/engines-3\"" -DMODULESDIR="\"/home/snow/rtty/openssl/openssl/build/lib64/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG   -c -o apps/lib/libapps-lib-app_libctx.o apps/lib/app_libctx.c
mipsel-openwrt-linux-musl-gcc.bin: error: unrecognized command line option '-m64'
make[1]: *** [Makefile:3243: apps/lib/libapps-lib-app_libctx.o] Error 1
make[1]: Leaving directory '/home/snow/rtty/openssl/openssl'
make: *** [Makefile:1599: build_libs] Error 2
~/rtty/openssl/openssl (master) $
~/rtty/openssl/openssl (master) $

(3)需要指定编译平台类型 linux-mips32

~/rtty/openssl/openssl (master) $ make install
make depend && make _build_libs
make[1]: Entering directory '/home/snow/rtty/openssl/openssl'
make[1]: Leaving directory '/home/snow/rtty/openssl/openssl'
make[1]: Entering directory '/home/snow/rtty/openssl/openssl'
/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc  -I. -Iinclude -Iapps/include  -fPIC -pthread -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/home/snow/rtty/openssl/openssl/build/ssl\"" -DENGINESDIR="\"/home/snow/rtty/openssl/openssl/build/lib64/engines-3\"" -DMODULESDIR="\"/home/snow/rtty/openssl/openssl/build/lib64/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG   -c -o apps/lib/libapps-lib-app_libctx.o apps/lib/app_libctx.c
mipsel-openwrt-linux-musl-gcc.bin: warning: environment variable 'STAGING_DIR' not defined
In file included from include/internal/sockets.h:117:0,
                 from apps/include/apps.h:16,
                 from apps/lib/app_libctx.c:10:
/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
 .....
 .....
 .....
crypto/bn/bn_dh.c:1001:5: note: in expansion of macro 'BN_DEF'
     BN_DEF(0x515DA54D,  0xD6FC2A2C), BN_DEF(0xFFFFFFFF,  0x7FFFFFFF),
     ^
crypto/bn/bn_dh.c:17:26: note: (near initialization for 'ffdhe8192_q[126]')
 #  define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo
                          ^
crypto/bn/bn_dh.c:1001:5: note: in expansion of macro 'BN_DEF'
     BN_DEF(0x515DA54D,  0xD6FC2A2C), BN_DEF(0xFFFFFFFF,  0x7FFFFFFF),
     ^
crypto/bn/bn_dh.c:17:39: warning: left shift count >= width of type [-Wshift-count-overflow]
 #  define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo
                                       ^
crypto/bn/bn_dh.c:1001:38: note: in expansion of macro 'BN_DEF'
     BN_DEF(0x515DA54D,  0xD6FC2A2C), BN_DEF(0xFFFFFFFF,  0x7FFFFFFF),
                                      ^
crypto/bn/bn_dh.c:17:26: error: initializer element is not constant
 #  define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo
                          ^
crypto/bn/bn_dh.c:1001:38: note: in expansion of macro 'BN_DEF'
     BN_DEF(0x515DA54D,  0xD6FC2A2C), BN_DEF(0xFFFFFFFF,  0x7FFFFFFF),
                                      ^
crypto/bn/bn_dh.c:17:26: note: (near initialization for 'ffdhe8192_q[127]')
 #  define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo
                          ^
crypto/bn/bn_dh.c:1001:38: note: in expansion of macro 'BN_DEF'
     BN_DEF(0x515DA54D,  0xD6FC2A2C), BN_DEF(0xFFFFFFFF,  0x7FFFFFFF),
                                      ^
make[1]: *** [Makefile:7448: crypto/bn/libcrypto-lib-bn_dh.o] Error 1
make[1]: Leaving directory '/home/snow/rtty/openssl/openssl'
make: *** [Makefile:1599: build_libs] Error 2
~/rtty/openssl/openssl (master) $

指定target类型为linux-mips32

~/rtty/openssl/openssl (master) $ ./config linux-mips32 no-asm  no-async shared   --prefix=/home/snow/rtty/openssl/openssl/build  --cross-compile-prefix=/home/snow/toolchain/OpenWrt-Toolchain-ramips-mt7621_gcc-5.3.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_1004kc+dsp_gcc-5.3.0_musl-1.1.16/bin/mipsel-openwrt-linux-
Configuring OpenSSL version 3.2.0-dev for target linux-mips32
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
~/rtty/openssl/openssl (master) $
~/rtty/openssl/openssl (master) $
  • 最后执行make install即可生成libssl相关库
~/rtty/openssl/openssl (master) $ ls build/bin build/lib
build/bin:
c_rehash  openssl

build/lib:
engines-3  libcrypto.a  libcrypto.so  libcrypto.so.3  libssl.a  libssl.so  libssl.so.3  ossl-modules  pkgconfig
~/rtty/openssl/openssl (master) $

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/602759.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C语言-外部关键字extern

extern 关键字 extern 用在全局变量或函数的声明前&#xff0c;用来说明“此变量/函数是在别处定义的&#xff0c;要在此处引用。 什么是定义&#xff0c;什么是声明? 什么是定义:所谓的定义就是为这个变量分配一块内存并给它取上一个名字&#xff0c;这个名字就是我们经…

《多传感器融合感知》一、构建自动驾驶多传感器系统

来自 &#xff1a; https://www.bilibili.com/video/BV1JY4y1R7Be/ 多传感器融合的需求多传感器硬件系统构建多传感器硬件系统的时序闭环 1. 多传感器融合的需求 自动驾驶用来解决的问题&#xff1a; 建图定位、感知问题&#xff08;路上有什么、堵不堵、好不好走…&#xff…

数据可视化系列指南之分布类图表大全

导语 随着数据在各行业中的应用越来越广泛&#xff0c;大家也逐渐认识到数据可视化在企业生产经营中的重要作用&#xff0c;在数据可视化过程中&#xff0c;图表是处理数据的重要组成部分&#xff0c;因为它们是一种将大量数据压缩为易于理解的格式的方法。数据可视化可以让受…

生态系统服务评估方法 | 人类活动影响、重大工程实施的生态成效评估(InVEST模型)

以InVEST模型结合实际项目进行由浅入深的实战技术&#xff0c;针对特点及需求进行分析&#xff0c;融合课程体系&#xff0c;对接工作实际项目及论文写作&#xff0c;解决参会者关注的重点及实际项目过程问题&#xff0c;采取逐步延伸的逻辑&#xff0c;不论您是小白亦或是已经…

数据库磁盘文件格式的设计原理内幕

引言 访问磁盘需通过系统调用来实现&#xff0c;因此通常我们需要指定目标文件的偏移量&#xff0c;然后把数据从磁盘上的形式解析成合适主存的形式。这意味着要想设计一个高效的磁盘数据结构&#xff0c;必须构造一种易于修改和解析的文件格式。在本文中&#xff0c;我们将讨论…

unicms 使用thinkphp8 重构版

unicms 有你存在 一切安好 2023年6月使用thinkphp8&#xff0c;重构了cms。php最低使用php8版。参考了多个cms结合10年的开发经验&#xff0c;打造了开箱机用&#xff0c;简单的cms系统。当然由于你能力和开发时间限制&#xff0c;肯定有bug。欢迎大家指正。我也会不定期的修改…

【线性规划模型】

线性规划模型&#xff1a;原理介绍和预测应用 引言 线性规划是运筹学中一种重要的数学优化方法&#xff0c;被广泛应用于各个领域&#xff0c;包括工业、经济、物流等。 线性规划模型的原理 线性规划模型的目标是在一组线性约束条件下&#xff0c;寻找一组变量的最优解&…

Emm_V4.2步进闭环驱动器说明书Rev1.1

一、产品介绍 1.1 产品简介&#xff1a; Emm42_V4.x步进闭环驱动器是张大头智控为满足广大用户需求而自主研发的一款稳定可靠的产品&#xff0c;它是基于上一代Emm42_V3.6版本升级而来&#xff0c;不仅延续了其优秀的FOC矢量闭环控制算法&#xff0c;更在其传统的Dir/Step控制模…

Java003——编写和运行第一个Java程序HelloWorld

一、使用记事本创建Java并运行 1.1、设置文件显示后缀名 目的是为了方便查看文件类型 1.2、创建一个HelloWorld.java文件 java程序文件都是以.java后缀结尾的 1.3、编写Java程序 编写一下程序&#xff0c;并保存 public class HelloWorld {public static void main(Strin…

100天精通Golang(基础入门篇)——第0天: 安装 Go 语言开发环境的基础教程,带你学习Golang之Hello Go !

文章目录 1. 下载 Go 语言的安装包&#xff1a;1. 安装 Go 编译器&#xff1a;- 双击 安装下一步:切换安装路径:下一步:安装等待安装完成安装完成 - 2. 测试安装是否成功&#xff1a;1. 开始学习 Go 语言&#xff1a;1. 创建项目2. 创建 类文件3. 输入类名4. 键入 下方代码块5.…

【C语言】让你不再害怕“指针”【c】【知识点整理】

目录 一.什么是指针&&为什么需要指针&#xff1f; 1.什么是指针&#xff1f; 2.为什么需要指针&#xff1f; 以一个代码为例观察地址&#xff1a;&#xff08;这里我们可以通过调试和打印两种方式观察&#xff09; 1.调试观察&#xff1a; 2.打印观察&#xff08;…

Vue.js 中的 v-if 和 v-show 有什么区别?

Vue.js 中的 v-if 和 v-show 有什么区别&#xff1f; 在 Vue.js 中&#xff0c;v-if 和 v-show 都是用来控制元素的显示和隐藏的指令。但是&#xff0c;它们之间有一些区别。本文将深入探讨 v-if 和 v-show 的区别&#xff0c;并给出一些相关的代码示例。 v-if v-if 是一种条…

python数据分析模块

python数据分析模块 Python与数据分析的关系数据分析常用模块Python数据分析常用类库1&#xff0e;数组计算的数学模块-Numpy2&#xff0e;Pandas——数据分析核心库3&#xff0e;Matplotlib——绘制数据图表的 Python 库4&#xff0e;批量处理Excel文件的模块-xlwings5&#x…

浮点型在内存中的存储,与整型存储方式竟然不同

对于整形的存储方式&#xff0c;大家可以看我的上一篇文章&#xff0c;这篇文章来介绍浮点型在内存中存储方式。 目录 1. 问题 2. 浮点型家族&#xff1a; 3. 存储方式: 4. 读取方式&#xff1a; 5. 解题 1. 问题 我们先来看一段代码&#xff1a; #include <stdio.h&…

人体姿态估计

预测人体关键点有什么作用&#xff1f; 还原人体姿态&#xff0c;输出脸部、手部的关键点坐标3D空间内&#xff0c;关键点变为3维坐标&#xff0c;可以在三维空间中还原人体姿态&#xff0c;可以实现一键换装恢复3D的人体模型实现下游任务–行为理解&#xff0c;根据姿态判断人…

rocketmq-client-go注册消费者组的问题

一、前言 test环境服务启动&#xff0c;通过代码新注册一个customer group进行消费&#xff0c;服务一直报错如下&#xff1a; levelerror msg"fetch offset of mq from broker error" MessageQueue"MessageQueue [topicxxx, brokerNamebroker-a, queueId1]&q…

字节跳动面试挂在2面,复盘后,决定二战.....

先说下我基本情况&#xff0c;本科不是计算机专业&#xff0c;现在是学通信&#xff0c;然后做图像处理&#xff0c;可能面试官看我不是科班出身没有问太多计算机相关的问题&#xff0c;因为第一次找工作&#xff0c;字节的游戏专场又是最早开始的&#xff0c;就投递了&#xf…

人体关键点检测

title: 人体关键点检测 date: 2023-06-02 21:28:46 tags: [MMPose,cv] 人体关键点检测 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9x4nhwLf-1685714024668)(https://fastly.jsdelivr.net/gh/weijia99/blog_imagemain/1685712470039%E4%BA%BA%E4…

【stm32开发】stm32+oled最小系统板资料(原理图、PCB、示例代码)【六一】

&#x1f389;欢迎来到stm32专栏~stm32oled最小系统板 ☆* o(≧▽≦)o *☆嗨~我是小夏与酒&#x1f379; ✨博客主页&#xff1a;小夏与酒的博客 &#x1f388;该系列文章专栏&#xff1a;stm32专栏 文章作者技术和水平有限&#xff0c;如果文中出现错误&#xff0c;希望大家能…

深度学习训练营之J5周DenseNet+SE-Net实战

深度学习训练营之J5周DenseNetSE-Net实战 原文链接方法介绍SE模块应用分析SE模块的效果对比SE模块代码实现SE模块在DenseNet当中的应用参考内容 原文链接 &#x1f4cc;第J5周&#xff1a;DenseNetSE-Net实战&#x1f4cc; &#x1f368; 本文为&#x1f517;365天深度学习训练…