Il 27 dic 2016 2:26 PM, "ssmtpmailtesting ssmtpmailtesting" <
[email protected]> ha scritto:
>
> What does it mean by cross compiler or cross compiling?
>
> I'm in chapter 5 to build temporary system.
>
> I tried this for binutils:
>
> ../configure --prefix=/tools            \
>              --with-sysroot=$LFS        \
>              --with-lib-path=/tools/lib \
>              --target=$LFS_TGT          \
>              --disable-nls              \
>              --disable-werror
>
> make -j2
> make install
>
> It looked, binutils was installed successfully in /tools. But I don't
know what --with-sysroot=$LFS does. Can anyone explain this? Won't
--prefix=/tools and --target=$LFS_TGT install binutils? Why do we need
--with-sysroot=$LFS?

If you read the book carefully everything is explained there.

thw --with-sysroot configure argument tells to the compiler where to look
for the files that he needs to compile programs. the new compiled linker,
ld, that is now installed on /tools when it will be used will recognise
/tools as the root of the system and if the compiler requires a file (eg.
/lib/ld-linux.so) it will search for /tools/lib/ld-linux.so instead of
looking inside the root of the host system. This ensures that the toolchain
is completely indipendent from the host system. You could also use it with
a minimal system composed only by a kernel and a shell and it will still
work because everything that the toolchain needs to work is inside it's own
directory. I hope that i explained everything clear
>
> After installing binutils in that way I wanted to install gcc in /tools
in one pass too. I wanted to skip gcc pass 2:
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass2.html
>
The GCC compiled in the first pass is incomplete, it cannot be used to
compile standard programs because it misses some critical files (you can't
even compile a hello_world.c) however it is good enough to compile a
standard C library, wich contains all the headers and libraries to make the
compiler complete and ready to do its job

> What would be the configure then? I tried this:
>
> ../configure                                       \
>     --target=$LFS_TGT                              \
>     --prefix=/tools                                \
>     --with-glibc-version=2.11                      \
>     --with-sysroot=$LFS                            \
>     --with-newlib                                  \
>     --with-local-prefix=/tools                     \
>     --with-native-system-header-dir=/tools/include \
>     --enable-languages=c,c++
>
> make -j2 ## this gives error like missing thread.h or missing stdio.h or
some other header files.
>
> Can anyone tell me how I should configure and install gcc with one pass
using that previously installed binutils?
>
> Also when do I need this: --host=$LFS_TGT? What's the difference between
--host=$LFS_TGT and --with-sysroot=$LFS? --host is in
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-libstdc++.html
and http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html

i explained that --with--sysroot does above.

the --host switch tells to the configure script that we want a library that
runs on a particular machine (maybe with  a different processor
architecture) in this case we set a different machine description that
builds exexutables compatible with the hardware of our machine (maybe to
avoid confusion and conflicts on the system?)

Suppose that we are building a system on a 32bit machine
* if the  host compiler description installed on the system is:
i686-linux-gnu
* The machine description of the LFS cross-compiler  will be:
i686-lfs-linux-gnu
If this is your first LFS build, as I presums, I have some suggestions for
you:

1) read more carefully the beginning of the book. it may still be useful
even to the more experienced user.

2) follow the book literally, if you want to experiment do it *after* you
successfully built a system for the first two times.

3) Keep a Bash reference guide near you. I suggest these:

http://www.tldp.org/LDP/Bash-Beginners-Guide/html/
http://linuxcommand.org/learning_the_shell.php

>
> http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html , In
glibc I saw: --build=$(../scripts/config.guess) , what does this --build
do? When do I need --build? Why didn't we need --build in binutils and gcc?
>
> --
> http://lists.linuxfromscratch.org/listinfo/lfs-support
> FAQ: http://www.linuxfromscratch.org/blfs/faq.html
> Unsubscribe: See the above information page
>
> Do not top post on this list.
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>
> http://en.wikipedia.org/wiki/Posting_style
>
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to