on 30/05/2012 14:23 Andriy Gapon said the following:
> I think that the problem is that -mssse3 must be passed to a compiler when
> compiling skia_opts_ssse3 target and then everything would compile as it 
> should.
> But for some reason that is not done.
> I suspect some problem is the .gyp file or gyp utility or somewhere else.
> E.g. if I add an non-existing flag '-favg-avg' in the same cflags list where
> '-mssse3' is specified, then the -favg-avg flag appears in the generated
> skia/skia_opts_ssse3.target.mk file.  But -mssse3 doesn't appear there...
> What 'eats' it I don't know yet.

I think that this must be it:
build/common.gypi has this snippet:

>     # FreeBSD-specific options; note that most FreeBSD options are set above, 
>                                                                               
>                                              
>     # with Linux.                                                             
>                                                                               
>                                              
>     ['OS=="freebsd"', {                                                       
>                                                                               
>                                              
>       'target_defaults': {                                                    
>                                                                               
>                                              
>         'ldflags': [                                                          
>                                                                               
>                                              
>           '-Wl,--no-keep-memory',                                             
>                                                                               
>                                              
>         ],                                                                    
>                                                                               
>                                              
>         'ldflags!': [                                                         
>                                                                               
>                                              
>           '-ldl',                                                             
>                                                                               
>                                              
>           '-pie',                                                             
>                                                                               
>                                              
>         ],                                                                    
>                                                                               
>                                              
>         'libraries!': [                                                       
>                                                                               
>                                              
>           '-ldl',                                                             
>                                                                               
>                                              
>         ],                                                                    
>                                                                               
>                                              
>         'conditions': [                                                       
>                                                                               
>                                              
>           ['gcc_version == 42', {                                             
>                                                                               
>                                              
>             'cflags!': [                                                      
>                                                                               
>                                              
>               '-mssse3',                                                      
>                                                                               
>                                              
>               '-fno-signed-zeros',                                            
>                                                                               
>                                              
>               '-Wno-unused-result',                                           
>                                                                               
>                                              
>             ],                                                                
>                                                                               
>                                              
>           }],                                                                 
>                                                                               
>                                                      ],                       
>                                                                               
>                                                                               
>                   },                                                          
>                                                                               
>                                                          
>     }],

Note the cflags!: -mssse3 rule under gcc_version == 42 condition.
gcc_version is set by build/compiler_version.py, which is executed from
build/gyp_chromium.

gyp_chromium is executed in do-configure target.  The problem is that since this
is an override target, then no "usual" environment manipulations are done
auto-magically and thus CXX environment variable, if any, doesn't necessarily
reflect a real compiler that is selected for the build.  E.g. in my case it is
unset.  So compiler_version.py determines version of the base g++, which is 42!

I think that adding ${SETENV} CXX=${CXX} at the start of gyp_chromium command 
line
may fix the problem.
Testing now...

P.S.
Perhaps the simpler fix is to just drop that gcc_version == 42 conditional 
block.
But I think that it makes sense to correctly setup gyp environment in any case.
Perhaps it makes sense to reproduce the whole environment setup from the 
standard
do-configure target for gnu configure:
> ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \             
> CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
> LDFLAGS="${LDFLAGS}" \                                            
> INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \                     
> INSTALL_DATA="${INSTALL_DATA}" \                                  
> INSTALL_LIB="${INSTALL_LIB}" \                                    
> INSTALL_PROGRAM="${INSTALL_PROGRAM}" \                            
> INSTALL_SCRIPT="${INSTALL_SCRIPT}" \                              
> ${CONFIGURE_ENV} ...

But I am not sure about this.

-- 
Andriy Gapon
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-chromium
To unsubscribe, send any mail to "[email protected]"

Reply via email to