title: How to get "g++ -mx32" to work on RHEL 7.2
body: <p>I am new to x64_86, but forced to use it because RedHat dropped its 32-bit OS support in RHEL 7.x. I have to complile a lot of code, and am not ready to jump to x64 yet (because I do not need 64-bit addresses and do not want to face all related porting issues). So I have considered using -m32 and -mx32, and decided that -mx32 is the best route for me. However, while -m32 works fine on my build machine, when I use -mx32, I get this error:</p>
  
  <pre><code>In file included from /usr/include/features.h:399:0,
                   from /usr/include/string.h:25,
                   from zz.cpp:1:
  /usr/include/gnu/stubs.h:13:28: fatal error: gnu/stubs-x32.h: No such file or directory
   # include &lt;gnu/stubs-x32.h&gt;
                              ^
  compilation terminated.
  </code></pre>
  
  <p>I searched the web for solutions and some links indicate that I have to install some mysterious "multilib" rpms for g++ and gcc, however, I cannot find these anywhere. Others suggest that I have to install Linux in the x32 mode and build libgcc for x32, which sound extreme. Any ideas or leads? Did someone actually try g++ -mx32? Maybe it is not even supported on the RH platform... Thanks!</p>
  
  <p>P.S. In order to get the "-m32" option to work I had to install:</p>
  
  <pre><code>yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
  </code></pre>
  
  <p>This one fails (yum cannot find these RPMs) - allegedly these are required for -mx32 to work:</p>
  
  <pre><code>yum install gcc-multilib g++-multilib
  </code></pre>
  
  <p>:(</p>