当前位置:   article > 正文

交叉编译openGL,Ubuntu20.04 to aarch64 (一)_arm opengl交叉编译

arm opengl交叉编译

编译器安装参考:ubuntu20.04搭建arm交叉编译环境_arm交叉编译环境搭建_我是huhu的博客-CSDN博客

参考博客:

opengl交叉编译_交叉编译opengl_逆商的博客-CSDN博客

树莓派Tools交叉编译OpenGL(mesa-12.0.5)_opengl交叉编译_竹叶青lvye的博客-CSDN博客

开始

需要下载的源码、版本、下载地址:

xproto-7.0.23:xproto-7.0.23

libXau-1.0.7:libXau-1.0.7

libpciaccess-0.16:libpciaccess_0.16 

libdrm-2.4.100 :libdrm-2.4.100

xcb-proto-1.6 :xcb-proto-1.6

libxcb-1.5 :libxcb-1.5

libxshmfence_1.3:libxshmfence_1.3

expat-2.2.7 :expat-2.2.7

openssl-openssl:openssl-openssl

eudev-3.2.5:eudev-3.2.5

mesa-12.0.5:mesa-12.0.5

下aptitude下面的一个包

aptitude install xutils-dev


编译xproto

进入解压后的文件夹:/home/huhu/third_part/openGL/xproto-7.0.23/

新建了一个build和install文件夹

CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ ./configure --prefix=/home/huhu/third_part/openGL/xproto-7.0.23/install --host=arm-linux

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ ./configure --prefix=/home/huhu/third_part/openGL/xproto-7.0.23/install --host=arm-linux 
  2. configure: WARNING: if you wanted to set the --build type, don't use --host.
  3. If a cross compiler is detected then cross compile mode will be used
  4. checking for a BSD-compatible install... /usr/bin/install -c
  5. checking whether build environment is sane... yes
  6. checking for arm-linux -strip... no
  7. checking for strip... 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 to enable maintainer-specific portions of Makefiles... no
  13. checking for style of include used by make... GNU
  14. checking for arm-linux -gcc... aarch64-none-linux-gnu-gcc
  15. checking whether the C compiler works... yes
  16. checking for C compiler default output file name... a.out
  17. checking for suffix of executables...
  18. checking whether we are cross compiling... yes
  19. checking for suffix of object files... o
  20. checking whether we are using the GNU C compiler... yes
  21. checking whether aarch64-none-linux-gnu-gcc accepts -g... yes
  22. checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
  23. checking dependency style of aarch64-none-linux-gnu-gcc... none
  24. checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
  25. checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
  26. checking for grep that handles long lines and -e... /usr/bin/grep
  27. checking for egrep... /usr/bin/grep -E
  28. checking for ANSI C header files... yes
  29. checking for sys/types.h... yes
  30. checking for sys/stat.h... yes
  31. checking for stdlib.h... yes
  32. checking for string.h... yes
  33. checking for memory.h... yes
  34. checking for strings.h... yes
  35. checking for inttypes.h... yes
  36. checking for stdint.h... yes
  37. checking for unistd.h... yes
  38. checking whether __clang__ is declared... no
  39. checking whether __INTEL_COMPILER is declared... no
  40. checking whether __SUNPRO_C is declared... no
  41. checking for arm-linux -pkg-config... no
  42. checking for pkg-config... /usr/bin/pkg-config
  43. configure: WARNING: using cross tools not prefixed with host triplet
  44. checking pkg-config is at least version 0.9.0... yes
  45. checking build system type... x86_64-unknown-linux-gnu
  46. checking host system type... arm-unknown-linux-gnu 
  47. checking for a sed that does not truncate output... /usr/bin/sed
  48. checking if aarch64-none-linux-gnu-gcc supports -Werror=unknown-warning-option... no
  49. checking if aarch64-none-linux-gnu-gcc supports -Werror=unused-command-line-argument... no
  50. checking if aarch64-none-linux-gnu-gcc supports-Wall... yes
  51. checking if aarch64-none-linux-gnu-gcc supports-Wpointer-arith... yes
  52. checking if aarch64-none-linux-gnu-gcc supports-Wmissing-declarations... yes
  53. checking if aarch64-none-linux-gnu-gcc supports-Wformat=2... yes
  54. checking if aarch64-none-linux-gnu-gcc supports-Wstrict-prototypes... yes
  55. checking if aarch64-none-linux-gnu-gcc supports-Wmissing-prototypes... yes
  56. checking if aarch64-none-linux-gnu-gcc supports-Wnested-externs... yes
  57. checking if aarch64-none-linux-gnu-gcc supports-Wbad-function-cast... yes
  58. checking if aarch64-none-linux-gnu-gcc supports-Wold-style-definition... yes
  59. checking if aarch64-none-linux-gnu-gcc supports-Wdeclaration-after-statement... yes
  60. checking if aarch64-none-linux-gnu-gcc supports-Wunused... yes
  61. checking if aarch64-none-linux-gnu-gcc supports-Wuninitialized... yes
  62. checking if aarch64-none-linux-gnu-gcc supports-Wshadow... yes
  63. checking if aarch64-none-linux-gnu-gcc supports-Wcast-qual... yes
  64. checking if aarch64-none-linux-gnu-gcc supports-Wmissing-noreturn... yes
  65. checking if aarch64-none-linux-gnu-gcc supports-Wmissing-format-attribute... yes
  66. checking if aarch64-none-linux-gnu-gcc supports-Wredundant-decls... yes
  67. checking if aarch64-none-linux-gnu-gcc supports-Werror=implicit... yes
  68. checking if aarch64-none-linux-gnu-gcc supports-Werror=nonnull... yes
  69. checking if aarch64-none-linux-gnu-gcc supports-Werror=init-self... yes
  70. checking if aarch64-none-linux-gnu-gcc supports-Werror=main... yes
  71. checking if aarch64-none-linux-gnu-gcc supports-Werror=missing-braces... yes
  72. checking if aarch64-none-linux-gnu-gcc supports-Werror=sequence-point... yes
  73. checking if aarch64-none-linux-gnu-gcc supports-Werror=return-type... yes
  74. checking if aarch64-none-linux-gnu-gcc supports-Werror=trigraphs... yes
  75. checking if aarch64-none-linux-gnu-gcc supports-Werror=array-bounds... yes
  76. checking if aarch64-none-linux-gnu-gcc supports-Werror=write-strings... yes
  77. checking if aarch64-none-linux-gnu-gcc supports-Werror=address... yes
  78. checking if aarch64-none-linux-gnu-gcc supports-Werror=int-to-pointer-cast... yes
  79. checking if aarch64-none-linux-gnu-gcc supports-Werror=pointer-to-int-cast... yes
  80. checking if aarch64-none-linux-gnu-gcc supports-pedantic... yes
  81. checking if aarch64-none-linux-gnu-gcc supports-Werror... yes
  82. checking if aarch64-none-linux-gnu-gcc supports-Werror=attributes... yes
  83. checking whether to build functional specifications... yes
  84. checking for xmlto... no
  85. configure: WARNING: xmlto not found - documentation targets will be skipped
  86. checking for fop... no
  87. configure: WARNING: fop not found - documentation targets will be skipped
  88. checking for xsltproc... no
  89. configure: WARNING: xsltproc not found - cannot transform XML documents
  90. checking for X.Org SGML entities >= 1.8... /usr/share/sgml
  91. checking sys/select.h usability... yes
  92. checking sys/select.h presence... yes
  93. checking for sys/select.h... yes
  94. checking sys/param.h usability... yes
  95. checking sys/param.h presence... yes
  96. checking for sys/param.h... yes
  97. checking for sys/types.h... (cached) yes
  98. checking sys/time.h usability... yes
  99. checking sys/time.h presence... yes
  100. checking for sys/time.h... yes
  101. checking for fd_set.fds_bits... no
  102. checking for fd_set.__fds_bits... yes
  103. checking whether const prototypes are supported... yes
  104. checking whether varargs prototypes are supported... yes
  105. checking whether nested prototypes are supported... yes
  106. checking whether to force function prototypes... yes
  107. checking whether to widen function prototypes... no
  108. configure: creating ./config.status
  109. config.status: creating Makefile
  110. config.status: creating specs/Makefile
  111. config.status: creating specs/SIAddresses/Makefile
  112. config.status: creating Xpoll.h
  113. config.status: creating xproto.pc
  114. config.status: creating do-not-use-config.h
  115. config.status: creating Xfuncproto.h
  116. config.status: executing depfiles commands

make

make install

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ make
  2. make all-recursive
  3. make[1]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23
  4. Making all in specs
  5. make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  6. Making all in SIAddresses
  7. make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
  8. make[3]: 对“all”无需做任何事。
  9. make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
  10. make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  11. make[3]: 对“all-am”无需做任何事。
  12. make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  13. make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  14. make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23
  15. make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23
  16. make[1]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23
  17. huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ make install
  18. Making install in specs
  19. make[1]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  20. Making install in SIAddresses
  21. make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
  22. make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
  23. make[3]: 对“install-exec-am”无需做任何事。
  24. make[3]: 对“install-data-am”无需做任何事。
  25. make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
  26. make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
  27. make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  28. make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  29. make[3]: 对“install-exec-am”无需做任何事。
  30. test -z "/home/huhu/third_part/openGL/xproto-7.0.23/install/share/doc/xproto" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/xproto-7.0.23/install/share/doc/xproto"
  31. /usr/bin/install -c -m 644 x11protocol.xml encoding.xml glossary.xml keysyms.xml sect1-9.xml '/home/huhu/third_part/openGL/xproto-7.0.23/install/share/doc/xproto'
  32. test -z "/home/huhu/third_part/openGL/xproto-7.0.23/install/share/doc/xproto" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/xproto-7.0.23/install/share/doc/xproto"
  33. make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  34. make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  35. make[1]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
  36. make[1]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23
  37. make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23
  38. make[2]: 对“install-exec-am”无需做任何事。
  39. test -z "/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11"
  40. /usr/bin/install -c -m 644 Xfuncproto.h Xpoll.h '/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11'
  41. test -z "/home/huhu/third_part/openGL/xproto-7.0.23/install/lib/pkgconfig" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/xproto-7.0.23/install/lib/pkgconfig"
  42. /usr/bin/install -c -m 644 xproto.pc '/home/huhu/third_part/openGL/xproto-7.0.23/install/lib/pkgconfig'
  43. test -z "/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11"
  44. /usr/bin/install -c -m 644 ap_keysym.h DECkeysym.h HPkeysym.h keysymdef.h keysym.h Sunkeysym.h Xalloca.h Xarch.h Xatom.h Xdefs.h XF86keysym.h Xfuncs.h X.h Xmd.h Xosdefs.h Xos.h Xos_r.h Xproto.h Xprotostr.h Xthreads.h Xw32defs.h XWDFile.h Xwindows.h Xwinsock.h '/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11'
  45. make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23
  46. make[1]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23
  47. huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ cd install/
  48. huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23/install$ ls
  49. include lib share

可以看到install文件夹下就出现了编译好后的文件(接下来的libxua交叉编译时需要依赖如下的文件)

同时在~/.bashrc文件中添加如下的包路径

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/home/huhu/third_part/openGL/xproto-7.0.23/install/lib/pkgconfig"

source .bashrc


编译libXau

进入解压后的文件夹:/home/huhu/third_part/openGL/libXau-1.0.7

新建了一个build和install文件夹

./configure --prefix=/home/huhu/third_part/openGL/libXau-1.0.7/install CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ --host=arm-linux CPPFLAGS="-I/home/huhu/third_part/openGL/xproto-7.0.23/install/include" LDFLAGS="-L/home/huhu/third_part/openGL/xproto-7.0.23/install/lib"

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ ./configure --prefix=/home/huhu/third_part/openGL/libXau-1.0.7/install CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ --host=arm-linux CPPFLAGS="-I/home/huhu/third_part/openGL/xproto-7.0.23/install/include" LDFLAGS="-L/home/huhu/third_part/openGL/xproto-7.0.23/install/lib"
  2. configure: WARNING: if you wanted to set the --build type, don't use --host.
  3. If a cross compiler is detected then cross compile mode will be used
  4. checking for a BSD-compatible install... /usr/bin/install -c
  5. checking whether build environment is sane... yes
  6. checking for arm-linux-strip... no
  7. checking for strip... 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 to enable maintainer-specific portions of Makefiles... no
  13. checking build system type... x86_64-unknown-linux-gnu
  14. checking host system type... arm-unknown-linux-gnu
  15. checking how to print strings... printf
  16. checking for style of include used by make... GNU
  17. checking for arm-linux-gcc... aarch64-none-linux-gnu-gcc
  18. checking whether the C compiler works... yes
  19. checking for C compiler default output file name... a.out
  20. checking for suffix of executables...
  21. checking whether we are cross compiling... yes
  22. checking for suffix of object files... o
  23. checking whether we are using the GNU C compiler... yes
  24. checking whether aarch64-none-linux-gnu-gcc accepts -g... yes
  25. checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
  26. checking dependency style of aarch64-none-linux-gnu-gcc... gcc3
  27. checking for a sed that does not truncate output... /usr/bin/sed
  28. checking for grep that handles long lines and -e... /usr/bin/grep
  29. checking for egrep... /usr/bin/grep -E
  30. checking for fgrep... /usr/bin/grep -F
  31. checking for ld used by aarch64-none-linux-gnu-gcc... /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld
  32. checking if the linker (/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld) is GNU ld... yes
  33. checking for BSD- or MS-compatible name lister (nm)... no
  34. checking for arm-linux-dumpbin... no
  35. checking for arm-linux-link... no
  36. checking for dumpbin... no
  37. checking for link... link -dump
  38. configure: WARNING: using cross tools not prefixed with host triplet
  39. checking the name lister (nm) interface... BSD nm
  40. checking whether ln -s works... yes
  41. checking the maximum length of command line arguments... 1572864
  42. checking whether the shell understands some XSI constructs... yes
  43. checking whether the shell understands "+="... yes
  44. checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
  45. checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
  46. checking for /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld option to reload object files... -r
  47. checking for arm-linux-objdump... objdump
  48. checking how to recognize dependent libraries... pass_all
  49. checking for arm-linux-dlltool... dlltool
  50. checking how to associate runtime and link libraries... printf %s\n
  51. checking for arm-linux-ar... no
  52. checking for ar... ar
  53. checking for archiver @FILE support... @
  54. checking for arm-linux-strip... strip
  55. checking for arm-linux-ranlib... no
  56. checking for ranlib... ranlib
  57. checking command to parse nm output from aarch64-none-linux-gnu-gcc object... ok
  58. checking for sysroot... no
  59. checking for arm-linux-mt... no
  60. checking for mt... mt
  61. checking if mt is a manifest tool... no
  62. checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
  63. checking for ANSI C header files... yes
  64. checking for sys/types.h... yes
  65. checking for sys/stat.h... yes
  66. checking for stdlib.h... yes
  67. checking for string.h... yes
  68. checking for memory.h... yes
  69. checking for strings.h... yes
  70. checking for inttypes.h... yes
  71. checking for stdint.h... yes
  72. checking for unistd.h... yes
  73. checking for dlfcn.h... yes
  74. checking for objdir... .libs
  75. checking if aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
  76. checking for aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
  77. checking if aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
  78. checking if aarch64-none-linux-gnu-gcc static flag -static works... yes
  79. checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
  80. checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
  81. checking whether the aarch64-none-linux-gnu-gcc linker (/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld) supports shared libraries... yes
  82. checking whether -lc should be explicitly linked in... no
  83. checking dynamic linker characteristics... GNU/Linux ld.so
  84. checking how to hardcode library paths into programs... immediate
  85. checking whether stripping libraries is possible... yes
  86. checking if libtool supports shared libraries... yes
  87. checking whether to build shared libraries... yes
  88. checking whether to build static libraries... yes
  89. checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
  90. checking whether __clang__ is declared... no
  91. checking whether __INTEL_COMPILER is declared... no
  92. checking whether __SUNPRO_C is declared... no
  93. checking for arm-linux-pkg-config... no
  94. checking for pkg-config... /usr/bin/pkg-config
  95. checking pkg-config is at least version 0.9.0... yes
  96. checking if compiler supports -Werror=unknown-warning-option... no
  97. checking if compiler supports -Werror=unused-command-line-argument... no
  98. checking if aarch64-none-linux-gnu-gcc supports -Wall... yes
  99. checking if aarch64-none-linux-gnu-gcc supports -Wpointer-arith... yes
  100. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-declarations... yes
  101. checking if aarch64-none-linux-gnu-gcc supports -Wformat=2... yes
  102. checking if aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
  103. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
  104. checking if aarch64-none-linux-gnu-gcc supports -Wnested-externs... yes
  105. checking if aarch64-none-linux-gnu-gcc supports -Wbad-function-cast... yes
  106. checking if aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
  107. checking if aarch64-none-linux-gnu-gcc supports -Wdeclaration-after-statement... yes
  108. checking if aarch64-none-linux-gnu-gcc supports -Wunused... yes
  109. checking if aarch64-none-linux-gnu-gcc supports -Wuninitialized... yes
  110. checking if aarch64-none-linux-gnu-gcc supports -Wshadow... yes
  111. checking if aarch64-none-linux-gnu-gcc supports -Wcast-qual... yes
  112. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-noreturn... yes
  113. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
  114. checking if aarch64-none-linux-gnu-gcc supports -Wredundant-decls... yes
  115. checking if aarch64-none-linux-gnu-gcc supports -Werror=implicit... yes
  116. checking if aarch64-none-linux-gnu-gcc supports -Werror=nonnull... yes
  117. checking if aarch64-none-linux-gnu-gcc supports -Werror=init-self... yes
  118. checking if aarch64-none-linux-gnu-gcc supports -Werror=main... yes
  119. checking if aarch64-none-linux-gnu-gcc supports -Werror=missing-braces... yes
  120. checking if aarch64-none-linux-gnu-gcc supports -Werror=sequence-point... yes
  121. checking if aarch64-none-linux-gnu-gcc supports -Werror=return-type... yes
  122. checking if aarch64-none-linux-gnu-gcc supports -Werror=trigraphs... yes
  123. checking if aarch64-none-linux-gnu-gcc supports -Werror=array-bounds... yes
  124. checking if aarch64-none-linux-gnu-gcc supports -Werror=write-strings... yes
  125. checking if aarch64-none-linux-gnu-gcc supports -Werror=address... yes
  126. checking if aarch64-none-linux-gnu-gcc supports -Werror=int-to-pointer-cast... yes
  127. checking if aarch64-none-linux-gnu-gcc supports -Werror=pointer-to-int-cast... yes
  128. checking if aarch64-none-linux-gnu-gcc supports -pedantic... yes
  129. checking if aarch64-none-linux-gnu-gcc supports -Werror... yes
  130. checking if aarch64-none-linux-gnu-gcc supports -Werror=attributes... yes
  131. checking whether ln -s works... yes
  132. checking for XAU... yes
  133. checking for gethostbyname_r in -lc... yes
  134. configure: creating ./config.status
  135. config.status: creating Makefile
  136. config.status: creating man/Makefile
  137. config.status: creating xau.pc
  138. config.status: creating config.h
  139. config.status: executing depfiles commands
  140. config.status: executing libtool commands

make

make install

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ make
  2. make all-recursive
  3. make[1]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7
  4. Making all in man
  5. make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  6. GEN Xau.3
  7. GEN XauDisposeAuth.3
  8. GEN XauFileName.3
  9. GEN XauGetAuthByAddr.3
  10. GEN XauGetBestAuthByAddr.3
  11. GEN XauLockAuth.3
  12. GEN XauReadAuth.3
  13. GEN XauUnlockAuth.3
  14. GEN XauWriteAuth.3
  15. make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  16. make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7
  17. CC AuDispose.lo
  18. CC AuFileName.lo
  19. CC AuGetAddr.lo
  20. CC AuGetBest.lo
  21. CC AuLock.lo
  22. CC AuRead.lo
  23. CC AuUnlock.lo
  24. CC AuWrite.lo
  25. CCLD libXau.la
  26. ar: `u' modifier ignored since `D' is the default (see `U')
  27. make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7”
  28. make[1]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7”
  29. huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ make install
  30. Making install in man
  31. make[1]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  32. make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  33. make[2]: 对“install-exec-am”无需做任何事。
  34. test -z "/home/huhu/third_part/openGL/libXau-1.0.7/install/share/man/man3" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/libXau-1.0.7/install/share/man/man3"
  35. /usr/bin/install -c -m 644 Xau.3 XauDisposeAuth.3 XauFileName.3 XauGetAuthByAddr.3 XauGetBestAuthByAddr.3 XauLockAuth.3 XauReadAuth.3 XauUnlockAuth.3 XauWriteAuth.3 '/home/huhu/third_part/openGL/libXau-1.0.7/install/share/man/man3'
  36. make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  37. make[1]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  38. make[1]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7”
  39. make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7”
  40. test -z "/home/huhu/third_part/openGL/libXau-1.0.7/install/lib" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/libXau-1.0.7/install/lib"
  41. /bin/bash ./libtool --mode=install /usr/bin/install -c libXau.la '/home/huhu/third_part/openGL/libXau-1.0.7/install/lib'
  42. libtool: install: /usr/bin/install -c .libs/libXau.so.6.0.0 /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.so.6.0.0
  43. libtool: install: (cd /home/huhu/third_part/openGL/libXau-1.0.7/install/lib && { ln -s -f libXau.so.6.0.0 libXau.so.6 || { rm -f libXau.so.6 && ln -s libXau.so.6.0.0 libXau.so.6; }; })
  44. libtool: install: (cd /home/huhu/third_part/openGL/libXau-1.0.7/install/lib && { ln -s -f libXau.so.6.0.0 libXau.so || { rm -f libXau.so && ln -s libXau.so.6.0.0 libXau.so; }; })
  45. libtool: install: /usr/bin/install -c .libs/libXau.lai /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.la
  46. libtool: install: /usr/bin/install -c .libs/libXau.a /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.a
  47. libtool: install: chmod 644 /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.a
  48. libtool: install: ranlib /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.a
  49. libtool: finish: PATH="/opt/ros/noetic/bin:/home/huhu/third_part/qt5.14/5.14.1/gcc_64:/home/huhu/third_part/qt5.14/Tools/QtCreator/bin:/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/huhu/third_part/openGL/libXau-1.0.7/install/lib
  50. ----------------------------------------------------------------------
  51. Libraries have been installed in:
  52. /home/huhu/third_part/openGL/libXau-1.0.7/install/lib
  53. If you ever happen to want to link against installed libraries
  54. in a given directory, LIBDIR, you must either use libtool, and
  55. specify the full pathname of the library, or use the `-LLIBDIR'
  56. flag during linking and do at least one of the following:
  57. - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
  58. during execution
  59. - add LIBDIR to the `LD_RUN_PATH' environment variable
  60. during linking
  61. - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
  62. - have your system administrator add LIBDIR to `/etc/ld.so.conf'
  63. See any operating system documentation about shared libraries for
  64. more information, such as the ld(1) and ld.so(8) manual pages.
  65. ----------------------------------------------------------------------
  66. test -z "" || /usr/bin/mkdir -p ""
  67. test -z "/home/huhu/third_part/openGL/libXau-1.0.7/install/lib/pkgconfig" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/libXau-1.0.7/install/lib/pkgconfig"
  68. /usr/bin/install -c -m 644 xau.pc '/home/huhu/third_part/openGL/libXau-1.0.7/install/lib/pkgconfig'
  69. test -z "/home/huhu/third_part/openGL/libXau-1.0.7/install/include/X11" || /usr/bin/mkdir -p "/home/huhu/third_part/openGL/libXau-1.0.7/install/include/X11"
  70. /usr/bin/install -c -m 644 include/X11/Xauth.h '/home/huhu/third_part/openGL/libXau-1.0.7/install/include/X11'
  71. make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7
  72. make[1]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7

可以看到install文件夹下就出现了编译好后的文件(接下来的交叉编译libxcb需要依赖其)

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ cd install/
  2. huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7/install$ ls
  3. include lib share

如上一样,需要把此包路径添加到~/.bashrc中

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/home/huhu/third_part/openGL/libXau-1.0.7/install/lib/pkgconfig"

source .bashrc 


 编译libpciaccess

进入解压后的文件夹:/home/huhu/third_part/openGL/libpciaccess-0.16/

新建了一个build和install文件夹

./configure --prefix=/home/huhu/third_part/openGL/libpciaccess-0.16/install CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ --host=arm-linux

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ ./configure --prefix=/home/huhu/third_part/openGL/libpciaccess-0.16/install CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ --host=arm-linux
  2. checking for a BSD-compatible install... /usr/bin/install -c
  3. checking whether build environment is sane... yes
  4. checking for arm-linux-strip... no
  5. checking for strip... strip
  6. checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
  7. checking for gawk... no
  8. checking for mawk... mawk
  9. checking whether make sets $(MAKE)... yes
  10. checking whether make supports nested variables... yes
  11. checking whether make supports the include directive... yes (GNU style)
  12. checking for arm-linux-gcc... aarch64-none-linux-gnu-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 aarch64-none-linux-gnu-gcc accepts -g... yes
  20. checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
  21. checking whether aarch64-none-linux-gnu-gcc understands -c and -o together... yes
  22. checking dependency style of aarch64-none-linux-gnu-gcc... gcc3
  23. checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
  24. checking for grep that handles long lines and -e... /usr/bin/grep
  25. checking for egrep... /usr/bin/grep -E
  26. checking for ANSI C header files... yes
  27. checking for sys/types.h... yes
  28. checking for sys/stat.h... yes
  29. checking for stdlib.h... yes
  30. checking for string.h... yes
  31. checking for memory.h... yes
  32. checking for strings.h... yes
  33. checking for inttypes.h... yes
  34. checking for stdint.h... yes
  35. checking for unistd.h... yes
  36. checking minix/config.h usability... no
  37. checking minix/config.h presence... no
  38. checking for minix/config.h... no
  39. checking whether it is safe to define __EXTENSIONS__... yes
  40. checking build system type... x86_64-pc-linux-gnu
  41. checking host system type... arm-unknown-linux-gnu
  42. checking how to print strings... printf
  43. checking for a sed that does not truncate output... /usr/bin/sed
  44. checking for fgrep... /usr/bin/grep -F
  45. checking for ld used by aarch64-none-linux-gnu-gcc... /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld
  46. checking if the linker (/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld) is GNU ld... yes
  47. checking for BSD- or MS-compatible name lister (nm)... no
  48. checking for arm-linux-dumpbin... no
  49. checking for arm-linux-link... no
  50. checking for dumpbin... no
  51. checking for link... link -dump
  52. configure: WARNING: using cross tools not prefixed with host triplet
  53. checking the name lister (nm) interface... BSD nm
  54. checking whether ln -s works... yes
  55. checking the maximum length of command line arguments... 1572864
  56. checking how to convert x86_64-pc-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
  57. checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
  58. checking for /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld option to reload object files... -r
  59. checking for arm-linux-objdump... no
  60. checking for objdump... objdump
  61. checking how to recognize dependent libraries... pass_all
  62. checking for arm-linux-dlltool... no
  63. checking for dlltool... no
  64. checking how to associate runtime and link libraries... printf %s\n
  65. checking for arm-linux-ar... no
  66. checking for ar... ar
  67. checking for archiver @FILE support... @
  68. checking for arm-linux-strip... strip
  69. checking for arm-linux-ranlib... no
  70. checking for ranlib... ranlib
  71. checking command to parse nm output from aarch64-none-linux-gnu-gcc object... ok
  72. checking for sysroot... no
  73. checking for a working dd... /usr/bin/dd
  74. checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
  75. checking for arm-linux-mt... no
  76. checking for mt... mt
  77. checking if mt is a manifest tool... no
  78. checking for dlfcn.h... yes
  79. checking for objdir... .libs
  80. checking if aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
  81. checking for aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
  82. checking if aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
  83. checking if aarch64-none-linux-gnu-gcc static flag -static works... yes
  84. checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
  85. checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
  86. checking whether the aarch64-none-linux-gnu-gcc linker (/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld) supports shared libraries... yes
  87. checking whether -lc should be explicitly linked in... no
  88. checking dynamic linker characteristics... GNU/Linux ld.so
  89. checking how to hardcode library paths into programs... immediate
  90. checking whether stripping libraries is possible... yes
  91. checking if libtool supports shared libraries... yes
  92. checking whether to build shared libraries... yes
  93. checking whether to build static libraries... yes
  94. checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
  95. checking whether __clang__ is declared... no
  96. checking whether __INTEL_COMPILER is declared... no
  97. checking whether __SUNPRO_C is declared... no
  98. checking for arm-linux-pkg-config... no
  99. checking for pkg-config... /usr/bin/pkg-config
  100. checking pkg-config is at least version 0.9.0... yes
  101. checking if aarch64-none-linux-gnu-gcc supports -Werror=unknown-warning-option... no
  102. checking if aarch64-none-linux-gnu-gcc supports -Werror=unused-command-line-argument... no
  103. checking if aarch64-none-linux-gnu-gcc supports -Wall... yes
  104. checking if aarch64-none-linux-gnu-gcc supports -Wpointer-arith... yes
  105. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-declarations... yes
  106. checking if aarch64-none-linux-gnu-gcc supports -Wformat=2... yes
  107. checking if aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
  108. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
  109. checking if aarch64-none-linux-gnu-gcc supports -Wnested-externs... yes
  110. checking if aarch64-none-linux-gnu-gcc supports -Wbad-function-cast... yes
  111. checking if aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
  112. checking if aarch64-none-linux-gnu-gcc supports -Wdeclaration-after-statement... yes
  113. checking if aarch64-none-linux-gnu-gcc supports -Wunused... yes
  114. checking if aarch64-none-linux-gnu-gcc supports -Wuninitialized... yes
  115. checking if aarch64-none-linux-gnu-gcc supports -Wshadow... yes
  116. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-noreturn... yes
  117. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
  118. checking if aarch64-none-linux-gnu-gcc supports -Wredundant-decls... yes
  119. checking if aarch64-none-linux-gnu-gcc supports -Wlogical-op... yes
  120. checking if aarch64-none-linux-gnu-gcc supports -Werror=implicit... yes
  121. checking if aarch64-none-linux-gnu-gcc supports -Werror=nonnull... yes
  122. checking if aarch64-none-linux-gnu-gcc supports -Werror=init-self... yes
  123. checking if aarch64-none-linux-gnu-gcc supports -Werror=main... yes
  124. checking if aarch64-none-linux-gnu-gcc supports -Werror=missing-braces... yes
  125. checking if aarch64-none-linux-gnu-gcc supports -Werror=sequence-point... yes
  126. checking if aarch64-none-linux-gnu-gcc supports -Werror=return-type... yes
  127. checking if aarch64-none-linux-gnu-gcc supports -Werror=trigraphs... yes
  128. checking if aarch64-none-linux-gnu-gcc supports -Werror=array-bounds... yes
  129. checking if aarch64-none-linux-gnu-gcc supports -Werror=write-strings... yes
  130. checking if aarch64-none-linux-gnu-gcc supports -Werror=address... yes
  131. checking if aarch64-none-linux-gnu-gcc supports -Werror=int-to-pointer-cast... yes
  132. checking if aarch64-none-linux-gnu-gcc supports -Werror=pointer-to-int-cast... yes
  133. checking if aarch64-none-linux-gnu-gcc supports -pedantic... yes
  134. checking if aarch64-none-linux-gnu-gcc supports -Werror... yes
  135. checking if aarch64-none-linux-gnu-gcc supports -Werror=attributes... yes
  136. checking whether make supports nested variables... (cached) yes
  137. checking for special C compiler options needed for large files... no
  138. checking for _FILE_OFFSET_BITS value needed for large files... no
  139. checking err.h usability... yes
  140. checking err.h presence... yes
  141. checking for err.h... yes
  142. checking asm/mtrr.h usability... no
  143. checking asm/mtrr.h presence... no
  144. checking for asm/mtrr.h... no
  145. checking that generated files are newer than configure... done
  146. configure: creating ./config.status
  147. config.status: creating Makefile
  148. config.status: creating include/Makefile
  149. config.status: creating man/Makefile
  150. config.status: creating src/Makefile
  151. config.status: creating scanpci/Makefile
  152. config.status: creating pciaccess.pc
  153. config.status: creating config.h
  154. config.status: executing depfiles commands
  155. config.status: executing libtool commands

make

make install

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ make
  2. make all-recursive
  3. make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16
  4. Making all in include
  5. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
  6. make[2]: 对“all”无需做任何事。
  7. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
  8. Making all in man
  9. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  10. GEN scanpci.1
  11. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  12. Making all in src
  13. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  14. CC common_bridge.lo
  15. CC common_iterator.lo
  16. CC common_init.lo
  17. common_init.c: 在函数‘pci_system_cleanup’中:
  18. common_init.c:110:3: 警告: ‘pci_device_unmap_region’ is deprecated [-Wdeprecated-declarations]
  19. 110 | (void) pci_device_unmap_region( & pci_sys->devices[i].base, j );
  20. | ^
  21. In file included from common_init.c:38:
  22. ../include/pciaccess.h:88:18: 附注: 在此声明
  23. 88 | int __deprecated pci_device_unmap_region(struct pci_device *dev,
  24. | ^~~~~~~~~~~~~~~~~~~~~~~
  25. CC common_interface.lo
  26. CC common_io.lo
  27. CC common_capability.lo
  28. CC common_device_name.lo
  29. CC common_map.lo
  30. CC common_vgaarb.lo
  31. CC linux_sysfs.lo
  32. linux_sysfs.c: 在函数‘pci_device_linux_sysfs_map_range’中:
  33. linux_sysfs.c:607:9: 警告: 未使用的变量‘err’ [-Wunused-variable]
  34. 607 | int err = 0;
  35. | ^~~
  36. CC linux_devmem.lo
  37. CCLD libpciaccess.la
  38. ar: `u' modifier ignored since `D' is the default (see `U')
  39. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  40. Making all in scanpci
  41. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  42. CC scanpci.o
  43. CCLD scanpci
  44. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  45. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
  46. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
  47. make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
  48. huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ make install
  49. Making install in include
  50. make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
  51. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
  52. make[2]: 对“install-exec-am”无需做任何事。
  53. /usr/bin/mkdir -p '/home/huhu/third_part/openGL/libpciaccess-0.16/install/include'
  54. /usr/bin/install -c -m 644 pciaccess.h '/home/huhu/third_part/openGL/libpciaccess-0.16/install/include'
  55. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
  56. make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
  57. Making install in man
  58. make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  59. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  60. make[2]: 对“install-exec-am”无需做任何事。
  61. make[2]: 对“install-data-am”无需做任何事。
  62. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  63. make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  64. Making install in src
  65. make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  66. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  67. /usr/bin/mkdir -p '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib'
  68. /bin/bash ../libtool --mode=install /usr/bin/install -c libpciaccess.la '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib'
  69. libtool: install: /usr/bin/install -c .libs/libpciaccess.so.0.11.1 /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.so.0.11.1
  70. libtool: install: (cd /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib && { ln -s -f libpciaccess.so.0.11.1 libpciaccess.so.0 || { rm -f libpciaccess.so.0 && ln -s libpciaccess.so.0.11.1 libpciaccess.so.0; }; })
  71. libtool: install: (cd /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib && { ln -s -f libpciaccess.so.0.11.1 libpciaccess.so || { rm -f libpciaccess.so && ln -s libpciaccess.so.0.11.1 libpciaccess.so; }; })
  72. libtool: install: /usr/bin/install -c .libs/libpciaccess.lai /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.la
  73. libtool: install: /usr/bin/install -c .libs/libpciaccess.a /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.a
  74. libtool: install: chmod 644 /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.a
  75. libtool: install: ranlib /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.a
  76. libtool: finish: PATH="/opt/ros/noetic/bin:/home/huhu/third_part/qt5.14/5.14.1/gcc_64:/home/huhu/third_part/qt5.14/Tools/QtCreator/bin:/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib
  77. ----------------------------------------------------------------------
  78. Libraries have been installed in:
  79. /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib
  80. If you ever happen to want to link against installed libraries
  81. in a given directory, LIBDIR, you must either use libtool, and
  82. specify the full pathname of the library, or use the '-LLIBDIR'
  83. flag during linking and do at least one of the following:
  84. - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
  85. during execution
  86. - add LIBDIR to the 'LD_RUN_PATH' environment variable
  87. during linking
  88. - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
  89. - have your system administrator add LIBDIR to '/etc/ld.so.conf'
  90. See any operating system documentation about shared libraries for
  91. more information, such as the ld(1) and ld.so(8) manual pages.
  92. ----------------------------------------------------------------------
  93. make[2]: 对“install-data-am”无需做任何事。
  94. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  95. make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  96. Making install in scanpci
  97. make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  98. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  99. make[2]: 对“install-exec-am”无需做任何事。
  100. make[2]: 对“install-data-am”无需做任何事。
  101. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  102. make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  103. make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
  104. make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
  105. make[2]: 对“install-exec-am”无需做任何事。
  106. /usr/bin/mkdir -p '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/pkgconfig'
  107. /usr/bin/install -c -m 644 pciaccess.pc '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/pkgconfig'
  108. make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
  109. make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”

可以看到install文件夹下就出现了编译好后的文件(后面交叉编译libdrm-2.4.100时需要依赖它们)

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ cd install/
  2. huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16/install$ ls
  3. include lib

如上一样,需要把此包路径添加到~/.bashrc中

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/pkgconfig"

source .bashrc  


编译libdrm

进入解压后的文件夹:/home/huhu/third_part/openGL/libdrm-2.4.100/

新建了一个build和install文件夹

./configure --prefix=/home/huhu/third_part/openGL/libdrm-2.4.100/install CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ CPPFLAGS="-I/home/huhu/third_part/openGL/libpciaccess-0.16/install/include" LDFLAGS="-L/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib" --disable-cairo-tests --enable-intel --host=arm-linux

  1. huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ ./configure --prefix=/home/huhu/third_part/openGL/libpciaccess-0.16/install CC=aarch64-none-linux-gnu-gcc CXX=aarch64-none-linux-gnu-g++ --host=arm-linux
  2. checking for a BSD-compatible install... /usr/bin/install -c
  3. checking whether build environment is sane... yes
  4. checking for arm-linux-strip... no
  5. checking for strip... strip
  6. checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
  7. checking for gawk... no
  8. checking for mawk... mawk
  9. checking whether make sets $(MAKE)... yes
  10. checking whether make supports nested variables... yes
  11. checking whether make supports the include directive... yes (GNU style)
  12. checking for arm-linux-gcc... aarch64-none-linux-gnu-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 aarch64-none-linux-gnu-gcc accepts -g... yes
  20. checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
  21. checking whether aarch64-none-linux-gnu-gcc understands -c and -o together... yes
  22. checking dependency style of aarch64-none-linux-gnu-gcc... gcc3
  23. checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
  24. checking for grep that handles long lines and -e... /usr/bin/grep
  25. checking for egrep... /usr/bin/grep -E
  26. checking for ANSI C header files... yes
  27. checking for sys/types.h... yes
  28. checking for sys/stat.h... yes
  29. checking for stdlib.h... yes
  30. checking for string.h... yes
  31. checking for memory.h... yes
  32. checking for strings.h... yes
  33. checking for inttypes.h... yes
  34. checking for stdint.h... yes
  35. checking for unistd.h... yes
  36. checking minix/config.h usability... no
  37. checking minix/config.h presence... no
  38. checking for minix/config.h... no
  39. checking whether it is safe to define __EXTENSIONS__... yes
  40. checking build system type... x86_64-pc-linux-gnu
  41. checking host system type... arm-unknown-linux-gnu
  42. checking how to print strings... printf
  43. checking for a sed that does not truncate output... /usr/bin/sed
  44. checking for fgrep... /usr/bin/grep -F
  45. checking for ld used by aarch64-none-linux-gnu-gcc... /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld
  46. checking if the linker (/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld) is GNU ld... yes
  47. checking for BSD- or MS-compatible name lister (nm)... no
  48. checking for arm-linux-dumpbin... no
  49. checking for arm-linux-link... no
  50. checking for dumpbin... no
  51. checking for link... link -dump
  52. configure: WARNING: using cross tools not prefixed with host triplet
  53. checking the name lister (nm) interface... BSD nm
  54. checking whether ln -s works... yes
  55. checking the maximum length of command line arguments... 1572864
  56. checking how to convert x86_64-pc-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
  57. checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
  58. checking for /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld option to reload object files... -r
  59. checking for arm-linux-objdump... no
  60. checking for objdump... objdump
  61. checking how to recognize dependent libraries... pass_all
  62. checking for arm-linux-dlltool... no
  63. checking for dlltool... no
  64. checking how to associate runtime and link libraries... printf %s\n
  65. checking for arm-linux-ar... no
  66. checking for ar... ar
  67. checking for archiver @FILE support... @
  68. checking for arm-linux-strip... strip
  69. checking for arm-linux-ranlib... no
  70. checking for ranlib... ranlib
  71. checking command to parse nm output from aarch64-none-linux-gnu-gcc object... ok
  72. checking for sysroot... no
  73. checking for a working dd... /usr/bin/dd
  74. checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
  75. checking for arm-linux-mt... no
  76. checking for mt... mt
  77. checking if mt is a manifest tool... no
  78. checking for dlfcn.h... yes
  79. checking for objdir... .libs
  80. checking if aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
  81. checking for aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
  82. checking if aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
  83. checking if aarch64-none-linux-gnu-gcc static flag -static works... yes
  84. checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
  85. checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
  86. checking whether the aarch64-none-linux-gnu-gcc linker (/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld) supports shared libraries... yes
  87. checking whether -lc should be explicitly linked in... no
  88. checking dynamic linker characteristics... GNU/Linux ld.so
  89. checking how to hardcode library paths into programs... immediate
  90. checking whether stripping libraries is possible... yes
  91. checking if libtool supports shared libraries... yes
  92. checking whether to build shared libraries... yes
  93. checking whether to build static libraries... yes
  94. checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
  95. checking whether __clang__ is declared... no
  96. checking whether __INTEL_COMPILER is declared... no
  97. checking whether __SUNPRO_C is declared... no
  98. checking for arm-linux-pkg-config... no
  99. checking for pkg-config... /usr/bin/pkg-config
  100. checking pkg-config is at least version 0.9.0... yes
  101. checking if aarch64-none-linux-gnu-gcc supports -Werror=unknown-warning-option... no
  102. checking if aarch64-none-linux-gnu-gcc supports -Werror=unused-command-line-argument... no
  103. checking if aarch64-none-linux-gnu-gcc supports -Wall... yes
  104. checking if aarch64-none-linux-gnu-gcc supports -Wpointer-arith... yes
  105. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-declarations... yes
  106. checking if aarch64-none-linux-gnu-gcc supports -Wformat=2... yes
  107. checking if aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
  108. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
  109. checking if aarch64-none-linux-gnu-gcc supports -Wnested-externs... yes
  110. checking if aarch64-none-linux-gnu-gcc supports -Wbad-function-cast... yes
  111. checking if aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
  112. checking if aarch64-none-linux-gnu-gcc supports -Wdeclaration-after-statement... yes
  113. checking if aarch64-none-linux-gnu-gcc supports -Wunused... yes
  114. checking if aarch64-none-linux-gnu-gcc supports -Wuninitialized... yes
  115. checking if aarch64-none-linux-gnu-gcc supports -Wshadow... yes
  116. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-noreturn... yes
  117. checking if aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
  118. checking if aarch64-none-linux-gnu-gcc supports -Wredundant-decls... yes
  119. checking if aarch64-none-linux-gnu-gcc supports -Wlogical-op... yes
  120. checking if aarch64-none-linux-gnu-gcc supports -Werror=implicit... yes
  121. checking if aarch64-none-linux-gnu-gcc supports -Werror=nonnull... yes
  122. checking if aarch64-none-linux-gnu-gcc supports -Werror=init-self... yes
  123. checking if aarch64-none-linux-gnu-gcc supports -Werror=main... yes
  124. checking if aarch64-none-linux-gnu-gcc supports -Werror=missing-braces... yes
  125. checking if aarch64-none-linux-gnu-gcc supports -Werror=sequence-point... yes
  126. checking if aarch64-none-linux-gnu-gcc supports -Werror=return-type... yes
  127. checking if aarch64-none-linux-gnu-gcc supports -Werror=trigraphs... yes
  128. checking if aarch64-none-linux-gnu-gcc supports -Werror=array-bounds... yes
  129. checking if aarch64-none-linux-gnu-gcc supports -Werror=write-strings... yes
  130. checking if aarch64-none-linux-gnu-gcc supports -Werror=address... yes
  131. checking if aarch64-none-linux-gnu-gcc supports -Werror=int-to-pointer-cast... yes
  132. checking if aarch64-none-linux-gnu-gcc supports -Werror=pointer-to-int-cast... yes
  133. checking if aarch64-none-linux-gnu-gcc supports -pedantic... yes
  134. checking if aarch64-none-linux-gnu-gcc supports -Werror... yes
  135. checking if aarch64-none-linux-gnu-gcc supports -Werror=attributes... yes
  136. checking whether make supports nested variables... (cached) yes
  137. checking for special C compiler options needed for large files... no
  138. checking for _FILE_OFFSET_BITS value needed for large files... no
  139. checking err.h usability... yes
  140. checking err.h presence... yes
  141. checking for err.h... yes
  142. checking asm/mtrr.h usability... no
  143. checking asm/mtrr.h presence... no
  144. checking for asm/mtrr.h... no
  145. checking that generated files are newer than configure... done
  146. configure: creating ./config.status
  147. config.status: creating Makefile
  148. config.status: creating include/Makefile
  149. config.status: creating man/Makefile
  150. config.status: creating src/Makefile
  151. config.status: creating scanpci/Makefile
  152. config.status: creating pciaccess.pc
  153. config.status: creating config.h
  154. config.status: executing depfiles commands
  155. config.status: executing libtool commands

make

报错:

  1. make
  2. make -s all-recursive
  3. Making all in .
  4. CC libdrm_la-xf86drm.lo
  5. xf86drm.c: 在函数‘drmAddMap’中:
  6. xf86drm.c:1093:17: 警告: implicit conversion from ‘drmMapType’ to ‘enum drm_map_type’ [-Wenum-conversion]
  7. 1093 | map.type = type;
  8. | ^
  9. xf86drm.c:1094:17: 警告: implicit conversion from ‘drmMapFlags’ to ‘enum drm_map_flags’ [-Wenum-conversion]
  10. 1094 | map.flags = flags;
  11. | ^
  12. xf86drm.c: 在函数‘drmAddBufs’中:
  13. xf86drm.c:1138:23: 警告: implicit conversion from ‘drmBufDescFlags’ to ‘enum <匿名>’ [-Wenum-conversion]
  14. 1138 | request.flags = flags;
  15. | ^
  16. xf86drm.c: 在函数‘drmDMA’中:
  17. xf86drm.c:1417:25: 警告: implicit conversion from ‘drmDMAFlags’ to ‘enum drm_dma_flags’ [-Wenum-conversion]
  18. 1417 | dma.flags = request->flags;
  19. | ^
  20. xf86drm.c: 在函数‘drmGetMap’中:
  21. xf86drm.c:2354:13: 警告: implicit conversion from ‘enum drm_map_typeto ‘drmMapType’ [-Wenum-conversion]
  22. 2354 | *type = map.type;
  23. | ^
  24. xf86drm.c:2355:13: 警告: implicit conversion from ‘enum drm_map_flags’ to ‘drmMapFlags’ [-Wenum-conversion]
  25. 2355 | *flags = map.flags;
  26. | ^
  27. xf86drm.c: 在函数‘parse_separate_sysfs_files’中:
  28. xf86drm.c:3154:37: 警告: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4096 [-Wformat-truncation=]
  29. 3154 | snprintf(path, PATH_MAX, "%s/%s", pci_path, attrs[i]);
  30. | ^
  31. xf86drm.c:3154:9: 附注: ‘snprintf’ output 2 or more bytes (assuming 4098) into a destination of size 4096
  32. 3154 | snprintf(path, PATH_MAX, "%s/%s", pci_path, attrs[i]);
  33. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. xf86drm.c: 在函数‘process_device’中:
  35. xf86drm.c:3184:33: 警告: ‘/config’ directive output may be truncated writing 7 bytes into a region of size between 0 and 4096 [-Wformat-truncation=]
  36. 3184 | snprintf(path, PATH_MAX, "%s/config", pci_path);
  37. | ^~~~~~~
  38. xf86drm.c:3184:5: 附注: ‘snprintf’ output between 8 and 4104 bytes into a destination of size 4096
  39. 3184 | snprintf(path, PATH_MAX, "%s/config", pci_path);
  40. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. In file included from xf86drm.c:69:
  42. xf86drm.c: 在函数‘drmGetMinorNameForFD’中:
  43. xf86drm.h:85:23: 警告: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 55 [-Wformat-truncation=]
  44. 85 | #define DRM_DIR_NAME "/dev/dri"
  45. | ^~~~~~~~~~
  46. xf86drm.c:2873:50: 附注: in expansion of macro ‘DRM_DIR_NAME’
  47. 2873 | snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
  48. | ^~~~~~~~~~~~
  49. xf86drm.c:2873:65: 附注: format string is defined here
  50. 2873 | snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
  51. | ^~
  52. xf86drm.c:2873:13: 附注: ‘snprintf’ output between 10 and 265 bytes into a destination of size 64
  53. 2873 | snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
  54. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. 2874 | ent->d_name);
  56. | ~~~~~~~~~~~~
  57. CC libdrm_la-xf86drmHash.lo
  58. CC libdrm_la-xf86drmRandom.lo
  59. CC libdrm_la-xf86drmSL.lo
  60. CC libdrm_la-xf86drmMode.lo
  61. CCLD libdrm.la
  62. Making all in libkms
  63. CC linux.lo
  64. CC dumb.lo
  65. CC api.lo
  66. CC vmwgfx.lo
  67. CC intel.lo
  68. CC nouveau.lo
  69. CC radeon.lo
  70. CCLD libkms.la
  71. Making all in intel
  72. CC intel_bufmgr.lo
  73. CC intel_bufmgr_fake.lo
  74. CC intel_bufmgr_gem.lo
  75. CC intel_decode.lo
  76. CC intel_chipset.lo
  77. CC mm.lo
  78. CCLD libdrm_intel.la
  79. CC test_decode.o
  80. test_decode.c: 在函数‘compare_batch’中:
  81. test_decode.c:109:32: 警告: 提领类型双关的指针可能破坏强重叠规则 [-Wstrict-aliasing]
  82. 109 | out = open_memstream((char **)&ptr, &size);
  83. | ^~~~
  84. CCLD test_decode
  85. Making all in nouveau
  86. CC nouveau.lo
  87. CC pushbuf.lo
  88. CC bufctx.lo
  89. CC abi16.lo
  90. CCLD libdrm_nouveau.la
  91. /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/../../../../aarch64-none-linux-gnu/bin/ld: .libs/pushbuf.o:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: multiple definition of `nouveau_debug'; .libs/nouveau.o:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: first defined here
  92. /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/../../../../aarch64-none-linux-gnu/bin/ld: .libs/bufctx.o:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: multiple definition of `nouveau_debug'; .libs/nouveau.o:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: first defined here
  93. /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/../../../../aarch64-none-linux-gnu/bin/ld: .libs/abi16.o:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: multiple definition of `nouveau_debug'; .libs/nouveau.o:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: first defined here
  94. collect2: error: ld returned 1 exit status
  95. make[2]: *** [Makefile:657:libdrm_nouveau.la] 错误 1
  96. make[1]: *** [Makefile:859:all-recursive] 错误 1
  97. make: *** [Makefile:618:all] 错误 2

问题:变量重复定义:/home/huhu/third_part/openGL/libdrm-2.4.100/nouveau/private.h:13: multiple definition of `nouveau_debug',找到文件中变量定义的位置,发现是debug内部定义的变量,怀疑多个debug内部调试的变量冲突。

<

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/282989
推荐阅读
  

闽ICP备14008679号