Changeset 9c1db810 for BOOK


Ignore:
Timestamp:
Aug 21, 2006, 10:38:49 PM (18 years ago)
Author:
Joe Ciccone <jciccone@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
95ab747
Parents:
b65bb044
Message:

Added a multilib wrapper to perl on multilib builds.

Location:
BOOK
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • BOOK/final-system/mips64-chapter.xml

    rb65bb044 r9c1db810  
    3838  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/libtool-n32.xml"/>
    3939  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/libtool-64bit.xml"/>
     40  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl.xml"/>
     41  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl-n32.xml"/>
    4042  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl-64bit.xml"/>
    4143  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/readline.xml"/>
  • BOOK/final-system/multilib/perl-64bit.xml

    rb65bb044 r9c1db810  
    99  <?dbhtml filename="perl-64bit.html"?>
    1010
    11   <title>Perl-&perl-version;</title>
     11  <title>Perl-&perl-version; 64 Bit</title>
    1212
    1313  <indexterm zone="ch-system-perl">
     
    2222    <title>Installation of Perl</title>
    2323
    24     <para os="m1">In multilib builds we install compilers and libraries for each available
    25     architecture.  The description below says that perl installs several hundred
    26     libraries, but they are used by invoking <command>perl</command>, not by linking
    27     to them with <command>ld</command>.  Although it is possible to install perl for
    28     32 bits, move it to a different name, and then install the 64-bit version, it is
    29     almost always invoked as just <command>perl</command>. That means only the
    30     libraries and modules for the last version installed will be accessible. We
    31     therefore only install one version.</para>
    32 
    3324    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    3425    href="../common/perl.xml"
     
    4031
    4132    <para os="p3">Perl does not, by default, know about library directories with names other
    42     than lib, such as lib64.  The following patch will allow it to install to lib64:</para>
     33    than lib, The following patch will allow it to install to other directories:</para>
    4334
    4435<screen os="p4"><userinput>patch -Np1 -i ../&perl-multilib-patch;</userinput></screen>
    4536
    46     <para os="p5">There is a further (possibly cosmetic) anomaly - if we install perl and
     37    <para os="s1">There is a further (possibly cosmetic) anomaly - if we install perl and
    4738    then run <command>perl -V</command> it will claim that libc is in /lib.  The
    48     following patch fixes this, but only takes effect when <command>make install
     39    following sed fixes this, but only takes effect when <command>make install
    4940    </command> is run:</para>
    5041
    51 <screen os="p6"><userinput>patch -Np1 -i ../&perl-lib64-patch;</userinput></screen>
     42<screen os="s2"><userinput>sed -i "/libc/s@/lib@/lib64@" hints/linux.sh</userinput></screen>
    5243
    5344    <para os="m2">We still need to tell perl to actually use lib64:</para>
     
    119110    xpointer="xpointer(//*[@os='k'])"/>
    120111
     112    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     113    href="perl.xml"
     114    xpointer="xpointer(//*[@os='l'])"/>
     115
     116<screen os="m"><userinput>mv /usr/bin/perl{,-64}</userinput></screen>
     117
     118    <para os="n">Now we need to create a multilib wrapper that lets us choose
     119    which perl installation to use.</para>
     120
     121<screen os="o"><userinput>cat &gt; perl_wrapper.c &lt;&lt; "EOF"
     122#include &lt;stdio.h&gt;
     123#include &lt;stdlib.h&gt;
     124#include &lt;string.h&gt;
     125#include &lt;unistd.h&gt;
     126#include &lt;errno.h&gt;
     127
     128int main (int argc, char *argv[])
     129{
     130  char *perl_arch;
     131  if ((perl_arch = getenv("PERL_ARCH")) == NULL)
     132    perl_arch = "64";
     133
     134  char *filename = malloc(strlen(argv[0]) + strlen(perl_arch) + 2);
     135  strcpy(filename, argv[0]);
     136  strcat(filename, "-");
     137  strcat(filename, perl_arch);
     138
     139  int ret = 0;
     140  ret = execvp(filename, argv);
     141  if ((ret != 0)&amp;&amp;(errno != 0))
     142  {
     143    char *errmsg = malloc(strlen(filename) + 19);
     144    strcpy(errmsg, "Unable to execute ");
     145    strcat(errmsg, filename);
     146    perror(errmsg);
     147    free(errmsg);
     148  }
     149
     150  free(filename);
     151
     152  return ret;
     153}
     154EOF
     155gcc ${BUILD64} perl_wrapper.c -o /usr/bin/perl</userinput></screen>
     156
    121157  </sect2>
    122158
  • BOOK/final-system/ppc64-chapter.xml

    rb65bb044 r9c1db810  
    3434  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ppc64/libtool.xml"/>
    3535  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/libtool-64bit.xml"/>
     36  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl.xml"/>
    3637  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl-64bit.xml"/>
    3738  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/readline.xml"/>
  • BOOK/final-system/sparc64-chapter.xml

    rb65bb044 r9c1db810  
    3434  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sparc64/libtool.xml"/>
    3535  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/libtool-64bit.xml"/>
     36  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl.xml"/>
    3637  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl-64bit.xml"/>
    3738  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/readline.xml"/>
  • BOOK/final-system/x86_64-chapter.xml

    rb65bb044 r9c1db810  
    3434  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="x86_64/libtool.xml"/>
    3535  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/libtool-64bit.xml"/>
     36  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl.xml"/>
    3637  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/perl-64bit.xml"/>
    3738  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/readline.xml"/>
  • BOOK/introduction/common/changelog.xml

    rb65bb044 r9c1db810  
    4141      <itemizedlist>
    4242        <listitem>
     43          <para>[jciccone] - Added a multilib perl setup that has a multilib
     44          wrapper. The multilib wrapper checks for the value of PERL_ARCH and
     45          executes the cooresponding perl binary.</para>
     46        </listitem>
     47        <listitem>
    4348          <para>[ken] - Remove include/net from instructions for headers.</para>
    4449        </listitem>
  • BOOK/materials/mips64/patches.xml

    rb65bb044 r9c1db810  
    6969    xpointer="xpointer(//*[@os='perl-multilib-patch'])"/>
    7070
    71     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    72     href="../x86_64/patches.xml"
    73     xpointer="xpointer(//*[@os='perl-lib64-patch'])"/>
    74 
    7571    <varlistentry os="util-linux-mips64-patch">
    7672      <term>Util-linux MIPS64 Patch - <token>&util-linux-mips64-patch-size;</token>:</term>
  • BOOK/materials/ppc64/patches.xml

    rb65bb044 r9c1db810  
    5656    xpointer="xpointer(//*[@os='perl-multilib-patch'])"/>
    5757
    58     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    59     href="../x86_64/patches.xml"
    60     xpointer="xpointer(//*[@os='perl-lib64-patch'])"/>
    61 
    6258    <varlistentry>
    6359      <term>Powerpc-utils Fixes Patch - <token>&powerpcutils64-patch-size;</token>:</term>
  • BOOK/materials/sparc64/patches.xml

    rb65bb044 r9c1db810  
    3838
    3939    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    40     href="../x86_64/patches.xml"
    41     xpointer="xpointer(//*[@os='perl-lib64-patch'])"/>
    42 
    43     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    4440    href="../sparc/patches.xml"
    4541    xpointer="xpointer(//*[@os='silo-fixes-patch'])"/>
  • BOOK/materials/x86_64/patches.xml

    rb65bb044 r9c1db810  
    5252    </varlistentry>
    5353
    54     <varlistentry os="perl-lib64-patch">
    55       <term>Perl Libc lib64 Patch - <token>&perl-lib64-patch-size;</token>:</term>
    56       <listitem>
    57         <para>Download: <ulink
    58         url="&patches-root;&perl-lib64-patch;"/></para>
    59         <para>MD5 sum: <literal>&perl-lib64-patch-md5;</literal></para>
    60       </listitem>
    61     </varlistentry>
    62 
    6354  </variablelist>
    6455
  • BOOK/patches.ent

    rb65bb044 r9c1db810  
    151151<!ENTITY perl-multilib-patch-size "1.4 KB">
    152152
    153 <!ENTITY perl-lib64-patch "perl-&perl-version;-libc_lib64-1.patch">
    154 <!ENTITY perl-lib64-patch-md5 "c503928cad589ba5211c0b3f999a37bd">
    155 <!ENTITY perl-lib64-patch-size "1 KB">
    156 
    157153<!-- Start of Pure64 patches -->
    158154
Note: See TracChangeset for help on using the changeset viewer.