ACC SHELL

Path : /usr/share/gnome/help/opensuse-manuals/C/
File Upload :
Current File : //usr/share/gnome/help/opensuse-manuals/C/cha.64bit.html

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 15. 32-Bit and 64-Bit Applications in a 64-Bit System Environment</title><link rel="stylesheet" href="susebooks.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Documentation"><link rel="up" href="part.reference.system.html" title="Part IV. System"><link rel="prev" href="part.reference.system.html" title="Part IV. System"><link rel="next" href="cha.boot.html" title="Chapter 16. Booting and Configuring a Linux System"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header" border="0" class="bctable"><tr><td width="80%"><div class="breadcrumbs"><p><a href="index.html"> Documentation</a><span class="breadcrumbs-sep"> &gt; </span><a href="book.opensuse.reference.html">Reference</a><span class="breadcrumbs-sep"> &gt; </span><a href="part.reference.system.html">System</a><span class="breadcrumbs-sep"> &gt; </span><strong><a accesskey="p" title="Part IV. System" href="part.reference.system.html"><span>&#9664;</span></a>  <a accesskey="n" title="Chapter 16. Booting and Configuring a Linux System" href="cha.boot.html"><span>&#9654;</span></a></strong></p></div></td></tr></table></div><div class="chapter" title="Chapter 15. 32-Bit and 64-Bit Applications in a 64-Bit System Environment"><div class="titlepage"><div><div><h2 class="title"><a name="cha.64bit"></a>Chapter 15. 32-Bit and 64-Bit Applications in a 64-Bit System Environment<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#cha.64bit">¶</a></span></h2></div></div></div><div class="toc"><p><b>Contents</b></p><dl><dt><span class="sect1"><a href="cha.64bit.html#sec.64bit.runt">15.1. Runtime Support</a></span></dt><dt><span class="sect1"><a href="cha.64bit.html#sec.64bit.devel">15.2. Software Development</a></span></dt><dt><span class="sect1"><a href="cha.64bit.html#sec.64bit.biarch">15.3. Software Compilation on Biarch Platforms</a></span></dt><dt><span class="sect1"><a href="cha.64bit.html#sec.64bit.kernel">15.4. Kernel Specifications</a></span></dt></dl></div><a class="indexterm" name="id459460"></a><p>
  openSUSE® is available for 
  64-bit platforms. This does not necessarily mean that all the applications
  included have already been ported to 64-bit platforms. openSUSE
  supports the use of 32-bit applications in a 64-bit system environment.
  This chapter offers a brief overview of how this support is implemented on
  64-bit openSUSE platforms. It explains how 32-bit applications are
  executed (runtime support) and how 32-bit applications should be compiled
  to enable them to run both in 32-bit and 64-bit system environments.
  Additionally, find information about the kernel API and an explanation of
  how 32-bit applications can run under a 64-bit kernel.
 </p><p>
  <span>openSUSE for the
  64-bit platforms amd64 and Intel 64</span> is designed so that existing
  32-bit applications run in the 64-bit environment
  <span class="quote">&#8220;<span class="quote">out-of-the-box.</span>&#8221;</span> 
  This support means that you can continue to use your preferred 32-bit
  applications without waiting for a corresponding 64-bit port to become
  available.
 </p><div class="sect1" title="15.1. Runtime Support"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.64bit.runt"></a>15.1. Runtime Support<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.64bit.runt">¶</a></span></h2></div></div></div><a class="indexterm" name="id459507"></a><div class="important"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Important: Conflicts between Application Versions"><tr class="head"><td width="32"><img alt="[Important]" src="admon/important.png"></td><th align="left">Conflicts between Application Versions</th></tr><tr><td colspan="2" align="left" valign="top"><p>
    If an application is available both for 32-bit and 64-bit environments,
    parallel installation of both versions is bound to lead to problems. In
    such cases, decide on one of the two versions and install and use this.
   </p><p>
    An exception to this rule is PAM (pluggable authentication modules).
    openSUSE uses PAM in the authentication process as a layer that
    mediates between user and application. On a 64-bit operating system that
    also runs 32-bit applications it is necessary to always install both
    versions of a PAM module.
   </p></td></tr></table></div><p>
   To be executed correctly, every application requires a range of
   libraries. Unfortunately, the names for the 32-bit and 64-bit versions of
   these libraries are identical. They must be differentiated from each
   other in another way.
  </p><p>
   To retain compatibility with the 32-bit version, the libraries are stored
   at the same place in the system as in the 32-bit environment. The 32-bit
   version of <code class="filename">libc.so.6</code> is located under
   <code class="filename">/lib/libc.so.6</code> in both the 32-bit and 64-bit
   environments.
  </p><p>
   All 64-bit libraries and object files are located in directories called
   <code class="filename">lib64</code>. The 64-bit object files that you would
   normally expect to find under <code class="filename">/lib</code> and
   <code class="filename">/usr/lib</code> are now found under
   <code class="filename">/lib64</code> and <code class="filename">/usr/lib64</code>. This
   means that there is space for the 32-bit libraries under
   <code class="filename">/lib</code> and <code class="filename">/usr/lib</code>, so the
   filename for both versions can remain unchanged.
  </p><p>
   Subdirectories of 32-bit <code class="filename">/lib</code> directories which
   contain data content that does not depend on the word size are not moved.
   This scheme conforms to LSB (Linux Standards Base) and FHS (File System
   Hierarchy Standard).
  </p></div><div class="sect1" title="15.2. Software Development"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.64bit.devel"></a>15.2. Software Development<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.64bit.devel">¶</a></span></h2></div></div></div><a class="indexterm" name="id459608"></a><p>
   A biarch development tool chain allows generation of 32-bit and 64-bit
   objects. The default is to compile 64-bit objects. It is possible to
   generate 32-bit objects by using special flags. For GCC, this special
   flag is <code class="option">-m32</code>.
  </p><p>
   All header files must be written in an architecture-independent form. The
   installed 32-bit and 64-bit libraries must have an API (application
   programming interface) that matches the installed header files. The
   normal openSUSE environment is designed according to this principle.
   In the case of manually updated libraries, resolve these issues yourself.
  </p></div><div class="sect1" title="15.3. Software Compilation on Biarch Platforms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.64bit.biarch"></a>15.3. Software Compilation on Biarch Platforms<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.64bit.biarch">¶</a></span></h2></div></div></div><p>
   To develop binaries for the other architecture on a biarch architecture,
   the respective libraries for the second architecture must additionally be
   installed. These packages are called
   <code class="systemitem">rpmname-32bit</code>. You also need the
   respective headers and libraries from the
   <code class="systemitem">rpmname-devel</code> packages and the
   development libraries for the second architecture from
   <code class="systemitem">rpmname-devel-32bit</code>.
  </p><p>
   Most open source programs use an <span class="command"><strong>autoconf</strong></span>-based
   program configuration. To use <span class="command"><strong>autoconf</strong></span> for configuring
   a program for the second architecture, overwrite the normal compiler and
   linker settings of <span class="command"><strong>autoconf</strong></span> by running the
   <span class="command"><strong>configure</strong></span> script with additional environment
   variables.
  </p><p>
   The following example refers to an x86_64 system with x86 as the second
   architecture. 
  </p><div class="procedure"><ol class="procedure" type="1"><li><p>
     Use the 32-bit compiler:
    </p><pre class="screen">CC="gcc -m32"</pre></li><li><p>
     Instruct the linker to process 32-bit objects (always use <span class="command"><strong>gcc</strong></span> as the
     linker front-end):
    </p><pre class="screen">LD="gcc -m32"</pre></li><li><p>
     Set the assembler to generate 32-bit objects:
    </p><pre class="screen">AS="gcc -c -m32"</pre></li><li><p>
     Specify linker flags, such as the location of 32-bit libraries, for
     example:
    </p><pre class="screen">LDFLAGS="-L/usr/lib"</pre></li><li><p>
     Specify the location for the 32-bit object code libraries:
    </p><pre class="screen">--libdir=/usr/lib</pre></li><li><p>
     Specify the location for the 32-bit X libraries:
    </p><pre class="screen">--x-libraries=/usr/lib</pre></li></ol></div><p>
   Not all of these variables are needed for every program. Adapt them to
   the respective program.
  </p><pre class="screen">CC="gcc -m32"
LDFLAGS="-L/usr/lib;"
./configure --prefix=/usr --libdir=/usr/lib --x-libraries=/usr/lib
make
make install</pre></div><div class="sect1" title="15.4. Kernel Specifications"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.64bit.kernel"></a>15.4. Kernel Specifications<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.64bit.kernel">¶</a></span></h2></div></div></div><a class="indexterm" name="id459808"></a><p>
   The 64-bit kernels for x86_64 offer both a 64-bit and a 32-bit kernel ABI
   (application binary interface). The latter is identical with the ABI for
   the corresponding 32-bit kernel. This means that the 32-bit application
   can communicate with the 64-bit kernel in the same way as with the 32-bit
   kernel.
  </p><p>
   The 32-bit emulation of system calls for a 64-bit kernel does not support
   all the APIs used by system programs. This depends on the platform. For
   this reason, a small number of applications, like
   <span class="command"><strong>lspci</strong></span>, must be compiled.
  </p><p>
   A 64-bit kernel can only load 64-bit kernel modules that have been
   specially compiled for this kernel. It is not possible to use 32-bit
   kernel modules.
  </p><div class="tip"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Tip: Kernel-loadable Modules"><tr class="head"><td width="32"><img alt="[Tip]" src="admon/tip.png"></td><th align="left">Kernel-loadable Modules</th></tr><tr><td colspan="2" align="left" valign="top"><p>
    Some applications require separate kernel-loadable modules. If you
    intend to use such a 32-bit application in a 64-bit system environment,
    contact the provider of this application and Novell to make sure that
    the 64-bit version of the kernel-loadable module and the 32-bit compiled
    version of the kernel API are available for this module.
   </p></td></tr></table></div></div></div><div class="navfooter"><table width="100%" summary="Navigation footer" border="0" class="bctable"><tr><td width="80%"><div class="breadcrumbs"><p><a href="index.html"> Documentation</a><span class="breadcrumbs-sep"> &gt; </span><a href="book.opensuse.reference.html">Reference</a><span class="breadcrumbs-sep"> &gt; </span><a href="part.reference.system.html">System</a><span class="breadcrumbs-sep"> &gt; </span><strong><a accesskey="p" title="Part IV. System" href="part.reference.system.html"><span>&#9664;</span></a>  <a accesskey="n" title="Chapter 16. Booting and Configuring a Linux System" href="cha.boot.html"><span>&#9654;</span></a></strong></p></div></td></tr></table></div></body></html>

ACC SHELL 2018