编译器错误报告对于./configure来说太苛刻了

时间:2017-08-02 12:55:30

标签: c++ build arm

所以,我正在尝试为CFW Nintendo 3DS编译一个Homebrew应用程序。我是在Linux Mint 18.2上做的。编译器无法编译一些必需的依赖项。

以下是编译器的代码:

#!/bin/sh
set -ex

mkdir -p build

# Install libarchive and libmpg123 for host
apt-get update
apt-get -y install libarchive-dev libmpg123-dev

# Install libarchive for 3ds
git clone https://github.com/Cruel/3ds_portlibs.git
cd 3ds_portlibs
make zlib
make install-zlib
make libarchive
make install

# Install libmpg123 for 3ds
wget -O libmpg123-dev.tar.gz  https://notabug.org/attachments/216a6d61-f167-4f65-84dc-fa98c2247fc1
tar -xaf libmpg123-dev.tar.gz -C $DEVKITPRO/portlibs/3ds

cd ../build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EMULATOR=ON -DBUILD_TESTS=ON ..
make -j4

以下是我得到的输出错误:

+ mkdir -p build
+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://deb.torproject.org/torproject.org xenial InRelease
Hit:7 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease
Get:8 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:9 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:10 http://ppa.launchpad.net/jonathonf/ffmpeg-3/ubuntu xenial InRelease
Hit:6 http://screenshots.getdeb.net xenial-getdeb InRelease
Get:11 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Ign:12 http://packages.linuxmint.com sonya InRelease
Hit:13 http://packages.linuxmint.com sonya Release
Hit:15 http://archive.canonical.com/ubuntu xenial InRelease
Fetched 204 kB in 5s (38.6 kB/s)
Reading package lists...
+ apt-get -y install libarchive-dev libmpg123-dev
Reading package lists...
Building dependency tree...
Reading state information...
libmpg123-dev is already the newest version (1.22.4-1).
libarchive-dev is already the newest version (3.2.1-2~ubuntu16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.
+ git clone https://github.com/Cruel/3ds_portlibs.git
Cloning into '3ds_portlibs'...
+ cd 3ds_portlibs
+ CFLAGS=-m64
+ make zlib
wget -O zlib-1.2.8.tar.gz "http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz"
--2017-08-02 08:47:03--  http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz
Resolving prdownloads.sourceforge.net (prdownloads.sourceforge.net)... 216.34.181.59
Connecting to prdownloads.sourceforge.net (prdownloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz [following]
--2017-08-02 08:47:03--  http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://versaweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz [following]
--2017-08-02 08:47:04--  https://versaweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Resolving versaweb.dl.sourceforge.net (versaweb.dl.sourceforge.net)... 104.238.205.251
Connecting to versaweb.dl.sourceforge.net (versaweb.dl.sourceforge.net)|104.238.205.251|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 571091 (558K) [application/x-gzip]
Saving to: ‘zlib-1.2.8.tar.gz’

2017-08-02 08:47:04 (1.95 MB/s) - ‘zlib-1.2.8.tar.gz’ saved [571091/571091]

Using ar
Checking for arm-none-eabi-gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
Makefile:195: recipe for target 'zlib' failed
make: *** [zlib] Error 1

我还注意到如果删除关于zlib的行,我会得到一个不同的错误:

+ export CPP3DS=/home/eddy/Documents/FreeShop/cpp3ds
+ for dev in ''\''arc13'\'''
+ cd /home/eddy/Documents/FreeShop/arc13/freeshop
+ for dx in '"3ds_portlibs"' '"build"'
+ '[' -d 3ds_portlibs ']'
+ rm -r 3ds_portlibs
+ for dx in '"3ds_portlibs"' '"build"'
+ '[' -d build ']'
+ rm -r build
+ mkdir -p build
+ export CC=arm-none-eabi-gcc
+ CC=arm-none-eabi-gcc
+ export CXX=arm-none-eabi-g++
+ CXX=arm-none-eabi-g++
+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://deb.torproject.org/torproject.org xenial InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable Release
Ign:4 http://packages.linuxmint.com sonya InRelease
Hit:5 http://packages.linuxmint.com sonya Release
Hit:6 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease
Hit:7 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:8 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:12 http://archive.canonical.com/ubuntu xenial InRelease
Hit:13 http://ppa.launchpad.net/jonathonf/ffmpeg-3/ubuntu xenial InRelease
Hit:14 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:10 http://screenshots.getdeb.net xenial-getdeb InRelease
Hit:15 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists...
+ apt-get -y install libarchive-dev libmpg123-dev
Reading package lists...
Building dependency tree...
Reading state information...
libmpg123-dev is already the newest version (1.22.4-1).
libarchive-dev is already the newest version (3.2.1-2~ubuntu16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
+ git clone https://github.com/Cruel/3ds_portlibs.git
Cloning into '3ds_portlibs'...
+ cd 3ds_portlibs
+ make CC=DEVKITPRO
Please choose one of the following targets:
  freetype (requires zlib to be installed)
  libexif
  libjpeg-turbo
  libpng (requires zlib to be installed)
  sqlite
  zlib
  mxml
  expat
  libxml2
  jansson
  physfs (requires zlib to be installed)
  libmad
  libogg
  libvorbis (requires libogg to be installed)
  giflib
  libconfig
  bzip2
  xz
  libarchive
  nettle
  wslay
+ make libarchive
wget -O libarchive-3.1.2.tar.gz "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz"
--2017-08-02 16:36:34--  http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
Resolving www.libarchive.org (www.libarchive.org)... 2600:9000:2025:5a00:16:e6b0:f440:93a1, 2600:9000:2025:fe00:16:e6b0:f440:93a1, 2600:9000:2025:2600:16:e6b0:f440:93a1, ...
Connecting to www.libarchive.org (www.libarchive.org)|2600:9000:2025:5a00:16:e6b0:f440:93a1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4527540 (4.3M) [application/x-gzip]
Saving to: ‘libarchive-3.1.2.tar.gz’

2017-08-02 16:36:40 (54.6 MB/s) - ‘libarchive-3.1.2.tar.gz’ saved [4527540/4527540]

patching file libarchive/archive_ppmd7.c
patching file libarchive/archive_read_disk_posix.c
patching file libarchive/archive_write_disk_posix.c
patching file libarchive/archive_write_set_format_iso9660.c
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-eabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-none-eabi
checking for arm-none-eabi-gcc... arm-none-eabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/eddy/Documents/FreeShop/arc13/freeshop/3ds_portlibs/libarchive-3.1.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:274: recipe for target 'libarchive' failed
make: *** [libarchive] Error 77

从错误来看,似乎我在64位系统上编译ARM应用程序并且由于这个原因而失败。但是,我需要在ARM中编译源代码,因为它应该安装在Nintendo 3DS上。如何修复此错误以编译应用程序?

编辑:我尝试为root设置编译器并出现此错误:

-- Check for working C compiler: /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc" is not able
  to compile a simple test program.

  It fails with the following output:

   Change Dir: /home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/make" "cmTC_ef3eb/fast"

  /usr/bin/make -f CMakeFiles/cmTC_ef3eb.dir/build.make
  CMakeFiles/cmTC_ef3eb.dir/build

  make[1]: Entering directory
  '/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp'

  Building C object CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o

  /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc -o
  CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o -c
  /home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTC_ef3eb

  /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ef3eb.dir/link.txt
  --verbose=1

  /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc
  CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o -o cmTC_ef3eb -rdynamic

  arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'

  CMakeFiles/cmTC_ef3eb.dir/build.make:97: recipe for target 'cmTC_ef3eb'
  failed

  make[1]: *** [cmTC_ef3eb] Error 1

  make[1]: Leaving directory
  '/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp'

  Makefile:126: recipe for target 'cmTC_ef3eb/fast' failed

  make: *** [cmTC_ef3eb/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)


-- Configuring incomplete, errors occurred!
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeOutput.log".
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeError.log".

我也遇到了这个错误:

-- strip: /opt/devkitPro/devkitARM/bin/arm-none-eabi-strip - found
-- 3dslink: /opt/devkitPro/devkitARM/bin/3dslink - found
-- Looking for Picasso...
-- Picasso: /opt/devkitPro/devkitARM/bin/picasso - found
-- Looking for nihstro...
-- nihstro - not found
CMake Error at /home/eddy/Documents/FreeShop/cpp3ds/cmake/template_emu/CMakeLists.txt:1 (find_package):
  By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5Widgets", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Widgets" with
  any of the following names:

    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake

  Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
  "Qt5Widgets_DIR" to a directory containing one of the above files.  If
  "Qt5Widgets" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeOutput.log".

1 个答案:

答案 0 :(得分:2)

this question开始,看起来它失败了,因为它无法找到有效的编译器。

您需要下载交叉编译器,以便在不同的架构上编译一个架构的代码。您可以按照this问题中的步骤获取ARM编译器,然后./configure脚本可以自行运行(看起来它正在寻找交叉编译器),或者您可以使用例如:

export CC=arm-linux-gnueabi-gcc
export CXX=arm-linux-gnueabi-g++

...在运行./configure之前设置构建系统的编译器(假设它遵循CC约定)。

如果这不起作用,您可能需要特定的DS交叉编译器,而不仅仅是通用的ARM交叉编译器。如果您还没有,可能值得查看this site,看看他们的devkitARM是否提供了您需要的交叉编译器。

修改:如果仔细查看新输出,则会看到make CC=DEVKITPRO。这是直接调用make并将DEVKITPRO设置为编译器,覆盖任何事先更改编译器的尝试。

您应该确保可以从DEVKITPRO访问PATH二进制文件 - 打开终端并输入DEVKITPRO,看看是否可以执行它,或者是否找不到它。如果找不到,请检查上面引用的devkitARM页面上的说明,确保已按预期安装,特别是Linux安装说明中的行{{1 }}

修改编辑:列出了图书馆和工具包here。查看项目的安装页面以查找任何依赖项,并跟踪它们并安装它们。