From b116fbaeba12230fc16becf76f14d7a860b2d9b5 Mon Sep 17 00:00:00 2001 From: Richard Dale Date: Fri, 6 Dec 2013 12:55:33 -0600 Subject: [PATCH] Support shared libraries in cray builds. --- src/tools/cray.jam | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/tools/cray.jam b/src/tools/cray.jam index a37fe23b2..a7d3b51c3 100644 --- a/src/tools/cray.jam +++ b/src/tools/cray.jam @@ -1,6 +1,7 @@ # Copyright 2001 David Abrahams. # Copyright 2004, 2005 Markus Schoepflin. # Copyright 2011, John Maddock +# Copyright 2013, Cray, Inc. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) @@ -47,24 +48,31 @@ generators.register-c-compiler cray.compile.c++ : CPP : OBJ : cray ; generators.register-c-compiler cray.compile.c : C : OBJ : cray ; - -# No static linking as far as I can tell. +# unlike most compliers, Cray defaults to static linking. # flags cxx LINKFLAGS static : -bstatic ; -flags cray.compile OPTIONS on : -Gn ; -flags cray.link OPTIONS on : -Gn ; +flags cray.compile OPTIONS on : -G0 ; +flags cray.link OPTIONS on : -G0 ; flags cray.compile OPTIONS off : -O0 ; -flags cray.compile OPTIONS speed : -O3 ; +flags cray.compile OPTIONS speed : -O2 ; flags cray.compile OPTIONS space : -O1 ; +# flags cray.compile OPTIONS off : -hipa0 ; +# flags cray.compile OPTIONS on : ; +# flags cray.compile OPTIONS full : -hipa5 ; + flags cray.compile OPTIONS ; flags cray.compile.c++ OPTIONS ; flags cray.compile DEFINES ; flags cray.compile INCLUDES ; flags cray.link OPTIONS ; -flags cray.compile OPTIONS shared : -fPIC ; -flags cray.link OPTIONS shared : -fPIC ; +flags cray.compile OPTIONS : -hgnu -fPIC -h system_alloc -h tolerant -h ipa0 ; +flags cray.compile OPTIONS shared : -dynamic ; +flags cray.compile OPTIONS static : -static ; +flags cray.link OPTIONS static : -static ; +flags cray.link OPTIONS shared : ; +flags cray.link LOPTIONS shared : -dynamic ; flags cray.link LIBPATH ; flags cray.link LIBRARIES ; @@ -73,7 +81,7 @@ flags cray.link FINDLIBS-SA ; actions link bind LIBRARIES { - $(CONFIG_COMMAND) $(OPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) + $(CONFIG_COMMAND) $(OPTIONS) $(LOPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) } # When creating dynamic libraries, we don't want to be warned about unresolved @@ -83,7 +91,7 @@ actions link bind LIBRARIES actions link.dll bind LIBRARIES { - $(CONFIG_COMMAND) -shared $(OPTIONS) -o "$(<[1])" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) + $(CONFIG_COMMAND) -o "$(<[1])" -Wl,-h -Wl,$(<[-1]:D=) -shared -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) } @@ -103,7 +111,7 @@ actions compile.c actions compile.c++ { - $(CONFIG_COMMAND) -c -h gnu $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)" + $(CONFIG_COMMAND) -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)" } # Always create archive from scratch. See the gcc toolet for rationale.