title: Why when gcc is built from source, libstdc++ is built for wrong architecture, 32bit, while 64 is expected?
body: <p>I am trying to compile lftp from source using gcc, compiler that I have also compiled from source under my home folder.
  On build step I get an error:</p>
  
  <pre><code>/bin/sh ../libtool --silent  --tag=CXX   --mode=link g++  -O2 -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines -export-dynamic -s -o lftp lftp-lftp.o lftp-complete.o lftp-lftp_rl.o lftp-attach.o liblftp-jobs.la liblftp-tasks.la -L/usr/lib -lreadline -lutil -lncurses -ldl 
  /gsa/pokgsa/home/l/e/leonidt/local/lib/../lib/libstdc++.so: error      adding symbols: File in wrong format
  </code></pre>
  
  <p>collect2: error: ld returned 1 exit status
  make[2]: <strong>* [lftp] Error 1
  make[2]: Leaving directory <code>/gsa/pokgsa-h3/19/leonidt/local/lftp-4.8.4/src'
  make[1]: *** [install-recursive] Error 1
  make[1]: Leaving directory</code>/gsa/pokgsa-h3/19/leonidt/local/lftp-4.8.4'
  make: *</strong> [install] Error 2</p>
  
  <p>So looks like <strong>compiler was built with libstdc++.so for wrong architecture?</strong></p>
  
  <p>I tried to check what's in libstdc++.so:</p>
  
  <pre><code>file /gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so
  /gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so: symbolic link to `libstdc++.so.6.0.27'
  
  file /gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so.6.0.27                    
  /gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so.6.0.27: **ELF 32-bit** MSB shared object, IBM S/390, version 1 (GNU/Linux), dynamically linked, not stripped
  </code></pre>
  
  <p>Below are the steps I did to build gcc in my local folder:</p>
  
  <pre><code> cd ~/local 
  </code></pre>
  
  <p>Uncompressed the gcc-9.2.0.tar.xz
  got ~/local/gcc-9.2.0 created with gcc source </p>
  
  <pre><code>cd ../gcc-9.2.0/
  </code></pre>
  
  <p>Downloaded prerequisites</p>
  
  <p>contrib/download_prerequisites</p>
  
  <p>cd ~/local/gcc-build</p>
  
  <p>../gcc-9.2.0/configure --prefix /gsa/pokgsa/home/l/e/leonidt/local/ --enable-languages=c,c++  </p>
  
  <p>I am on SuSe Linux:</p>
  
  <pre><code>uname -a
  </code></pre>
  
  <p>Linux zdsdeveng03 3.0.101-108.84-default #1 SMP Fri Nov 30 15:57:27 UTC 2018 (7a72692) s390x s390x s390x GNU/Linux</p>
  
  <pre><code>cat /etc/os-release                                                                                     NAME="SLES"           
  VERSION="11.4"
  VERSION_ID="11.4"
  PRETTY_NAME="SUSE Linux Enterprise Server 11 SP4"
  ID="sles"
  ANSI_COLOR="0;32"
  CPE_NAME="cpe:/o:suse:sles:11:4"
  </code></pre>