我实际上正在阅读LFS书籍(版本7.1),我在第53页被阻止.尝试编译gcc,我尝试了以下命令:
./configure --target=$LFS_TGT --prefix=$LFS/build/gcc-build --disable-nls\
--disable-shared --disable-multilib --disable-decimal-float --disable-threads\
--disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath\
--disable-target-libiberty --disable-target-zlib\
--enable-languages=c\
--without-ppl --without-cloog\
--with-mpfr-include=$LFS/source/mpfr/src
--with-mpfr-lib=$LFS/source/mpfr/src/.libs\
--with-gmp-include=/mnt/LFS/source/gmp\
--with-gmp-lib=/mnt/LFS/source/gmp/.libs\
--with-mpc-include=/mnt/LFS/source/mpc/src\
--with-mpc-lib=/mnt/LFS/source/mpc/src/.libs
Run Code Online (Sandbox Code Playgroud)
运行gcc的配置脚本(当然我已经编译了mpfr,mpc和gmp).但是一旦我发布:
make -j4
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
checking for suffix of object files... configure: error: in `/mnt/LFS/source/gcc-4.6.2/x86_64-lfs-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
Run Code Online (Sandbox Code Playgroud)
我试图谷歌为它,并尝试了我找到的解决方案但没有任何效果.有谁知道我为什么会收到这个错误?
我明白-D_FILE_OFFSET_BITS=64原因off_t是64位.那么-D_LARGEFILE_SOURCE这项工作尚未完成-D_FILE_OFFSET_BITS=64呢?这些定义究竟做了什么?
我即将为一个业余爱好项目启动一个基于LFS的Linux发行版.我计划做一些非标准的任务,其中大部分都涉及更改发行版中的几乎所有脚本.(主要是init脚本,但我也会编写一套简单的包管理器脚本.)因为我要远离常规,因为我从未成为动态类型语言的粉丝(perl, python,bash和其他都很好,但不是我的强项),我想知道是否有人知道实际上已声明变量的解释语言.
我想了解的Linux From Scratch的概念,并想知道为什么有建筑多遍binutils,gcc等等.
为什么我们需要分别使用pass1和pass2?为什么我们不能建造工具通1,然后用它们建造gcc,glibc,libstdc++,等.
我想做内核模块编程.但是,所有消息来源都告诉linux发行版补丁原始内核,并且模块代码可能无法运行.如果这是真的,我该怎么办.我尝试使用ubuntu制作lfs但几乎每一步都出现错误.我看到某个地方,在安装过程中没有选择任何软件包的arch,gentoo,Ubuntu Server,slackware,susestudio等都是vanilla发行版.那么,我可以将它们用于模块编程吗?
请建议记住我需要在分发中使用GUI.
可这之后?
PS:我有一个intel核心i3处理器,将在vmware工作站上运行发行版.
我正在构建LFS,我正处于需要安装Glibc-2.11.1的部分
http://www.linuxfromscratch.org/lfs/view/6.6/chapter05/glibc.html
我已成功配置它但我无法运行make命令.每当我运行命令它运行一段时间然后停止.
我认为以下几行显示我所做的事情是不正确的:
mawk: scripts/gen-sorted.awk: line 19: regular expression compile failed (bad class -- [], [^] or [)
/[^
mawk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
mawk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "", subd ...
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1'
make[1]: Entering directory `/mnt/lfs/sources/glibc-2.11.1'
mawk -f scripts/gen-sorted.awk \
-v subdirs='csu assert ctype locale intl catgets math setjmp signal stdlib stdio-common libio malloc string wcsmbs time dirent grp pwd posix io termios resource misc socket sysvipc …Run Code Online (Sandbox Code Playgroud) 当我遇到配置Glibc的错误时,我正在从头开始使用Linux(步骤5.7):
checking for sysdeps preconfigure fragments... aarch64 alpha arm configure: error: Old ABI no longer supported
Run Code Online (Sandbox Code Playgroud)
我在用:
../glibc-2.20/configure \
--prefix=/tools \
--host=$LFS_TGT \
--build=$(../glibc-2.20/scripts/config.guess) \
--disable-profile \
--enable-kernel=2.6.32 \
--with-headers=/tools/include \
libc_cv_forced_unwind=yes \
libc_cv_ctors_header=yes \
libc_cv_c_cleanup=yes
Run Code Online (Sandbox Code Playgroud)
直到现在我都没有遇到麻烦.我的$ LFS_TGT = armv6l-lfs-linux-gnueabihf
过去几周我一直在寻找有关如何制作操作系统的信息。
我还阅读了有关如何制作这样的操作系统的问题,有哪些资源可以帮助您开始操作系统开发?。
我想制作一个使用 #Linux 内核的操作系统,它启动后仅以全屏视图显示浏览器。基本上我想做一些类似#firefox OS 的东西。
有一些操作系统具有类似的概念,例如 #justbrowsing http://justbrowsing.info/ 和 #browserlinux
我还研究了 #Linux From Scratch http://www.linuxfromscratch.org/index.html。但#LFS 不是我想要的。
我不想要一个可以处理所有环境、情况和错误的完整操作系统。为了开始我的项目,我想制作一个带有 #Linux 内核的浏览器操作系统。
browser operating-system linux-from-scratch linux-kernel firefox-os
我遵循LFS的说明,但有一点不同:我只遵循第 5 节 - 构建临时系统的部分内容,以便我可以构建自己的 GCC,原因是这是一台工作机器,我不这样做没有root权限。一切顺利,直到我配置时遇到错误glibc:
configure: error:
*** These critical programs are missing or too old: as GNU ld make bison compiler
*** Check the INSTALL file for required versions.
Run Code Online (Sandbox Code Playgroud)
经过一番调查,发现我不满足 LFS 所需的条件:
/usr/bin/yacc is a symbolic link to bison or a small script that executes bison.
Run Code Online (Sandbox Code Playgroud)
结果发现没有这样的文件/usr/bin/yacc(尽管bison确实存在)。但是,因为我在工作中没有 root 权限,所以无法在那里创建符号链接。这里有解决方法吗?
如果我的问题不准确,我很抱歉,因为我没有很多与Linux相关的经验.我目前正在从头开始构建一个Linux(主要是遵循linuxfromscratch.org 7.3版的指南).我遇到了以下问题:当我构建一个可执行文件时,它会获得一个名为ELF解释器的硬编码路径.
readelf -l program
Run Code Online (Sandbox Code Playgroud)
显示类似的东西
[Requesting program interpreter: /lib/ld-linux.so.2]
Run Code Online (Sandbox Code Playgroud)
我跟踪这个库ld-linux-so.2是glibc的一部分.我对这种行为不是很满意,因为它使二进制文件非常不可移植 - 如果我改变/lib/ld-linux.so.2的位置,可执行文件不再有效,我找到的唯一"修复"是使用patchelf来自NixOS的实用程序将硬编码路径更改为另一个硬编码路径.出于这个原因,我想链接到ld库的静态版本,但不会生成.所以这是我的问题,请你解释一下如何构建glibc以便生成ld-linux.so.2的静态版本,以后我可以链接到我的可执行文件.我不完全理解这个ld库的作用,但我认为这是加载其他动态库(或者至少是glibc.so)的部分.我想动态链接我的可执行文件,但我希望动态链接器本身静态内置到它们中,因此它们不依赖于硬编码路径.或者我希望能够使用类似于LD_LIBRARY_PATH的环境变量设置解释器的路径,也许是LD_INTERPRETER_PATH.目标是能够生成可移植的二进制文件,无论目录结构如何,它都可以在具有相同ABI的任何平台上运行.
一些可能相关的背景:我正在使用Slackware 14 x86来构建i686编译工具链,所以整体来说它都是x86主机和目标.我正在使用glibc 2.17和gcc 4.7.x.
我打字
root:/# gcc
Run Code Online (Sandbox Code Playgroud)
不知怎的,这发生了:
bash: /tools/bin/gcc: No such file or directory
Run Code Online (Sandbox Code Playgroud)
显然,$ PATH工作并正在寻找/ tools/bin/gcc.我正在chroot进入$ LFS并且迈出了这一步:http://www.linuxfromscratch.org/lfs/view/stable/chapter06/linux-headers.html.
编辑:现在make mrproper不再给我一个找不到gcc错误.奇怪的.
EDIT2:没关系,
root:/sources/linux-3.13.3# make mrproper
make: gcc: Command not found
Run Code Online (Sandbox Code Playgroud) 所以我正在阅读Linux From Scratch一书,并在章节5.17 Bison-3.0.4中.
这本书指示我们做一个make check后来make测试编译的Bison包的结果.
最初,我收到以下错误:
make[3]: Entering directory `/sources/bison-3.0'
LEX examples/calc++/calc++-scanner.cc
CXX
examples/calc++/examples_calc___calc__-calc++-scanner.o
g++: error: ./examples/calc++/calc++-scanner.cc: No such file or directory
g++: fatal error: no input files
compilation terminated.
make[3]: ***
[examples/calc++/examples_calc___calc__-calc++-scanner.o] Error 1
make[3]: Leaving directory `/sources/bison-3.0'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/sources/bison-3.0'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/sources/bison-3.0'
make: *** [check] Error 2
Run Code Online (Sandbox Code Playgroud)
但是在这个网站上得到了解决方案.在发出之前告诉我要做以下事情make check:
cp Makefile Makefile.bak …Run Code Online (Sandbox Code Playgroud) 我正在按照lfs中的过程制作一个linux系统.但是当我在这个页面上跟随第五步(即make之前的那一步)时,我最后得到一个错误.
configure: error: linker with -z relro support required
Run Code Online (Sandbox Code Playgroud)
在此之后如果我打电话让我得到一个错误
make: *** No targets specified and no makefile found. Stop.
Run Code Online (Sandbox Code Playgroud)
我在ubuntu 12.04机器上运行它.
如何解决这个错误?
linux ×11
gcc ×5
glibc ×5
linux-kernel ×2
arm ×1
autoconf ×1
bash ×1
bison ×1
browser ×1
c ×1
c++ ×1
elf ×1
firefox-os ×1
flex-lexer ×1
linux-distro ×1
package ×1
path ×1
root ×1
scripting ×1
ubuntu ×1