Opened 9 years ago

Last modified 9 years ago

#9791 new Bugs

[libs/program_options] winmain.cpp fails to compile with -O3, ok with -O0 (gcc-5666.3)

Reported by: class101 <ad@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: ad@…

Description

Hello

I have identified a problem when cross-compiling libs\program_options\src\winmain.cpp with Apple's gcc-5666.3 (4.2.1) and the -O3/2/1 switches, it works fine with -O0

"X:/libs/gcc-5666.3-x86_64-apple-darwin10/bin/g++.exe"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -m32 -w -m32 -DBOOST_ALL_NO_LIB=1 -DNDEBUG  -I"." -c -o "bin.v2\libs\program_options\build\gcc-4.2.1\release\abi-sysv\address-model-32\binary-format-mach-o\link-static\strip-on\target-os-darwin\threadapi-pthread\threading-multi\winmain.o" "libs\program_options\src\winmain.cpp"

Unfortunately I don't have any more logs but I have uploaded the gcc-5666.3-x86_64-apple-darwin10.tar.xz on my googledrive if you want to give a shot by yourself https://drive.google.com/folderview?id=0B4dcRcayW88VNmRtZDEybEZoLTQ&usp=sharing

Change History (2)

comment:1 by class101 <ad@…>, 9 years ago

Little addition: -O3 works fine with address-model=64 (-m64) but fails with address-model=32 (-m32)

Command used:

b2 -j10 -d0 toolset=gcc variant=release abi=sysv address-model=32 binary-format=mach-o link=static,shared pch=off strip=on target-os=darwin threading=multi threadapi=pthread cxxflags="-w -m32" linkflags="-w -m32 -lstdc++" --without-python --without-mpi --prefix=x:/libs/boost-1_56 --libdir=x:/libs/boost-1_56/lib --includedir=x:/libs install

Config used:

import option ;

using gcc :
: "X:/libs/gcc-5666.3-x86_64-apple-darwin10/bin/g++.exe"
: <archiver>X:/libs/gcc-5666.3-x86_64-apple-darwin10/bin/ar.exe
  <ranlib>X:/libs/gcc-5666.3-x86_64-apple-darwin10/bin/ranlib.exe
  <rc>X:/libs/gcc-5666.3-x86_64-apple-darwin10/bin/as.exe
  <linker-type>darwin 
;

option.set keep-going : false ;

comment:2 by class101 <ad@…>, 9 years ago

There is a high chance you cannot reproduce this bug, because the gcc-5666.3 I'm using is not 100% from Apple, it is a crosscompiler with patch applied on it, for example I couldn't generate muliarch fat binaries due to a bug in the cross compiler version on Windows

When if you can't reproduce this on the official gcc-5666.3 then disregard and close this ticket because won't be fixable on your end.

Note: See TracTickets for help on using tickets.