C++ a、 gcc生成期间的out权限问题
我正在64位系统上手动构建gcc 4.8.4,该系统已经有了gcc 4.6.3。C++ a、 gcc生成期间的out权限问题,c++,c,gcc,C++,C,Gcc,我正在64位系统上手动构建gcc 4.8.4,该系统已经有了gcc 4.6.3。 问题出在构建阶段。似乎a.out不是一个可执行文件 configure: loading cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for --enable-generated-files-in-srcdir... no checking build system type... x
问题出在构建阶段。似乎
a.out
不是一个可执行文件
configure: loading cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for --enable-generated-files-in-srcdir... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-unknown-linux-gnu-gcc... /root/gcc/mega/./gcc/xgcc -B/root/gcc/mega/./gcc/ -B/usr/x86_64-unknown-linux-gnu/bin/ -B/usr/x86_64-unknown-linux-gnu/lib/ -isystem /usr/x86_64-unknown-linux-gnu/include -isystem /usr/x86_64-unknown-linux-gnu/sys-include
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/root/gcc/mega/x86_64-unknown-linux-gnu/libgomp':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgomp] Error 1
make[2]: Leaving directory `/root/gcc/mega'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/root/gcc/mega'
make: *** [bootstrap] Error 2
下面是关于构建本身的更多信息
../gcc-4.8.4/configure --prefix=/usr \
--mandir=/usr/man \
--libexecdir=/usr/lib \
--enable-languages=c,c++,objc,go \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared --disable-nls \
--with-x=no --with-system-zlib \
--without-cloog --without-ppl --disable-multilib
这一阶段进展顺利makeboot\u CFLAGS='-O2-march=native-pipe'引导以我上面提到的问题结束
以下是libgomp目录中的config.log文件:
下面是gcc内部的config.log:
这实际上是权限问题吗?您是在安装了noexec之类的文件系统上构建的吗?或者生成的二进制文件与您的操作系统/动态链接器不兼容?IIRC最新内核仅支持默认配置中的elf可执行文件。您或您的发行版必须启用a.out。@ChrisStratton我在一个ext4分区上构建,该分区像mount/dev/sdaX/mnt/X
一样装载。我在一个可能添加的root用户上做所有工作。@technosaurus因为我自己在做,所以我怀疑发行版能做什么。我应该如何启用a.out
@technosaurus?虽然这是可能的,只是因为它被称为a.out并不意味着它不是elf?出于某种原因,默认输出文件名似乎没有改变默认的二进制格式。