diff --git a/chapter08/libffi.xml b/chapter08/libffi.xml index 82e7e9496..b5630a4dc 100644 --- a/chapter08/libffi.xml +++ b/chapter08/libffi.xml @@ -26,6 +26,11 @@ The Libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time. + + FFI stands for Foreign Function Interface. An FFI allows a program written + in one language to call a program written in another language. Specifically, + Libffi can provide a bridge between an interpreter like Perl, or Python, and + shared library subroutines written in C, or C++. &buildtime; @@ -43,7 +48,7 @@ Installation of Libffi - Similar to GMP, libffi builds with optimizations specific + Like GMP, Libffi builds with optimizations specific to the processor in use. If building for another system, change the value of the --with-gcc-arch= parameter in the following command to an architecture name fully implemented by the @@ -52,7 +57,7 @@ Illegal Operation Errors. - Prepare libffi for compilation: + Prepare Libffi for compilation: ./configure --prefix=/usr \ --disable-static \ @@ -67,7 +72,7 @@ Ensure GCC optimizes for the current system. If this is not specified, the system is guessed and the code generated - may not be correct for some systems. If the generated code + may not be correct. If the generated code will be copied from the native system to a less capable system, use the less capable system as a parameter. For details about alternative system types, see --disable-exec-static-tramp - Disable static trampoline support. It's a new security - feature in libffi, but some BLFS packages (notably + Disable static trampoline support, a new security + feature in Libffi. Some BLFS packages (notably GJS) have not been adapted for it. @@ -195,7 +200,7 @@ rm -rf DESTDIR libffi - contains the foreign function interface API functions + Contains the foreign function interface API functions libffi diff --git a/chapter08/python.xml b/chapter08/python.xml index b03817629..5b80fa339 100644 --- a/chapter08/python.xml +++ b/chapter08/python.xml @@ -25,7 +25,8 @@ The Python 3 package contains the Python development environment. It is useful for object-oriented programming, writing scripts, prototyping - large programs, or developing entire applications. + large programs, and developing entire applications. Python is an interpreted + computer language. &buildtime; @@ -56,7 +57,7 @@ --with-system-expat - This switch enables linking against system version of + This switch enables linking against the system version of Expat. @@ -64,15 +65,19 @@ --with-system-ffi - This switch enables linking against system version of - libffi. + This switch enables linking against the system version of + libffi.so. --enable-optimizations - This switch enables stable, but expensive, optimizations. + This switch enables extensive, but time-consuming, optimization + steps. The interpreter is built twice; tests performed on the first + build are used to improve the optimized final version. + @@ -84,7 +89,7 @@ Running the tests at this point is not recommended. The tests are known to hang indefinitely in the partial LFS environment. - If desired, the tests can be rerun at the end of this chapter or + If desired, the tests can be rerun at the end of this chapter, or when Python 3 is reinstalled in BLFS. To run the tests anyway, issue make test. @@ -92,29 +97,34 @@ make install - In several places we use the pip3 command to + We use the pip3 command to install Python 3 programs and modules for all users as - root. This conflicts - with the Python developers recommendation to install packages into a - virtual environment or the home directory of a regular user (by running - pip3 as this user). To this end, a multi-line warning - is written when using pip3 as the - root user. The main reason - of this recommendation is for avoiding a conflict with the system - package manager (dpkg for example), but LFS does not - have a system-wide package manager so this is not a problem. And, - pip3 will attempt to check for a new version of - itself whenever it's run. As domain name resolving is not configured - yet in LFS chroot environment, it will fail to check for a new version - and produce a warning. Once we boot the LFS system and set up network - connection, it will then produce a warning telling the user to update it - from a pre-built wheel on PyPI if any new version is available. But LFS - consider pip3 a part of Python 3 so it should not be - updated separately, and an update from a pre-built wheel will deviate - from our purpose to build a Linux system from source code. So the - warning for a new pip3 version should be ignored as - well. If desired, suppress these warnings by running the following - commands: + root in several places in this book. + This conflicts with the Python developers' recommendation: to install packages into a + virtual environment, or into the home directory of a regular user (by running + pip3 as this user). A multi-line warning + is triggered whenever pip3 is issued by the + root user. + + The main reason + for the recommendation is to avoid conflicts with the system's + package manager (dpkg, for example). LFS does not + have a system-wide package manager, so this is not a problem. Also, + pip3 will check for a new version of + itself whenever it's run. Since domain name resolution is not yet configured + in the LFS chroot environment, pip3 cannot check + for a new version of itself, and will + produce a warning. + + After we boot the LFS system and set up a network connection, + a different warning will be issued, telling the user to update pip3 + from a pre-built wheel on PyPI (whenever a new version is available). But LFS + considers pip3 to be a part of Python 3, so it should not be + updated separately. Also, an update from a pre-built wheel would deviate + from our objective: to build a Linux system from source code. So the + warning about a new version of pip3 should be ignored as + well. If you wish, you can suppress all these warnings by running the following + command, which creates a configuration file: cat > /etc/pip.conf << EOF [global] @@ -130,20 +140,20 @@ EOF In LFS and BLFS we normally build and install Python modules with the - pip3 command. Please take care that the - pip3 install commands in both the books should be - run as the &root; user unless it's for a Python virtual environment. - Running a pip3 install as a non-&root; user may seem - to work fine, but it will cause the installed module to be inaccessible + pip3 command. Please be sure that the + pip3 install commands in both books are + run as the &root; user (unless it's for a Python virtual environment). + Running pip3 install as a non-&root; user may seem + to work, but it will cause the installed module to be inaccessible by other users. pip3 install will not reinstall an already installed - module by default. For using the pip3 install + module automatically. When using the pip3 install command to upgrade a module (for example, from meson-0.61.3 to meson-0.62.0), insert the option --upgrade into - the command line. If it's really necessary to downgrade a module or + the command line. If it's really necessary to downgrade a module, or reinstall the same version for some reason, insert --force-reinstall --no-deps into the command line. @@ -167,7 +177,7 @@ tar --strip-components=1 \ and Ensure the installed files have the correct ownership and - permissions. Without these options, using tar + permissions. Without these options, tar will install the package files with the upstream creator's values. @@ -226,8 +236,8 @@ tar --strip-components=1 \ is a wrapper script that opens a Python aware GUI editor. For this script to run, you must have installed - Tk before Python so that the Tkinter - Python module is built + Tk before Python, so that the Tkinter + Python module is built. idle3 @@ -240,7 +250,7 @@ tar --strip-components=1 \ The package installer for Python. You can use pip to install - packages from Python Package Index and other indexes + packages from Python Package Index and other indexes. pip3 @@ -264,8 +274,8 @@ tar --strip-components=1 \ python3 - is an interpreted, interactive, object-oriented programming - language + is the interpreter for Python, an interpreted, interactive, + object-oriented programming language python3