title: Regex Boost library linking in release mode warns "duplicate section has different size" when using mingw-w64 toolchain
body: <p>When linking my project in the release mode I am getting the following warning:</p>
  
  <pre><code>myProject-libs/release/libboost_regex-mt-s-1.50.0.a(cpp_regex_traits.o): duplicate section `.data$_ZZN5boost16cpp_regex_traitsIcE21get_catalog_name_instEvE6s_name[boost::cpp_regex_traits&lt;char&gt;::get_catalog_name_inst()::s_name]' has different size
  </code></pre>
  
  <p>I suspect that the cause could be that the boost library is compiled with different options than I use for my project, but I don't know how to find the difference (boost didn't output these options during the build).</p>
  
  <p>In order to compile the boost for win32 on Ubuntu 12.04 I used this procedure:</p>
  
  <pre><code>tar jxf boost_1_50_0.tar.bz2
  cd boost_1_50_0
  ./bootstrap.sh
  echo "using gcc : 4.6 : i686-w64-mingw32-g++ : &lt;rc&gt;i686-w64-mingw32-windres &lt;archiver&gt;i686-w64-mingw32-ar ;" &gt; user-config.jam
  ./bjam toolset=gcc target-os=windows --address-model=32 variant=release threading=multi threadapi=win32 link=static runtime-link=static --prefix=/opt/boost_1_50_0-release-static-windows-32 --user-config=user-config.jam -j 10 --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged install
  </code></pre>
  
  <p>In order to compile files in my project I use something like</p>
  
  <pre><code>i686-w64-mingw32-g++ -march=corei7 -mfpmath=sse -m32 -Wall -fmessage-length=0 -I"/opt/boost_1_50_0-release-static-windows-32/include" -std=c++0x -O3 -g0 -DNDEBUG -I"myProject/src/cpp" -c -o myProject/build/release/src/cpp/myproject.o myproject/src/cpp/myproject.cpp
  </code></pre>
  
  <p>The tests I have indicate that the regexps run fine but still I would like to resolve the warning.</p>
  
  <p>EDIT</p>
  
  <p>I found that additional options to the boost compiler can be added using a cxxflags= argument of bjam.</p>
  
  <p>Example:
  bjam cxxflags='-fPIC' ....</p>
  
  <p>Maybe making sure to pass the same arguments as I do to the project could resolve the problem (particularly the arguments related to optimizations as suggested in the linked question).</p>