|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53510 - trunk/tools/build/v2/tools
From: ghost_at_[hidden]
Date: 2009-05-31 14:49:12
Author: vladimir_prus
Date: 2009-05-31 14:49:11 EDT (Sun, 31 May 2009)
New Revision: 53510
URL: http://svn.boost.org/trac/boost/changeset/53510
Log:
Make address-model take effect even if architecture is not specified.
It seems more ultimately helpful to directly translate address-model
to -m32/-m64 on gcc, since that option works fine even if -march is
not specified.
Text files modified:
trunk/tools/build/v2/tools/gcc.jam | 50 ++++++++++++++++++++++++++++++++-------
trunk/tools/build/v2/tools/intel-linux.jam | 6 ++++
2 files changed, 47 insertions(+), 9 deletions(-)
Modified: trunk/tools/build/v2/tools/gcc.jam
==============================================================================
--- trunk/tools/build/v2/tools/gcc.jam (original)
+++ trunk/tools/build/v2/tools/gcc.jam 2009-05-31 14:49:11 EDT (Sun, 31 May 2009)
@@ -349,6 +349,40 @@
}
}
+rule setup-address-model ( targets * : sources * : properties * )
+{
+ local model = [ feature.get-values address-model : $(properties) ] ;
+ if $(model)
+ {
+ local option ;
+ local os = [ feature.get-values target-os : $(properties) ] ;
+ if $(os) = aix
+ {
+ if $(model) = 32
+ {
+ option = -maix32 ;
+ }
+ else
+ {
+ option = -maix64 ;
+ }
+ }
+ else
+ {
+ if $(model) = 32
+ {
+ option = -m32 ;
+ }
+ else
+ {
+ option = -m64 ;
+ }
+ }
+ OPTIONS on $(targets) += $(option) ;
+ }
+}
+
+
# FIXME: this should not use os.name.
if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] != AIX
{
@@ -369,6 +403,7 @@
{
setup-threading $(targets) : $(sources) : $(properties) ;
setup-fpic $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
}
actions compile.c++.pch
@@ -380,6 +415,7 @@
{
setup-threading $(targets) : $(sources) : $(properties) ;
setup-fpic $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
}
actions compile.c.pch
@@ -391,6 +427,7 @@
{
setup-threading $(targets) : $(sources) : $(properties) ;
setup-fpic $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
# Some extensions are compiled as C++ by default. For others, we need to
# pass -x c++. We could always pass -x c++ but distcc does not work with it.
@@ -420,6 +457,7 @@
{
setup-threading $(targets) : $(sources) : $(properties) ;
setup-fpic $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
# If we use the name g++ then default file suffix -> language mapping does
# not work. So have to pass -x option. Maybe, we can work around this by
@@ -745,6 +783,7 @@
rule link ( targets * : sources * : properties * )
{
setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
# Serialize execution of the 'link' action, since running N links in
# parallel is just slower. For now, serialize only gcc links, it might be a
@@ -809,6 +848,7 @@
rule link.dll ( targets * : sources * : properties * )
{
setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
}
@@ -896,8 +936,6 @@
# Set architecture/instruction-set options.
#
# x86 and compatible
-toolset.flags gcc OPTIONS <architecture>x86/<address-model>32 : -m32 ;
-toolset.flags gcc OPTIONS <architecture>x86/<address-model>64 : -m64 ;
cpu-flags gcc OPTIONS : x86 : i386 : -march=i386 : default ;
cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ;
cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ;
@@ -931,8 +969,6 @@
cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ;
cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ;
# Sparc
-toolset.flags gcc OPTIONS <architecture>sparc/<address-model>32 : -m32 ;
-toolset.flags gcc OPTIONS <architecture>sparc/<address-model>64 : -m64 ;
cpu-flags gcc OPTIONS : sparc : c3 : -mcpu=c3 : default ;
cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 ;
cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ;
@@ -949,8 +985,6 @@
cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ;
cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ;
# RS/6000 & PowerPC
-toolset.flags gcc OPTIONS <architecture>power/<address-model>32 : -m32 ;
-toolset.flags gcc OPTIONS <architecture>power/<address-model>64 : -m64 ;
cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ;
cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ;
cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ;
@@ -984,6 +1018,4 @@
cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ;
cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ;
# AIX variant of RS/6000 & PowerPC
-toolset.flags gcc OPTIONS <architecture>power/<address-model>32/<target-os>aix : -maix32 ;
-toolset.flags gcc OPTIONS <architecture>power/<address-model>64/<target-os>aix : -maix64 ;
-toolset.flags gcc AROPTIONS <architecture>power/<address-model>64/<target-os>aix : "-X 64" ;
+toolset.flags gcc AROPTIONS <address-model>64/<target-os>aix : "-X 64" ;
Modified: trunk/tools/build/v2/tools/intel-linux.jam
==============================================================================
--- trunk/tools/build/v2/tools/intel-linux.jam (original)
+++ trunk/tools/build/v2/tools/intel-linux.jam 2009-05-31 14:49:11 EDT (Sun, 31 May 2009)
@@ -112,6 +112,7 @@
{
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
}
@@ -124,6 +125,7 @@
{
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
}
@@ -136,6 +138,7 @@
{
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
}
#
# Compiling a pch first deletes any existing *.pchi file, as Intel's compiler
@@ -151,6 +154,7 @@
{
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
}
actions compile.c.pch
@@ -161,6 +165,7 @@
rule link ( targets * : sources * : properties * )
{
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
}
@@ -173,6 +178,7 @@
rule link.dll ( targets * : sources * : properties * )
{
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk