Changes in chapter08/glibc.xml [dea5385:9c7437f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter08/glibc.xml
rdea5385 r9c7437f 607 607 </sect2> 608 608 609 <!-- - - - - - - - - - -->610 <!-- Multilib - 32bit -->611 <!-- - - - - - - - - - -->612 <sect2 arch="ml_32,ml_all">613 <title>Building Glibc - 32bit</title>614 615 <para>Now recompile for m32. The extracted source can be616 reused but needs to be cleaned before installing the m32617 version of Glibc.</para>618 619 <para>Clear the build directory and remove artefacts from620 previous build:</para>621 622 <screen><userinput remap="pre">rm -rf ./*623 find .. -name "*.a" -delete</userinput></screen>624 625 <para>Configure Glibc for m32 with the following commands:</para>626 627 <screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \628 ../configure \629 --prefix=/usr \630 --host=i686-pc-linux-gnu \631 --build=$(../scripts/config.guess) \632 --enable-kernel=&min-kernel; \633 --disable-nscd \634 --libdir=/usr/lib32 \635 --libexecdir=/usr/lib32 \636 libc_cv_slibdir=/usr/lib32</userinput></screen>637 638 <para>Compile the package:</para>639 640 <screen><userinput remap="make">make</userinput></screen>641 642 <para>Install the package:</para>643 644 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install645 cp -a DESTDIR/usr/lib32/* /usr/lib32/646 install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \647 /usr/include/gnu/</userinput></screen>648 <!-- no longer required as they are created in chap5649 ln -svf ../lib32/ld-linux.so.2 /lib/ld-linux.so.2650 -->651 652 <para>Add the library name to the dynamic loader config:</para>653 654 <screen role="install"><userinput>echo "/usr/lib32" >> /etc/ld.so.conf</userinput></screen>655 656 <caution>657 <para>At this point, it is imperative to stop and ensure that the basic658 functions (compiling and linking) of the new toolchain are working as659 expected. To perform a sanity check, run the following commands:</para>660 661 <screen><userinput>echo 'int main(){}' > dummy.c662 gcc -m32 dummy.c663 readelf -l a.out | grep '/ld-linux'</userinput></screen>664 665 <para>If everything is working correctly, there should be no errors,666 and the output of the last command will be of the form:</para>667 668 <screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>669 670 <para>If the output is not shown as above or there was no output at all,671 then something is wrong. Investigate and retrace the steps to find out672 where the problem is and correct it. This issue must be resolved before673 continuing on.</para>674 675 <para>Once all is well, clean up the test files:</para>676 677 <screen><userinput>rm -v dummy.c a.out</userinput></screen>678 679 </caution>680 681 </sect2><!-- m32 -->682 683 <!-- - - - - - - - - - -->684 <!-- Multilib - x32bit -->685 <!-- - - - - - - - - - -->686 687 <sect2 arch="ml_x32,ml_all">688 <title>Building Glibc - x32bit</title>689 690 <para>Now recompile for mx32. The extracted source can be691 reused but needs to be cleaned before installing the mx32692 version of Glibc.</para>693 694 <para>Clear the build directory and remove artefacts from695 previous build:</para>696 697 <screen><userinput remap="pre">rm -rf ./*698 find .. -name "*.a" -delete</userinput></screen>699 700 <para>Configure Glibc for mx32 with the following commands:</para>701 702 <screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \703 ../configure \704 --prefix=/usr \705 --host=x86_64-pc-linux-gnux32 \706 --build=$(../scripts/config.guess) \707 --enable-kernel=&min-kernel; \708 --disable-nscd \709 --libdir=/usr/libx32 \710 --libexecdir=/usr/libx32 \711 libc_cv_slibdir=/usr/libx32</userinput></screen>712 713 <para>Compile the package:</para>714 715 <screen><userinput remap="make">make</userinput></screen>716 717 <para>Install the package:</para>718 719 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install720 cp -a DESTDIR/usr/libx32/* /usr/libx32/721 install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \722 /usr/include/gnu/</userinput></screen>723 <!-- no longer required as they are created in chap5724 ln -svf ../libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2725 -->726 <para>Add the library name to the dynamic loader config:</para>727 728 <screen role="install"><userinput>echo "/usr/libx32" >> /etc/ld.so.conf</userinput></screen>729 730 <caution>731 <para>At this point, it is imperative to stop and ensure that the basic732 functions (compiling and linking) of the new toolchain are working as733 expected. To perform a sanity check, run the following commands:</para>734 735 <screen><userinput>echo 'int main(){}' > dummy.c736 gcc -mx32 dummy.c737 readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>738 739 <para>If everything is working correctly, there should be no errors,740 and the output of the last command will be of the form:</para>741 742 <screen><computeroutput>[Requesting program interpreter: /libx32/ld-linux-x32.so.2]</computeroutput></screen>743 744 <para>If the output is not shown as above or there was no output at all,745 then something is wrong. Investigate and retrace the steps to find out746 where the problem is and correct it. This issue must be resolved before747 continuing on.</para>748 749 <para>Once all is well, clean up the test files:</para>750 751 <screen><userinput>rm -v dummy.c a.out</userinput></screen>752 753 </caution>754 755 </sect2><!-- mx32 -->756 757 609 <sect2 id="contents-glibc" role="content"> 758 610 <title>Contents of Glibc</title>
Note:
See TracChangeset
for help on using the changeset viewer.