• 交叉编译嵌入式linux平台的gdb工具


    目录

    前期准备:

    开始编译:

    配置编译环境:

    配置交叉编译工具链:

    创建交叉编译产物的目录:

    termcap:

    ncurses:

    gmp:

    gdb:

    编译产物:


    前期准备:

    pc机系统:ubuntu系统

    目标板的编译工具链:arm-openwrt-linux-gcc

    嵌入式Linux目标板:R328

    开始编译:

    编译gdb工具,首先需要下载gdb的源代码,以及它依赖的其他开源库源码,包括ncurses,termcap和gmp

    配置编译环境:

    $ sudo apt-get install bison flex expect-dev build-essential m4 autoconf automake texi2html

    配置交叉编译工具链

    1. $ export PATH=$PATH:/home/guofeng/Workspace/myself/matrix/matrix/toolchains/r328-toolchain/toolchain-sunxi-musl/toolchain/bin
    2. $ export STAGING_DIR=$STAGING_DIR:/home/guofeng/Workspace/myself/matrix/matrix/toolchains/r328-toolchain/toolchain-sunxi-musl/toolchain/bin

    创建交叉编译产物的目录:

    $ mkdir /home/guofeng/Workspace/gdb_cross_compile

    termcap:

    下载源码:

    $ wget https://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz

    解压后,进入到termcap的目录中

    1. $ ./configure --prefix=/home/guofeng/Workspace/gdb_cross_compile/
    2. $ vim Makefile
    3. CC = gcc
    4. AR = ar
    5. RANLIB = ranlib
    6. 修改为:
    7. CC = arm-openwrt-linux-gcc
    8. AR = arm-openwrt-linux-ar
    9. RANLIB = arm-openwrt-linux-ranlib

    然后make,make install,会将交叉编译后的h文件,库文件,文档文件,copy到gdb_cross_compile文件夹的include,lib,info中。

    make install会提示错误,它操作了/usr/include目录,但是又没有权限,直接忽略就好。

    1. guofeng@ubuntu:~/Workspace/gdb_cross_compile/termcap-1.3.1$ make
    2. arm-openwrt-linux-gcc -c -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DTERMCAP_FILE=\"/etc/termcap\" -I. -I. -g termcap.c
    3. arm-openwrt-linux-gcc -c -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DTERMCAP_FILE=\"/etc/termcap\" -I. -I. -g tparam.c
    4. tparam.c: In function 'memory_out':
    5. tparam.c:51:3: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
    6. write (2, "virtual memory exhausted\n", 25);
    7. ^~~~~
    8. arm-openwrt-linux-gcc -c -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DTERMCAP_FILE=\"/etc/termcap\" -I. -I. -g version.c
    9. arm-openwrt-linux-ar rc libtermcap.a termcap.o tparam.o version.o
    10. arm-openwrt-linux-ranlib libtermcap.a
    11. guofeng@ubuntu:~/Workspace/gdb_cross_compile/termcap-1.3.1$ make install
    12. /bin/sh ./mkinstalldirs /home/guofeng/Workspace/gdb_cross_compile//lib \
    13. /home/guofeng/Workspace/gdb_cross_compile//include /home/guofeng/Workspace/gdb_cross_compile//info
    14. mkdir /home/guofeng/Workspace/gdb_cross_compile/lib
    15. mkdir /home/guofeng/Workspace/gdb_cross_compile/include
    16. mkdir /home/guofeng/Workspace/gdb_cross_compile/info
    17. /usr/bin/install -c -m 644 libtermcap.a /home/guofeng/Workspace/gdb_cross_compile//lib/libtermcap.a
    18. arm-openwrt-linux-ranlib /home/guofeng/Workspace/gdb_cross_compile//lib/libtermcap.a
    19. cd .; /usr/bin/install -c -m 644 termcap.h /home/guofeng/Workspace/gdb_cross_compile//include/termcap.h
    20. cd .; test -z "/usr/include" || \
    21. /usr/bin/install -c -m 644 termcap.h /usr/include/termcap.h
    22. /usr/bin/install: cannot remove '/usr/include/termcap.h': Permission denied
    23. make: [Makefile:78: install] Error 1 (ignored)
    24. cd .; for f in termcap.info*; \
    25. do /usr/bin/install -c -m 644 $f /home/guofeng/Workspace/gdb_cross_compile//info/$f; done
    26. guofeng@ubuntu:~/Workspace/gdb_cross_compile$ tree include/
    27. include/
    28. └── termcap.h
    29. 0 directories, 1 file
    30. guofeng@ubuntu:~/Workspace/gdb_cross_compile$ tree lib/
    31. lib/
    32. └── libtermcap.a
    33. 0 directories, 1 file
    34. guofeng@ubuntu:~/Workspace/gdb_cross_compile$ tree info/
    35. info/
    36. ├── termcap.info
    37. ├── termcap.info-1
    38. ├── termcap.info-2
    39. ├── termcap.info-3
    40. └── termcap.info-4
    41. 0 directories, 5 files

    ncurses:

    $ ./configure --prefix=/home/guofeng/Workspace/gdb_cross_compile/ --host=arm-openwrt-linux --with-shared

    $ make

    $ make install

    1. $ wget https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz
    2. guofeng@ubuntu:~/Workspace/gdb_cross_compile/ncurses-6.4$ ./configure --prefix=/home/guofeng/Workspace/gdb_cross_compile/ --host=arm-openwrt-linux --with-shared
    3. configure: WARNING: If you wanted to set the --build type, don't use --host.
    4. If a cross compiler is detected then cross compile mode will be used.
    5. checking for ggrep... no
    6. checking for grep... grep
    7. checking for egrep... grep -E
    8. Configuring NCURSES 6.4 ABI 6 (Wed Sep 6 16:01:06 CST 2023)
    9. checking for package version... 6.4
    10. checking for package patch date... 20221231
    11. checking build system type... x86_64-pc-linux-gnu
    12. checking host system type... arm-openwrt-linux-gnu
    13. checking target system type... arm-openwrt-linux-gnu
    14. Configuring for linux-gnu
    15. checking for fgrep... grep -F
    16. checking for prefix... /home/guofeng/Workspace/gdb_cross_compile/
    17. checking for arm-openwrt-linux-gnatgcc... no
    18. checking for arm-openwrt-linux-gcc... arm-openwrt-linux-gcc
    19. checking for C compiler default output... a.out
    20. checking whether the C compiler works... yes
    21. checking whether we are cross compiling... yes
    22. checking for executable suffix...
    23. checking for object suffix... o
    24. checking whether we are using the GNU C compiler... yes
    25. checking whether arm-openwrt-linux-gcc accepts -g... yes
    26. checking version of arm-openwrt-linux-gcc... .
    27. checking if this is really Intel C compiler... no
    28. checking if this is really Clang C compiler... no
    29. checking for arm-openwrt-linux-gcc option to accept ANSI C... none needed
    30. checking $CFLAGS variable... ok
    31. checking $CC variable... ok
    32. checking how to run the C preprocessor... arm-openwrt-linux-gcc -E
    33. checking whether arm-openwrt-linux-gcc needs -traditional... no
    34. checking whether arm-openwrt-linux-gcc understands -c and -o together... yes
    35. checking if you want to ensure bool is consistent with C++... yes
    36. checking for arm-openwrt-linux-g++... arm-openwrt-linux-g++
    37. guofeng@ubuntu:~/Workspace/gdb_cross_compile/ncurses-6.4$ make
    38. ( cd man && make DESTDIR="" RPATH_LIST="/home/guofeng/Workspace/gdb_cross_compile//lib" all )
    39. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/ncurses-6.4/man'
    40. /bin/sh ./MKterminfo.sh ./terminfo.head ./../include/Caps ./../include/Caps-ncurses ./terminfo.tail >terminfo.5
    41. make[1]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/ncurses-6.4/man'
    42. ( cd include && make DESTDIR="" RPATH_LIST="/home/guofeng/Workspace/gdb_cross_compile//lib" all )
    43. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/ncurses-6.4/include'
    44. cat curses.head >curses.h
    45. AWK=mawk /bin/sh ./MKkey_defs.sh ./Caps ./Caps-ncurses >>curses.h
    46. /bin/sh -c 'if test "0" = "1" ; then cat ./curses.events >>curses.h ; fi'
    47. /bin/sh -c 'if test "chtype" = "cchar_t" ; then cat ./curses.wide >>curses.h ; fi'
    48. cat ./curses.tail >>curses.h
    49. /bin/sh ./MKhashsize.sh ./Caps ./Caps-ncurses >hashsize.h
    50. AWK=mawk /bin/sh ./MKncurses_def.sh ./ncurses_defs >ncurses_def.h
    51. AWK=mawk /bin/sh ./MKparametrized.sh ./Caps ./Caps-ncurses >parametrized.h
    52. touch config.h
    53. mawk -f MKterm.h.awk ./Caps ./Caps-ncurses > term.h
    54. /bin/sh ./edit_cfg.sh ../include/ncurses_cfg.h term.h
    55. ** edit: HAVE_TCGETATTR 1
    56. ** edit: HAVE_TERMIOS_H 1
    57. ** edit: HAVE_TERMIO_H 0
    58. ** edit: BROKEN_LINKER 0
    59. make[1]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/ncurses-6.4/include'
    60. ( cd ncurses && make DESTDIR="" RPATH_LIST="/home/guofeng/Workspace/gdb_cross_compile//lib" all )
    61. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/ncurses-6.4/ncurses'
    62. mawk -f ./tinfo/MKcodes.awk bigstrings=1 ../include/Caps ../include/Caps-ncurses >codes.c
    63. gcc -o make_hash -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I. -I../include -I./../include ./tinfo/make_hash.c
    64. /bin/sh -e ./tinfo/MKcaptab.sh mawk 1 ./tinfo/MKcaptab.awk ../include/Caps ../include/Caps-ncurses > comp_captab.c
    65. /bin/sh -e ./tinfo/MKuserdefs.sh mawk 1 ../include/Caps ../include/Caps-ncurses > comp_userdefs.c
    66. /bin/sh -e ./tty/MKexpanded.sh "arm-openwrt-linux-gcc -E" -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG > expanded.c
    67. /bin/sh -e ./tinfo/MKfallback.sh /home/guofeng/Workspace/gdb_cross_compile//share/terminfo ../misc/terminfo.src "tic" "infocmp" >fallback.c
    68. FGREP="grep -F" /bin/sh -e ./base/MKlib_gen.sh "arm-openwrt-linux-gcc -E -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG" "mawk" generated <../include/curses.h >lib_gen.c
    69. .. adding -P option to work around arm-openwrt-linux-gcc 6.4.1
    70. AWK=mawk /bin/sh ./tinfo/MKkeys_list.sh ../include/Caps ../include/Caps-ncurses | LC_ALL=C sort >keys.list
    71. mawk -f ./base/MKkeyname.awk bigstrings=1 keys.list > lib_keyname.c
    72. FGREP="grep -F" /bin/sh -e ./base/MKlib_gen.sh "arm-openwrt-linux-gcc -E -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG" "mawk" implemented <../include/curses.h >link_test.c
    73. .. adding -P option to work around arm-openwrt-linux-gcc 6.4.1
    74. mawk -f ./tinfo/MKnames.awk bigstrings=1 ../include/Caps ../include/Caps-ncurses >names.c
    75. echo | mawk -f ./base/MKunctrl.awk bigstrings=1 >unctrl.c
    76. gcc -o make_keys -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I. -I../include -I./../include ./tinfo/make_keys.c
    77. ./make_keys keys.list > init_keytry.h
    78. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./tty/hardscroll.c -o ../obj_s/hardscroll.o
    79. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./tty/hashmap.c -o ../obj_s/hashmap.o
    80. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_addch.c -o ../obj_s/lib_addch.o
    81. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_addstr.c -o ../obj_s/lib_addstr.o
    82. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_beep.c -o ../obj_s/lib_beep.o
    83. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_bkgd.c -o ../obj_s/lib_bkgd.o
    84. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_box.c -o ../obj_s/lib_box.o
    85. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_chgat.c -o ../obj_s/lib_chgat.o
    86. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_clear.c -o ../obj_s/lib_clear.o
    87. arm-openwrt-linux-gcc -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses -I. -I../include -DNDEBUG -O2 --param max-inline-insns-single=1200 -fPIC -c ../ncurses/./base/lib_clearok.c -o ../obj_s/lib_clearok.o
    88. guofeng@ubuntu:~/Workspace/gdb_cross_compile/ncurses-6.4$ make install
    89. ( cd man && make DESTDIR="" RPATH_LIST="/home/guofeng/Workspace/gdb_cross_compile//lib" install )
    90. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/ncurses-6.4/man'
    91. mkdir -p /home/guofeng/Workspace/gdb_cross_compile//share/man
    92. /bin/sh ../edit_man.sh normal installing /home/guofeng/Workspace/gdb_cross_compile//share/man . terminfo.5 *-config.1 ./*.[0-9]*
    93. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man5/terminfo.5.gz
    94. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man1/ncurses6-config.1.gz
    95. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man1/captoinfo.1.gz
    96. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man1/clear.1.gz
    97. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man3/add_wch.3ncurses.gz
    98. .. installing alias echo_wchar.3ncurses.gz
    99. .. installing alias mvadd_wch.3ncurses.gz
    100. .. installing alias mvwadd_wch.3ncurses.gz
    101. .. installing alias wadd_wch.3ncurses.gz
    102. .. installing alias wecho_wchar.3ncurses.gz
    103. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man3/add_wchstr.3ncurses.gz
    104. .. installing alias add_wchnstr.3ncurses.gz
    105. .. installing alias mvadd_wchnstr.3ncurses.gz
    106. .. installing alias mvadd_wchstr.3ncurses.gz
    107. .. installing alias mvwadd_wchnstr.3ncurses.gz
    108. .. installing alias mvwadd_wchstr.3ncurses.gz
    109. .. installing alias wadd_wchnstr.3ncurses.gz
    110. .. installing alias wadd_wchstr.3ncurses.gz
    111. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man3/addch.3ncurses.gz
    112. .. installing alias echochar.3ncurses.gz
    113. .. installing alias mvaddch.3ncurses.gz
    114. .. installing alias mvwaddch.3ncurses.gz
    115. .. installing alias waddch.3ncurses.gz
    116. .. installing alias wechochar.3ncurses.gz
    117. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man3/addchstr.3ncurses.gz
    118. .. installing alias addchnstr.3ncurses.gz
    119. .. installing alias mvaddchnstr.3ncurses.gz
    120. .. installing alias mvaddchstr.3ncurses.gz
    121. .. installing alias mvwaddchnstr.3ncurses.gz
    122. .. installing alias mvwaddchstr.3ncurses.gz
    123. .. installing alias waddchnstr.3ncurses.gz
    124. .. installing alias waddchstr.3ncurses.gz
    125. installing /home/guofeng/Workspace/gdb_cross_compile//share/man/man3/addstr.3ncurses.gz
    126. guofeng@ubuntu:~/Workspace/gdb_cross_compile$ tree include/
    127. include/
    128. ├── ncurses
    129. │   ├── curses.h
    130. │   ├── nc_tparm.h
    131. │   ├── ncurses_dll.h
    132. │   ├── ncurses.h -> curses.h
    133. │   ├── termcap.h
    134. │   ├── term_entry.h
    135. │   ├── term.h
    136. │   ├── tic.h
    137. │   └── unctrl.h
    138. └── termcap.h
    139. 1 directory, 10 files
    140. guofeng@ubuntu:~/Workspace/gdb_cross_compile$ tree info/
    141. info/
    142. ├── termcap.info
    143. ├── termcap.info-1
    144. ├── termcap.info-2
    145. ├── termcap.info-3
    146. └── termcap.info-4
    147. 0 directories, 5 files
    148. guofeng@ubuntu:~/Workspace/gdb_cross_compile$ tree lib/
    149. lib/
    150. ├── libncurses.a
    151. ├── libncurses_g.a
    152. ├── libncurses.so -> libncurses.so.6
    153. ├── libncurses.so.6 -> libncurses.so.6.4
    154. ├── libncurses.so.6.4
    155. └── libtermcap.a
    156. 0 directories, 6 files
    157. guofeng@ubuntu:~/Workspace/gdb_cross_compile$

    gmp:

    如果没有编译gmp,那么在编译gdb时,会报错。

    $ ./configure --prefix=/home/guofeng/Workspace/gdb_cross_compile/ --host=arm-openwrt-linux

    $ make

    $ make install

    1. $ wget --no-check-certificate "https://gmplib.org/download/gmp/gmp-6.2.1.tar
    2. $ ./configure --prefix=/home/guofeng/Workspace/gdb_cross_compile/ --host=arm-openwrt-linux
    3. checking build system type... nehalem-pc-linux-gnu
    4. checking host system type... arm-openwrt-linux-gnu
    5. checking for a BSD-compatible install... /usr/bin/install -c
    6. checking whether build environment is sane... yes
    7. checking for arm-openwrt-linux-strip... arm-openwrt-linux-strip
    8. checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
    9. checking for gawk... no
    10. checking for mawk... mawk
    11. checking whether make sets $(MAKE)... yes
    12. checking whether make supports nested variables... yes
    13. checking whether to enable maintainer-specific portions of Makefiles... no
    14. checking ABI=32
    15. checking compiler arm-openwrt-linux-gcc -O2 -pedantic -fomit-frame-pointer ... yes
    16. checking whether ARM gcc unsigned division works... yes
    17. checking compiler arm-openwrt-linux-gcc -O2 -pedantic -fomit-frame-pointer -march=armv4... yes
    18. checking for arm-openwrt-linux-gcc... arm-openwrt-linux-gcc
    19. ...
    20. ...
    21. ...
    22. config.status: linking mpn/arm/invert_limb.asm to mpn/invert_limb.asm
    23. config.status: linking mpn/arm/aorslsh1_n.asm to mpn/addlsh1_n.asm
    24. config.status: linking mpn/arm/aorslsh1_n.asm to mpn/sublsh1_n.asm
    25. config.status: linking mpn/arm/rsh1aors_n.asm to mpn/rsh1add_n.asm
    26. config.status: linking mpn/arm/rsh1aors_n.asm to mpn/rsh1sub_n.asm
    27. config.status: linking mpn/generic/add_n_sub_n.c to mpn/add_n_sub_n.c
    28. config.status: linking mpn/arm/gmp-mparam.h to gmp-mparam.h
    29. config.status: executing libtool commands
    30. configure: summary of build options:
    31. Version: GNU MP 6.2.1
    32. Host type: arm-openwrt-linux-gnu
    33. ABI: 32
    34. Install prefix: /home/guofeng/Workspace/gdb_cross_compile
    35. Compiler: arm-openwrt-linux-gcc
    36. Static libraries: yes
    37. Shared libraries: yes
    38. guofeng@ubuntu:~/Workspace/gdb_cross_compile/gmp-6.2.1$ make
    39. make all-recursive
    40. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    41. Making all in tests
    42. make[2]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    43. Making all in .
    44. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    45. make[3]: Nothing to be done for 'all-am'.
    46. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    47. Making all in devel
    48. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/devel'
    49. make[3]: Nothing to be done for 'all'.
    50. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/devel'
    51. Making all in mpn
    52. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpn'
    53. make[3]: Nothing to be done for 'all'.
    54. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpn'
    55. Making all in mpz
    56. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpz'
    57. make[3]: Nothing to be done for 'all'.
    58. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpz'
    59. Making all in mpq
    60. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpq'
    61. make[3]: Nothing to be done for 'all'.
    62. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpq'
    63. Making all in mpf
    64. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpf'
    65. make[3]: Nothing to be done for 'all'.
    66. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpf'
    67. Making all in rand
    68. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/rand'
    69. make[3]: Nothing to be done for 'all'.
    70. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/rand'
    71. Making all in misc
    72. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/misc'
    73. make[3]: Nothing to be done for 'all'.
    74. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/misc'
    75. Making all in cxx
    76. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/cxx'
    77. make[3]: Nothing to be done for 'all'.
    78. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/cxx'
    79. ......
    80. sqrtrem.o .libs/libgmp.lax/lt87-sizeinbase.o .libs/libgmp.lax/lt88-get_str.o .libs/libgmp.lax/lt89-set_str.o mpn/compute_powtab.o .libs/libgmp.lax/lt90-scan0.o .libs/libgmp.lax/lt91-scan1.o .libs/libgmp.lax/lt92-popcount.o .libs/libgmp.lax/lt93-hamdist.o .libs/libgmp.lax/lt94-cmp.o mpn/zero_p.o .libs/libgmp.lax/lt95-perfsqr.o .libs/libgmp.lax/lt96-perfpow.o mpn/strongfibo.o mpn/gcd_11.o mpn/gcd_22.o mpn/gcd_1.o .libs/libgmp.lax/lt97-gcd.o mpn/gcdext_1.o .libs/libgmp.lax/lt98-gcdext.o mpn/gcd_subdiv_step.o mpn/gcdext_lehmer.o mpn/div_q.o .libs/libgmp.lax/lt99-tdiv_qr.o mpn/jacbase.o mpn/jacobi_2.o .libs/libgmp.lax/lt100-jacobi.o .libs/libgmp.lax/lt101-get_d.o mpn/matrix22_mul.o mpn/matrix22_mul1_inverse_vector.o mpn/hgcd_matrix.o mpn/hgcd2.o mpn/hgcd_step.o mpn/hgcd_reduce.o mpn/hgcd.o mpn/hgcd_appr.o mpn/hgcd2_jacobi.o mpn/hgcd_jacobi.o mpn/mullo_n.o mpn/mullo_basecase.o mpn/sqrlo.o mpn/sqrlo_basecase.o mpn/toom22_mul.o mpn/toom32_mul.o mpn/toom42_mul.o mpn/toom52_mul.o mpn/toom62_mul.o mpn/toom33_mul.o mpn/toom43_mul.o mpn/toom53_mul.o mpn/toom54_mul.o mpn/toom63_mul.o mpn/toom44_mul.o mpn/toom6h_mul.o mpn/toom6_sqr.o mpn/toom8h_mul.o mpn/toom8_sqr.o mpn/toom_couple_handling.o mpn/toom2_sqr.o mpn/toom3_sqr.o mpn/toom4_sqr.o mpn/toom_eval_dgr3_pm1.o mpn/toom_eval_dgr3_pm2.o mpn/toom_eval_pm1.o mpn/toom_eval_pm2.o mpn/toom_eval_pm2exp.o mpn/toom_eval_pm2rexp.o mpn/toom_interpolate_5pts.o mpn/toom_interpolate_6pts.o mpn/toom_interpolate_7pts.o mpn/toom_interpolate_8pts.o mpn/toom_interpolate_12pts.o mpn/toom_interpolate_16pts.o mpn/invertappr.o .libs/libgmp.lax/lt102-invert.o mpn/binvert.o mpn/mulmod_bnm1.o mpn/sqrmod_bnm1.o mpn/div_qr_1.o mpn/div_qr_1n_pi1.o mpn/div_qr_2.o mpn/div_qr_2n_pi1.o mpn/div_qr_2u_pi1.o mpn/sbpi1_div_q.o mpn/sbpi1_div_qr.o mpn/sbpi1_divappr_q.o mpn/dcpi1_div_q.o mpn/dcpi1_div_qr.o mpn/dcpi1_divappr_q.o mpn/mu_div_qr.o mpn/mu_divappr_q.o mpn/mu_div_q.o mpn/bdiv_q_1.o mpn/sbpi1_bdiv_q.o mpn/sbpi1_bdiv_qr.o mpn/sbpi1_bdiv_r.o mpn/dcpi1_bdiv_q.o mpn/dcpi1_bdiv_qr.o mpn/mu_bdiv_q.o mpn/mu_bdiv_qr.o mpn/bdiv_q.o mpn/bdiv_qr.o mpn/broot.o mpn/brootinv.o mpn/bsqrt.o mpn/bsqrtinv.o .libs/libgmp.lax/lt103-divexact.o mpn/bdiv_dbm1c.o mpn/redc_1.o mpn/redc_2.o mpn/redc_n.o .libs/libgmp.lax/lt104-powm.o mpn/powlo.o mpn/sec_powm.o mpn/sec_mul.o mpn/sec_sqr.o mpn/sec_div_qr.o mpn/sec_div_r.o mpn/sec_pi1_div_qr.o mpn/sec_pi1_div_r.o mpn/sec_add_1.o mpn/sec_sub_1.o mpn/sec_invert.o mpn/trialdiv.o .libs/libgmp.lax/lt105-remove.o mpn/and_n.o mpn/andn_n.o mpn/nand_n.o mpn/ior_n.o mpn/iorn_n.o mpn/nior_n.o mpn/xor_n.o mpn/xnor_n.o mpn/copyi.o mpn/copyd.o mpn/zero.o mpn/sec_tabselect.o mpn/comb_tables.o mpn/udiv.o mpn/invert_limb.o mpn/addlsh1_n.o mpn/sublsh1_n.o mpn/rsh1add_n.o mpn/rsh1sub_n.o mpn/add_n_sub_n.o printf/asprintf.o printf/asprntffuns.o printf/doprnt.o printf/doprntf.o printf/doprnti.o printf/fprintf.o printf/obprintf.o printf/obvprintf.o printf/obprntffuns.o printf/printf.o printf/printffuns.o printf/snprintf.o printf/snprntffuns.o printf/sprintf.o printf/sprintffuns.o printf/vasprintf.o printf/vfprintf.o printf/vprintf.o printf/vsnprintf.o printf/vsprintf.o printf/repl-vsnprintf.o scanf/doscan.o scanf/fscanf.o scanf/fscanffuns.o scanf/scanf.o scanf/sscanf.o scanf/sscanffuns.o scanf/vfscanf.o scanf/vscanf.o scanf/vsscanf.o rand/rand.o rand/randclr.o rand/randdef.o rand/randiset.o rand/randlc2s.o rand/randlc2x.o rand/randmt.o rand/randmts.o rand/rands.o rand/randsd.o rand/randsdui.o rand/randbui.o rand/randmui.o
    81. libtool: link: arm-openwrt-linux-ranlib .libs/libgmp.a
    82. libtool: link: rm -fr .libs/libgmp.lax
    83. libtool: link: ( cd ".libs" && rm -f "libgmp.la" && ln -s "../libgmp.la" "libgmp.la" )
    84. make[2]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    85. make[1]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    86. $ make install
    87. guofeng@ubuntu:~/Workspace/gdb_cross_compile/gmp-6.2.1$ make install
    88. make install-recursive
    89. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    90. Making install in tests
    91. make[2]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    92. Making install in .
    93. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    94. make[4]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    95. make[4]: Nothing to be done for 'install-exec-am'.
    96. make[4]: Nothing to be done for 'install-data-am'.
    97. make[4]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    98. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests'
    99. Making install in devel
    100. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/devel'
    101. make[4]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/devel'
    102. make[4]: Nothing to be done for 'install-exec-am'.
    103. make[4]: Nothing to be done for 'install-data-am'.
    104. make[4]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/devel'
    105. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/devel'
    106. Making install in mpn
    107. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpn'
    108. make[4]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1/tests/mpn'
    109. ...
    110. ...
    111. ...
    112. ----------------------------------------------------------------------
    113. Libraries have been installed in:
    114. /home/guofeng/Workspace/gdb_cross_compile/lib
    115. If you ever happen to want to link against installed libraries
    116. in a given directory, LIBDIR, you must either use libtool, and
    117. specify the full pathname of the library, or use the '-LLIBDIR'
    118. flag during linking and do at least one of the following:
    119. - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
    120. during execution
    121. - add LIBDIR to the 'LD_RUN_PATH' environment variable
    122. during linking
    123. - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
    124. - have your system administrator add LIBDIR to '/etc/ld.so.conf'
    125. See any operating system documentation about shared libraries for
    126. more information, such as the ld(1) and ld.so(8) manual pages.
    127. ----------------------------------------------------------------------
    128. /usr/bin/mkdir -p '/home/guofeng/Workspace/gdb_cross_compile/include'
    129. /usr/bin/install -c -m 644 gmp.h '/home/guofeng/Workspace/gdb_cross_compile/include'
    130. /usr/bin/mkdir -p '/home/guofeng/Workspace/gdb_cross_compile/lib/pkgconfig'
    131. /usr/bin/install -c -m 644 gmp.pc '/home/guofeng/Workspace/gdb_cross_compile/lib/pkgconfig'
    132. make install-data-hook
    133. make[4]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    134. +-------------------------------------------------------------+
    135. | CAUTION: |
    136. | |
    137. | If you have not already run "make check", then we strongly |
    138. | recommend you do so. |
    139. | |
    140. | GMP has been carefully tested by its authors, but compilers |
    141. | are all too often released with serious bugs. GMP tends to |
    142. | explore interesting corners in compilers and has hit bugs |
    143. | on quite a few occasions. |
    144. | |
    145. +-------------------------------------------------------------+
    146. make[4]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    147. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    148. make[2]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'
    149. make[1]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gmp-6.2.1'

    gdb:

    下载源码,可以去官网下载最新release版本,也可以复制下面的gdb的ftp地址。

    官网:GDB: The GNU Project Debugger (sourceware.org)icon-default.png?t=N7T8https://www.sourceware.org/gdb/

    $ wget https://ftp.gnu.org/gnu/gdb/gdb-13.2.tar.xz

    $ ./configure --host=arm-openwrt-linux --target=arm-openwrt-linux --prefix=/home/guofeng/Workspace/gdb_cross_compile --enable-static LDFLAGS="-L/home/guofeng/Workspace/gdb_cross_compile/lib" CFLAGS="-I/home/guofeng/Workspace/gdb_crocess_compile/include"

    $ make

    $ make install

    1. guofeng@ubuntu:~/Workspace/gdb_cross_compile/gdb-13.2$ ./configure --host=arm-openwrt-linux --target=arm-openwrt-linux --prefix=/home/guofeng/Workspace/gdb_cross_compile --enable-static LDFLAGS="-L/home/guofeng/Workspace/gdb_cross_compile/lib" CFLAGS="-I/home/guofeng/Workspace/gdb_crocess_compile/include"
    2. checking build system type... x86_64-pc-linux-gnu
    3. checking host system type... arm-openwrt-linux-gnu
    4. checking target system type... arm-openwrt-linux-gnu
    5. checking for a BSD-compatible install... /usr/bin/install -c
    6. checking whether ln works... yes
    7. checking whether ln -s works... yes
    8. checking for a sed that does not truncate output... /usr/bin/sed
    9. checking for gawk... no
    10. checking for mawk... mawk
    11. checking for gdbserver support... yes
    12. checking for arm-openwrt-linux-gcc... arm-openwrt-linux-gcc
    13. checking whether the C compiler works... yes
    14. checking for C compiler default output file name... a.out
    15. checking for suffix of executables...
    16. checking whether we are cross compiling... yes
    17. checking for suffix of object files... o
    18. checking whether we are using the GNU C compiler... yes
    19. checking whether arm-openwrt-linux-gcc accepts -g... yes
    20. checking for arm-openwrt-linux-gcc option to accept ISO C89... none needed
    21. guofeng@ubuntu:~/Workspace/gdb_cross_compile/gdb-13.2$ make
    22. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2'
    23. Configuring in ./libiberty
    24. configure: loading cache ./config.cache
    25. checking whether to enable maintainer-specific portions of Makefiles... no
    26. checking for makeinfo... (cached) /home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/missing makeinfo --split-size=5000000
    27. configure: WARNING:
    28. *** Makeinfo is missing. Info documentation will not be built.
    29. checking for perl... (cached) perl
    30. checking build system type... (cached) x86_64-pc-linux-gnu
    31. checking host system type... (cached) arm-openwrt-linux-gnu
    32. checking for arm-openwrt-linux-ar... (cached) arm-openwrt-linux-ar
    33. checking for arm-openwrt-linux-ranlib... (cached) arm-openwrt-linux-ranlib
    34. checking for -plugin option... checking for arm-openwrt-linux-ar... (cached) arm-openwrt-linux-ar
    35. arm-openwrt-linux-ar: no operation specified
    36. configure: WARNING: Failed: arm-openwrt-linux-ar --plugin /home/guofeng/Workspace/myself/matrix/matrix/toolchains/r328-toolchain/toolchain-sunxi-musl/toolchain/bin/../libexec/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/liblto_plugin.so rc
    37. no
    38. checking whether to install libiberty headers and static library... no
    39. configure: target_header_dir =
    40. checking for arm-openwrt-linux-gcc... (cached) arm-openwrt-linux-gcc
    41. ......
    42. ......
    43. touch stamp-guile
    44. rm -rf ./system-gdbinit
    45. mkdir ./system-gdbinit
    46. files='elinos.py wrs-linux.py' ; \
    47. for file in $files ; do \
    48. f=./../system-gdbinit/$file ; \
    49. if test -f $f ; then \
    50. /usr/bin/install -c -m 644 $f ./system-gdbinit ; \
    51. fi ; \
    52. done
    53. touch stamp-system-gdbinit
    54. make[4]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb/data-directory'
    55. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb'
    56. make[2]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb'
    57. make[1]: Nothing to be done for 'all-target'.
    58. make[1]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2
    59. guofeng@ubuntu:~/Workspace/gdb_cross_compile/gdb-13.2$ make install
    60. make[1]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2'
    61. /bin/bash ./mkinstalldirs /home/guofeng/Workspace/gdb_cross_compile /home/guofeng/Workspace/gdb_cross_compile
    62. make[2]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libsframe'
    63. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libsframe'
    64. /usr/bin/mkdir -p '/home/guofeng/Workspace/gdb_cross_compile/share/info'
    65. /usr/bin/install -c -m 644 ./doc/sframe-spec.info '/home/guofeng/Workspace/gdb_cross_compile/share/info'
    66. install-info --info-dir='/home/guofeng/Workspace/gdb_cross_compile/share/info' '/home/guofeng/Workspace/gdb_cross_compile/share/info/sframe-spec.info'
    67. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libsframe'
    68. make[2]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libsframe'
    69. make[2]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/bfd'
    70. make install-recursive
    71. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/bfd'
    72. Making install in po
    73. make[4]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/bfd/po'
    74. if test -r .././../mkinstalldirs; then \
    75. .././../mkinstalldirs /home/guofeng/Workspace/gdb_cross_compile/share; \
    76. else \
    77. ../mkinstalldirs /home/guofeng/Workspace/gdb_cross_compile/share; \
    78. fi
    79. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/da/LC_MESSAGES
    80. installing da.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/da/LC_MESSAGES/bfd.mo
    81. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/es/LC_MESSAGES
    82. installing es.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/es/LC_MESSAGES/bfd.mo
    83. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/fi/LC_MESSAGES
    84. installing fi.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/fi/LC_MESSAGES/bfd.mo
    85. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/fr/LC_MESSAGES
    86. installing fr.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/fr/LC_MESSAGES/bfd.mo
    87. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/hr/LC_MESSAGES
    88. installing hr.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/hr/LC_MESSAGES/bfd.mo
    89. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/id/LC_MESSAGES
    90. installing id.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/id/LC_MESSAGES/bfd.mo
    91. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/ja/LC_MESSAGES
    92. installing ja.gmo as /home/guofeng/Workspace/gdb_cross_compile/share/locale/ja/LC_MESSAGES/bfd.mo
    93. mkdir -p -- /home/guofeng/Workspace/gdb_cross_compile/share/locale/pt/LC_MESSAGES
    94. ......
    95. ......
    96. ......
    97. ......
    98. ......
    99. ......
    100. ......
    101. make[6]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb/data-directory'
    102. make[5]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb/data-directory'
    103. make[4]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb'
    104. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb'
    105. make[2]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/gdb'
    106. make[2]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libctf'
    107. make[3]: Entering directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libctf'
    108. /usr/bin/mkdir -p '/home/guofeng/Workspace/gdb_cross_compile/lib'
    109. /bin/bash ./libtool --mode=install /usr/bin/install -c libctf.la libctf-nobfd.la '/home/guofeng/Workspace/gdb_cross_compile/lib'
    110. libtool: install: /usr/bin/install -c .libs/libctf.lai /home/guofeng/Workspace/gdb_cross_compile/lib/libctf.la
    111. libtool: install: /usr/bin/install -c .libs/libctf-nobfd.lai /home/guofeng/Workspace/gdb_cross_compile/lib/libctf-nobfd.la
    112. libtool: install: /usr/bin/install -c .libs/libctf.a /home/guofeng/Workspace/gdb_cross_compile/lib/libctf.a
    113. libtool: install: chmod 644 /home/guofeng/Workspace/gdb_cross_compile/lib/libctf.a
    114. libtool: install: arm-openwrt-linux-ranlib --plugin /home/guofeng/Workspace/myself/matrix/matrix/toolchains/r328-toolchain/toolchain-sunxi-musl/toolchain/bin/../libexec/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/liblto_plugin.so /home/guofeng/Workspace/gdb_cross_compile/lib/libctf.a
    115. libtool: install: /usr/bin/install -c .libs/libctf-nobfd.a /home/guofeng/Workspace/gdb_cross_compile/lib/libctf-nobfd.a
    116. libtool: install: chmod 644 /home/guofeng/Workspace/gdb_cross_compile/lib/libctf-nobfd.a
    117. libtool: install: arm-openwrt-linux-ranlib --plugin /home/guofeng/Workspace/myself/matrix/matrix/toolchains/r328-toolchain/toolchain-sunxi-musl/toolchain/bin/../libexec/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/liblto_plugin.so /home/guofeng/Workspace/gdb_cross_compile/lib/libctf-nobfd.a
    118. libtool: finish: PATH="/home/guofeng/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/guofeng/.local/bin:/home/guofeng/Workspace/myself/matrix/matrix/toolchains/r328-toolchain/toolchain-sunxi-musl/toolchain/bin:/sbin" ldconfig -n /home/guofeng/Workspace/gdb_cross_compile/lib
    119. ----------------------------------------------------------------------
    120. Libraries have been installed in:
    121. /home/guofeng/Workspace/gdb_cross_compile/lib
    122. If you ever happen to want to link against installed libraries
    123. in a given directory, LIBDIR, you must either use libtool, and
    124. specify the full pathname of the library, or use the `-LLIBDIR'
    125. flag during linking and do at least one of the following:
    126. - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    127. during execution
    128. - add LIBDIR to the `LD_RUN_PATH' environment variable
    129. during linking
    130. - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
    131. - have your system administrator add LIBDIR to `/etc/ld.so.conf'
    132. See any operating system documentation about shared libraries for
    133. more information, such as the ld(1) and ld.so(8) manual pages.
    134. ----------------------------------------------------------------------
    135. /usr/bin/mkdir -p '/home/guofeng/Workspace/gdb_cross_compile/include'
    136. /usr/bin/install -c -m 644 ./../include/ctf.h ./../include/ctf-api.h '/home/guofeng/Workspace/gdb_cross_compile/include'
    137. /usr/bin/mkdir -p '/home/guofeng/Workspace/gdb_cross_compile/share/info'
    138. /usr/bin/install -c -m 644 ./doc/ctf-spec.info '/home/guofeng/Workspace/gdb_cross_compile/share/info'
    139. install-info --info-dir='/home/guofeng/Workspace/gdb_cross_compile/share/info' '/home/guofeng/Workspace/gdb_cross_compile/share/info/ctf-spec.info'
    140. make[3]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libctf'
    141. make[2]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2/libctf'
    142. make[1]: Nothing to be done for 'install-target'.
    143. make[1]: Leaving directory '/home/guofeng/Workspace/gdb_cross_compile/gdb-13.2'

    编译产物:

    编译的产物,在gdb_cross_compile文件夹的bin目录中,在该目录中可以找到gcore,gdb,gdbserver等工具,需要主要的是,gdb文件是依赖so的(依赖libgmp.so和libncurses.so),实际使用时需要将这两个so复制到目标板上,同时配置export LD_LIBRARY_PATH=so文件存放路径。

    然后就可以在目标板上运行gdb了。

  • 相关阅读:
    什么牌子的电容笔性价比高?电容笔牌子排行
    MySQL - 慢查询优化
    LeetCode-对链表进行插入排序
    STM32物联网项目-窗口看门狗WWDG
    深度分析React源码中的合成事件
    利用剪切干涉法的准直测量
    Kubernetes(29):Kubernetes Dashboard的使用
    MySQL基础篇总结
    JavaScript 函数 function
    JSON介绍
  • 原文地址:https://blog.csdn.net/wanguofeng8023/article/details/132714558