我按照 GCC 安装说明 [1] 下载源代码并配置我的构建,但是当我尝试make
从顶层目录(使用MAINTAINERS
和Makefile.in
)时,我总是收到相同的错误:make: *** No targets specified and no makefile found.
我不知道如何继续安装指南的构建步骤。
编辑:我注意到我的objdir/config.log
文件以结尾configure: exit 1
,我不确定这是否是预期的,或者是否表示配置失败并且项目不处于可行构建状态。
我试过了
make
make install
make bootstrap
make -f Makefile.in
Makefile:26: *** missing separator. Stop.
由于以 和 开头的行,@if
此操作失败并显示消息@endif
。此自动生成的文件有很多这样的行,我怀疑我是否应该手动删除它们。
到目前为止我的完整工作流程:
# Get the source
~$ mkdir gcc; cd gcc
~/gcc$ git clone git://gcc.gnu.org/git/gcc.git .
# Make objdir/ and configure my desired build
~$ mkdir ARM; cd ARM
~/gcc/ARM$ ../configure --prefix=$HOME --target=aarch64-none-elf
# Try to "just make"
~/gcc/ARM$ cd ..
~/gcc$ make # :(
一些可能相关的细节
~/gcc$ gcc --version
gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~/gcc$ make --version
GNU Make 4.3
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~/gcc$ git show
commit 3e89a4d5138e585713604135d4c2601244055e82 (HEAD -> master, origin/trunk, origin/master, origin/HEAD)
Author: Jason Merrill <[email protected]>
Date: Sat Nov 16 15:25:04 2024 -0500
...
~/gcc$ ls
ABOUT-NLS config.sub fixincludes libcody libitm ltmain.sh missing
ar-lib configure gcc libcpp libobjc lt~obsolete.m4 mkdep
ARM configure.ac gnattools libdecnumber libphobos lto-plugin mkinstalldirs
ChangeLog contrib gotools libffi libquadmath ltoptions.m4 move-if-change
ChangeLog.jit COPYING include libgcc libsanitizer ltsugar.m4 multilib.am
ChangeLog.tree-ssa COPYING3 INSTALL libgfortran libssp ltversion.m4 README
compile COPYING3.LIB install-sh libgm2 libstdc++-v3 MAINTAINERS SECURITY.txt
config COPYING.LIB libada libgo libtool-ldflags maintainer-scripts symlink-tree
config.guess COPYING.RUNTIME libatomic libgomp libtool.m4 Makefile.def test-driver
config-ml.in c++tools libbacktrace libgrust libvtv Makefile.in ylwrap
config.rpath depcomp libcc1 libiberty ltgcc.m4 Makefile.tpl zlib
编辑:修复了一些细节并添加了一些细节
问题出在config.log上——运行时创建的日志文件
configure
。最明显的迹象是最后一行指示运行脚本时出错——非零退出编号——在我的情况下为“configure: exit 1”。从那里向上滚动显示configure
无法找到某些 gcc 依赖项(mpc、mpfr、gmp)。我只需要先安装它们,然后一旦 configure 成功完成,我可能会在 srcdir 中找到一个现成的 Makefile。