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

编译器安装参考: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

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 
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux -strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for arm-linux -gcc... aarch64-none-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether aarch64-none-linux-gnu-gcc accepts -g... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
checking dependency style of aarch64-none-linux-gnu-gcc... none
checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether __clang__ is declared... no
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking for arm-linux -pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-gnu 
checking for a sed that does not truncate output... /usr/bin/sed
checking if aarch64-none-linux-gnu-gcc supports -Werror=unknown-warning-option... no
checking if aarch64-none-linux-gnu-gcc supports -Werror=unused-command-line-argument... no
checking if aarch64-none-linux-gnu-gcc supports-Wall... yes
checking if aarch64-none-linux-gnu-gcc supports-Wpointer-arith... yes
checking if aarch64-none-linux-gnu-gcc supports-Wmissing-declarations... yes
checking if aarch64-none-linux-gnu-gcc supports-Wformat=2... yes
checking if aarch64-none-linux-gnu-gcc supports-Wstrict-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports-Wmissing-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports-Wnested-externs... yes
checking if aarch64-none-linux-gnu-gcc supports-Wbad-function-cast... yes
checking if aarch64-none-linux-gnu-gcc supports-Wold-style-definition... yes
checking if aarch64-none-linux-gnu-gcc supports-Wdeclaration-after-statement... yes
checking if aarch64-none-linux-gnu-gcc supports-Wunused... yes
checking if aarch64-none-linux-gnu-gcc supports-Wuninitialized... yes
checking if aarch64-none-linux-gnu-gcc supports-Wshadow... yes
checking if aarch64-none-linux-gnu-gcc supports-Wcast-qual... yes
checking if aarch64-none-linux-gnu-gcc supports-Wmissing-noreturn... yes
checking if aarch64-none-linux-gnu-gcc supports-Wmissing-format-attribute... yes
checking if aarch64-none-linux-gnu-gcc supports-Wredundant-decls... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=implicit... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=nonnull... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=init-self... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=main... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=missing-braces... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=sequence-point... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=return-type... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=trigraphs... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=array-bounds... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=write-strings... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=address... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=int-to-pointer-cast... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=pointer-to-int-cast... yes
checking if aarch64-none-linux-gnu-gcc supports-pedantic... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror... yes
checking if aarch64-none-linux-gnu-gcc supports-Werror=attributes... yes
checking whether to build functional specifications... yes
checking for xmlto... no
configure: WARNING: xmlto not found - documentation targets will be skipped
checking for fop... no
configure: WARNING: fop not found - documentation targets will be skipped
checking for xsltproc... no
configure: WARNING: xsltproc not found - cannot transform XML documents
checking for X.Org SGML entities >= 1.8... /usr/share/sgml
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/types.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for fd_set.fds_bits... no
checking for fd_set.__fds_bits... yes
checking whether const prototypes are supported... yes
checking whether varargs prototypes are supported... yes
checking whether nested prototypes are supported... yes
checking whether to force function prototypes... yes
checking whether to widen function prototypes... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating specs/Makefile
config.status: creating specs/SIAddresses/Makefile
config.status: creating Xpoll.h
config.status: creating xproto.pc
config.status: creating do-not-use-config.h
config.status: creating Xfuncproto.h
config.status: executing depfiles commands

make

make install

huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ make
make  all-recursive
make[1]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23”
Making all in specs
make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
Making all in SIAddresses
make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
make[3]: 对“all”无需做任何事。
make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[3]: 对“all-am”无需做任何事。
make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23”
make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23”
make[1]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23”
huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ make install
Making install in specs
make[1]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
Making install in SIAddresses
make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
make[3]: 对“install-exec-am”无需做任何事。
make[3]: 对“install-data-am”无需做任何事。
make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs/SIAddresses”
make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[3]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[3]: 对“install-exec-am”无需做任何事。
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"
 /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'
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"
make[3]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[1]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23/specs”
make[1]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23”
make[2]: 进入目录“/home/huhu/third_part/openGL/xproto-7.0.23”
make[2]: 对“install-exec-am”无需做任何事。
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"
 /usr/bin/install -c -m 644 Xfuncproto.h Xpoll.h '/home/huhu/third_part/openGL/xproto-7.0.23/install/include/X11'
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"
 /usr/bin/install -c -m 644 xproto.pc '/home/huhu/third_part/openGL/xproto-7.0.23/install/lib/pkgconfig'
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"
 /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'
make[2]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23”
make[1]: 离开目录“/home/huhu/third_part/openGL/xproto-7.0.23”
huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23$ cd install/
huhu@huhu-System-Product-Name:~/third_part/openGL/xproto-7.0.23/install$ ls
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"

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"
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for arm-linux-gcc... aarch64-none-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether aarch64-none-linux-gnu-gcc accepts -g... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
checking dependency style of aarch64-none-linux-gnu-gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by aarch64-none-linux-gnu-gcc... /opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/bin/ld
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
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-linux-dumpbin... no
checking for arm-linux-link... no
checking for dumpbin... no
checking for link... link -dump
configure: WARNING: using cross tools not prefixed with host triplet
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /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
checking for arm-linux-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for arm-linux-strip... strip
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from aarch64-none-linux-gnu-gcc object... ok
checking for sysroot... no
checking for arm-linux-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if aarch64-none-linux-gnu-gcc static flag -static works... yes
checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
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
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
checking whether __clang__ is declared... no
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking for arm-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking if compiler supports -Werror=unknown-warning-option... no
checking if compiler supports -Werror=unused-command-line-argument... no
checking if aarch64-none-linux-gnu-gcc supports -Wall... yes
checking if aarch64-none-linux-gnu-gcc supports -Wpointer-arith... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-declarations... yes
checking if aarch64-none-linux-gnu-gcc supports -Wformat=2... yes
checking if aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports -Wnested-externs... yes
checking if aarch64-none-linux-gnu-gcc supports -Wbad-function-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
checking if aarch64-none-linux-gnu-gcc supports -Wdeclaration-after-statement... yes
checking if aarch64-none-linux-gnu-gcc supports -Wunused... yes
checking if aarch64-none-linux-gnu-gcc supports -Wuninitialized... yes
checking if aarch64-none-linux-gnu-gcc supports -Wshadow... yes
checking if aarch64-none-linux-gnu-gcc supports -Wcast-qual... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-noreturn... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
checking if aarch64-none-linux-gnu-gcc supports -Wredundant-decls... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=implicit... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=nonnull... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=init-self... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=main... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=missing-braces... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=sequence-point... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=return-type... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=trigraphs... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=array-bounds... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=write-strings... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=address... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=int-to-pointer-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=pointer-to-int-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -pedantic... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=attributes... yes
checking whether ln -s works... yes
checking for XAU... yes
checking for gethostbyname_r in -lc... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating man/Makefile
config.status: creating xau.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

make

make install

huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ make
make  all-recursive
make[1]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7”
Making all in man
make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
  GEN    Xau.3
  GEN    XauDisposeAuth.3
  GEN    XauFileName.3
  GEN    XauGetAuthByAddr.3
  GEN    XauGetBestAuthByAddr.3
  GEN    XauLockAuth.3
  GEN    XauReadAuth.3
  GEN    XauUnlockAuth.3
  GEN    XauWriteAuth.3
make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7”
  CC     AuDispose.lo
  CC     AuFileName.lo
  CC     AuGetAddr.lo
  CC     AuGetBest.lo
  CC     AuLock.lo
  CC     AuRead.lo
  CC     AuUnlock.lo
  CC     AuWrite.lo
  CCLD   libXau.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7”
make[1]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7”
huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ make install
Making install in man
make[1]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
make[2]: 对“install-exec-am”无需做任何事。
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"
 /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'
make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
make[1]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7/man”
make[1]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7”
make[2]: 进入目录“/home/huhu/third_part/openGL/libXau-1.0.7”
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"
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libXau.la '/home/huhu/third_part/openGL/libXau-1.0.7/install/lib'
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
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; }; })
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; }; })
libtool: install: /usr/bin/install -c .libs/libXau.lai /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.la
libtool: install: /usr/bin/install -c .libs/libXau.a /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.a
libtool: install: chmod 644 /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.a
libtool: install: ranlib /home/huhu/third_part/openGL/libXau-1.0.7/install/lib/libXau.a
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
----------------------------------------------------------------------
Libraries have been installed in:
   /home/huhu/third_part/openGL/libXau-1.0.7/install/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "" || /usr/bin/mkdir -p ""
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"
 /usr/bin/install -c -m 644 xau.pc '/home/huhu/third_part/openGL/libXau-1.0.7/install/lib/pkgconfig'
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"
 /usr/bin/install -c -m 644 include/X11/Xauth.h '/home/huhu/third_part/openGL/libXau-1.0.7/install/include/X11'
make[2]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7”
make[1]: 离开目录“/home/huhu/third_part/openGL/libXau-1.0.7”

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

huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7$ cd install/
huhu@huhu-System-Product-Name:~/third_part/openGL/libXau-1.0.7/install$ ls
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

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
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for arm-linux-gcc... aarch64-none-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether aarch64-none-linux-gnu-gcc accepts -g... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
checking whether aarch64-none-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of aarch64-none-linux-gnu-gcc... gcc3
checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
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
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
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-linux-dumpbin... no
checking for arm-linux-link... no
checking for dumpbin... no
checking for link... link -dump
configure: WARNING: using cross tools not prefixed with host triplet
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
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
checking for arm-linux-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for arm-linux-strip... strip
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from aarch64-none-linux-gnu-gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for arm-linux-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if aarch64-none-linux-gnu-gcc static flag -static works... yes
checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
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
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
checking whether __clang__ is declared... no
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking for arm-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=unknown-warning-option... no
checking if aarch64-none-linux-gnu-gcc supports -Werror=unused-command-line-argument... no
checking if aarch64-none-linux-gnu-gcc supports -Wall... yes
checking if aarch64-none-linux-gnu-gcc supports -Wpointer-arith... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-declarations... yes
checking if aarch64-none-linux-gnu-gcc supports -Wformat=2... yes
checking if aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports -Wnested-externs... yes
checking if aarch64-none-linux-gnu-gcc supports -Wbad-function-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
checking if aarch64-none-linux-gnu-gcc supports -Wdeclaration-after-statement... yes
checking if aarch64-none-linux-gnu-gcc supports -Wunused... yes
checking if aarch64-none-linux-gnu-gcc supports -Wuninitialized... yes
checking if aarch64-none-linux-gnu-gcc supports -Wshadow... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-noreturn... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
checking if aarch64-none-linux-gnu-gcc supports -Wredundant-decls... yes
checking if aarch64-none-linux-gnu-gcc supports -Wlogical-op... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=implicit... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=nonnull... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=init-self... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=main... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=missing-braces... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=sequence-point... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=return-type... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=trigraphs... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=array-bounds... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=write-strings... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=address... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=int-to-pointer-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=pointer-to-int-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -pedantic... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=attributes... yes
checking whether make supports nested variables... (cached) yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking asm/mtrr.h usability... no
checking asm/mtrr.h presence... no
checking for asm/mtrr.h... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating man/Makefile
config.status: creating src/Makefile
config.status: creating scanpci/Makefile
config.status: creating pciaccess.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

make

make install

huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ make
make  all-recursive
make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
Making all in include
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
make[2]: 对“all”无需做任何事。
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
Making all in man
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
  GEN      scanpci.1
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
Making all in src
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
  CC       common_bridge.lo
  CC       common_iterator.lo
  CC       common_init.lo
common_init.c: 在函数‘pci_system_cleanup’中:
common_init.c:110:3: 警告: ‘pci_device_unmap_region’ is deprecated [-Wdeprecated-declarations]
  110 |   (void) pci_device_unmap_region( & pci_sys->devices[i].base, j );
      |   ^
In file included from common_init.c:38:
../include/pciaccess.h:88:18: 附注: 在此声明
   88 | int __deprecated pci_device_unmap_region(struct pci_device *dev,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~
  CC       common_interface.lo
  CC       common_io.lo
  CC       common_capability.lo
  CC       common_device_name.lo
  CC       common_map.lo
  CC       common_vgaarb.lo
  CC       linux_sysfs.lo
linux_sysfs.c: 在函数‘pci_device_linux_sysfs_map_range’中:
linux_sysfs.c:607:9: 警告: 未使用的变量‘err’ [-Wunused-variable]
  607 |     int err = 0;
      |         ^~~
  CC       linux_devmem.lo
  CCLD     libpciaccess.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
Making all in scanpci
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
  CC       scanpci.o
  CCLD     scanpci
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ make install
Making install in include
make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
make[2]: 对“install-exec-am”无需做任何事。
 /usr/bin/mkdir -p '/home/huhu/third_part/openGL/libpciaccess-0.16/install/include'
 /usr/bin/install -c -m 644 pciaccess.h '/home/huhu/third_part/openGL/libpciaccess-0.16/install/include'
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/include”
Making install in man
make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
make[2]: 对“install-exec-am”无需做任何事。
make[2]: 对“install-data-am”无需做任何事。
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/man”
Making install in src
make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
 /usr/bin/mkdir -p '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libpciaccess.la '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib'
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
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; }; })
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; }; })
libtool: install: /usr/bin/install -c .libs/libpciaccess.lai /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.la
libtool: install: /usr/bin/install -c .libs/libpciaccess.a /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.a
libtool: install: chmod 644 /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.a
libtool: install: ranlib /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/libpciaccess.a
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
----------------------------------------------------------------------
Libraries have been installed in:
   /home/huhu/third_part/openGL/libpciaccess-0.16/install/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: 对“install-data-am”无需做任何事。
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/src”
Making install in scanpci
make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
make[2]: 对“install-exec-am”无需做任何事。
make[2]: 对“install-data-am”无需做任何事。
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16/scanpci”
make[1]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
make[2]: 进入目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
make[2]: 对“install-exec-am”无需做任何事。
 /usr/bin/mkdir -p '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/pkgconfig'
 /usr/bin/install -c -m 644 pciaccess.pc '/home/huhu/third_part/openGL/libpciaccess-0.16/install/lib/pkgconfig'
make[2]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”
make[1]: 离开目录“/home/huhu/third_part/openGL/libpciaccess-0.16”

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

huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16$ cd install/
huhu@huhu-System-Product-Name:~/third_part/openGL/libpciaccess-0.16/install$ ls
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

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
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for arm-linux-gcc... aarch64-none-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether aarch64-none-linux-gnu-gcc accepts -g... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
checking whether aarch64-none-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of aarch64-none-linux-gnu-gcc... gcc3
checking how to run the C preprocessor... aarch64-none-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
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
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
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-linux-dumpbin... no
checking for arm-linux-link... no
checking for dumpbin... no
checking for link... link -dump
configure: WARNING: using cross tools not prefixed with host triplet
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
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
checking for arm-linux-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for arm-linux-strip... strip
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from aarch64-none-linux-gnu-gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for arm-linux-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if aarch64-none-linux-gnu-gcc static flag -static works... yes
checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
checking if aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
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
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for aarch64-none-linux-gnu-gcc option to accept ISO C99... none needed
checking whether __clang__ is declared... no
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking for arm-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=unknown-warning-option... no
checking if aarch64-none-linux-gnu-gcc supports -Werror=unused-command-line-argument... no
checking if aarch64-none-linux-gnu-gcc supports -Wall... yes
checking if aarch64-none-linux-gnu-gcc supports -Wpointer-arith... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-declarations... yes
checking if aarch64-none-linux-gnu-gcc supports -Wformat=2... yes
checking if aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
checking if aarch64-none-linux-gnu-gcc supports -Wnested-externs... yes
checking if aarch64-none-linux-gnu-gcc supports -Wbad-function-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
checking if aarch64-none-linux-gnu-gcc supports -Wdeclaration-after-statement... yes
checking if aarch64-none-linux-gnu-gcc supports -Wunused... yes
checking if aarch64-none-linux-gnu-gcc supports -Wuninitialized... yes
checking if aarch64-none-linux-gnu-gcc supports -Wshadow... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-noreturn... yes
checking if aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
checking if aarch64-none-linux-gnu-gcc supports -Wredundant-decls... yes
checking if aarch64-none-linux-gnu-gcc supports -Wlogical-op... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=implicit... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=nonnull... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=init-self... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=main... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=missing-braces... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=sequence-point... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=return-type... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=trigraphs... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=array-bounds... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=write-strings... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=address... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=int-to-pointer-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=pointer-to-int-cast... yes
checking if aarch64-none-linux-gnu-gcc supports -pedantic... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror... yes
checking if aarch64-none-linux-gnu-gcc supports -Werror=attributes... yes
checking whether make supports nested variables... (cached) yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking asm/mtrr.h usability... no
checking asm/mtrr.h presence... no
checking for asm/mtrr.h... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating man/Makefile
config.status: creating src/Makefile
config.status: creating scanpci/Makefile
config.status: creating pciaccess.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

make

报错:

make
make -s all-recursive
Making all in .
  CC       libdrm_la-xf86drm.lo
xf86drm.c: 在函数‘drmAddMap’中:
xf86drm.c:1093:17: 警告: implicit conversion from ‘drmMapType’ to ‘enum drm_map_type’ [-Wenum-conversion]
 1093 |     map.type    = type;
      |                 ^
xf86drm.c:1094:17: 警告: implicit conversion from ‘drmMapFlags’ to ‘enum drm_map_flags’ [-Wenum-conversion]
 1094 |     map.flags   = flags;
      |                 ^
xf86drm.c: 在函数‘drmAddBufs’中:
xf86drm.c:1138:23: 警告: implicit conversion from ‘drmBufDescFlags’ to ‘enum <匿名>’ [-Wenum-conversion]
 1138 |     request.flags     = flags;
      |                       ^
xf86drm.c: 在函数‘drmDMA’中:
xf86drm.c:1417:25: 警告: implicit conversion from ‘drmDMAFlags’ to ‘enum drm_dma_flags’ [-Wenum-conversion]
 1417 |     dma.flags           = request->flags;
      |                         ^
xf86drm.c: 在函数‘drmGetMap’中:
xf86drm.c:2354:13: 警告: implicit conversion from ‘enum drm_map_type’ to ‘drmMapType’ [-Wenum-conversion]
 2354 |     *type   = map.type;
      |             ^
xf86drm.c:2355:13: 警告: implicit conversion from ‘enum drm_map_flags’ to ‘drmMapFlags’ [-Wenum-conversion]
 2355 |     *flags  = map.flags;
      |             ^
xf86drm.c: 在函数‘parse_separate_sysfs_files’中:
xf86drm.c:3154:37: 警告: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4096 [-Wformat-truncation=]
 3154 |         snprintf(path, PATH_MAX, "%s/%s", pci_path, attrs[i]);
      |                                     ^
xf86drm.c:3154:9: 附注: ‘snprintf’ output 2 or more bytes (assuming 4098) into a destination of size 4096
 3154 |         snprintf(path, PATH_MAX, "%s/%s", pci_path, attrs[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xf86drm.c: 在函数‘process_device’中:
xf86drm.c:3184:33: 警告: ‘/config’ directive output may be truncated writing 7 bytes into a region of size between 0 and 4096 [-Wformat-truncation=]
 3184 |     snprintf(path, PATH_MAX, "%s/config", pci_path);
      |                                 ^~~~~~~
xf86drm.c:3184:5: 附注: ‘snprintf’ output between 8 and 4104 bytes into a destination of size 4096
 3184 |     snprintf(path, PATH_MAX, "%s/config", pci_path);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from xf86drm.c:69:
xf86drm.c: 在函数‘drmGetMinorNameForFD’中:
xf86drm.h:85:23: 警告: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 55 [-Wformat-truncation=]
   85 | #define DRM_DIR_NAME  "/dev/dri"
      |                       ^~~~~~~~~~
xf86drm.c:2873:50: 附注: in expansion of macro ‘DRM_DIR_NAME’
 2873 |             snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
      |                                                  ^~~~~~~~~~~~
xf86drm.c:2873:65: 附注: format string is defined here
 2873 |             snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
      |                                                                 ^~
xf86drm.c:2873:13: 附注: ‘snprintf’ output between 10 and 265 bytes into a destination of size 64
 2873 |             snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2874 |                  ent->d_name);
      |                  ~~~~~~~~~~~~
  CC       libdrm_la-xf86drmHash.lo
  CC       libdrm_la-xf86drmRandom.lo
  CC       libdrm_la-xf86drmSL.lo
  CC       libdrm_la-xf86drmMode.lo
  CCLD     libdrm.la
Making all in libkms
  CC       linux.lo
  CC       dumb.lo
  CC       api.lo
  CC       vmwgfx.lo
  CC       intel.lo
  CC       nouveau.lo
  CC       radeon.lo
  CCLD     libkms.la
Making all in intel
  CC       intel_bufmgr.lo
  CC       intel_bufmgr_fake.lo
  CC       intel_bufmgr_gem.lo
  CC       intel_decode.lo
  CC       intel_chipset.lo
  CC       mm.lo
  CCLD     libdrm_intel.la
  CC       test_decode.o
test_decode.c: 在函数‘compare_batch’中:
test_decode.c:109:32: 警告: 提领类型双关的指针可能破坏强重叠规则 [-Wstrict-aliasing]
  109 |  out = open_memstream((char **)&ptr, &size);
      |                                ^~~~
  CCLD     test_decode
Making all in nouveau
  CC       nouveau.lo
  CC       pushbuf.lo
  CC       bufctx.lo
  CC       abi16.lo
  CCLD     libdrm_nouveau.la
/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
/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
/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
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:657:libdrm_nouveau.la] 错误 1
make[1]: *** [Makefile:859:all-recursive] 错误 1
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内部调试的变量冲突。

<

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值