From 8c793fc56a25d76fa77bacd30db5a4874ff12df8 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 11:37:06 -0400 Subject: [PATCH] Add intel-vxworks.jam to support building VxWorks with the Intel ICC compiler shipped with VxWorks --- src/tools/intel-vxworks.jam | 185 ++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 src/tools/intel-vxworks.jam diff --git a/src/tools/intel-vxworks.jam b/src/tools/intel-vxworks.jam new file mode 100644 index 000000000..8d9a3e3a0 --- /dev/null +++ b/src/tools/intel-vxworks.jam @@ -0,0 +1,185 @@ +# Copyright Wind River 2017. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt +# or copy at http://www.boost.org/LICENSE_1_0.txt) + +import intel ; +import feature : feature ; +import os ; +import toolset ; +import toolset : flags ; +import gcc ; +import common ; +import errors ; +import generators ; + +feature.extend-subfeature toolset intel : platform : vxworks ; + +toolset.inherit-generators intel-vxworks + intel vxworks + : gcc + # Don't inherit PCH generators. They were not tested, and probably + # don't work for this compiler. + : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch + ; + +generators.override intel-vxworks.prebuilt : builtin.lib-generator ; +generators.override intel-vxworks.prebuilt : builtin.prebuilt ; +generators.override intel-vxworks.searched-lib-generator : searched-lib-generator ; + +toolset.inherit-rules intel-vxworks : gcc ; +toolset.inherit-flags intel-vxworks : gcc + : off on full space + off all on + x86/32 + x86/64 + ; + +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} + +# Initializes the intel-vxworks toolset +# version in mandatory +# name (default icc) is used to invoke the specified intel complier +# compile and link options allow you to specify addition command line options for each version +rule init ( version ? : command * : options * ) +{ + local condition = [ common.check-init-parameters intel-vxworks + : version $(version) ] ; + + command = [ common.get-invocation-command intel-vxworks : icc + : $(command) : /opt/intel_cc_80/bin ] ; + + common.handle-options intel-vxworks : $(condition) : $(command) : $(options) ; + + gcc.init-link-flags intel-vxworks vxworks $(condition) ; + + # handle + # local library-path = [ feature.get-values : $(options) ] ; + # flags intel-vxworks.link USER_OPTIONS $(condition) : [ feature.get-values : $(options) ] ; + + local root = [ feature.get-values : $(options) ] ; + local bin ; + if $(command) || $(root) + { + bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; + root ?= $(bin:D) ; + + if $(root) + { + # Libraries required to run the executable may be in either + # $(root)/lib (10.1 and earlier) + # or + # $(root)/lib/architecture-name (11.0 and later: + local lib_path = $(root)/lib $(root:P)/lib/$(bin:B) ; + if $(.debug-configuration) + { + ECHO notice: using intel libraries :: $(condition) :: $(lib_path) ; + } + flags intel-vxworks.link RUN_PATH $(condition) : $(lib_path) ; + } + } + + local m = [ MATCH (..).* : $(version) ] ; + local n = [ MATCH (.)\\. : $(m) ] ; + if $(n) { + m = $(n) ; + } + + local major = $(m) ; + + + flags intel-vxworks.compile OPTIONS $(condition)/off : -inline-level=0 ; + flags intel-vxworks.compile OPTIONS $(condition)/on : -inline-level=1 ; + flags intel-vxworks.compile OPTIONS $(condition)/full : -inline-level=2 ; + + flags intel-vxworks.link OPTIONS $(condition)/static : [ os.environ LDFLAGS_STATIC ] ; + flags intel-vxworks.link OPTIONS $(condition)/shared : [ os.environ LDFLAGS_DYNAMIC ] ; + flags intel-vxworks.compile OPTIONS $(condition)/shared : -fPIC ; + + local minor = [ MATCH ".*\\.(.).*" : $(version) ] ; + + +} + +SPACE = " " ; + +flags intel-vxworks.compile OPTIONS ; +flags intel-vxworks.compile.c++ OPTIONS ; +flags intel-vxworks.compile INCLUDES ; + + +.cpu-type-em64t = prescott nocona core2 corei7 corei7-avx core-avx-i + conroe conroe-xe conroe-l allendale merom + merom-xe kentsfield kentsfield-xe penryn wolfdale + yorksfield nehalem sandy-bridge ivy-bridge haswell ; +.cpu-type-amd64 = k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 + athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 btver1 btver2 ; +.cpu-type-x86-64 = $(.cpu-type-em64t) $(.cpu-type-amd64) ; + +#flags intel-vxworks.compile OPTIONS $(.cpu-type-x86-64)/32 : -m32 ; # -mcmodel=small ; +#flags intel-vxworks.compile OPTIONS $(.cpu-type-x86-64)/64 : -m64 ; # -mcmodel=large ; + +flags intel-vxworks.compile.c OPTIONS off : -w0 ; +flags intel-vxworks.compile.c OPTIONS on : -w1 ; +flags intel-vxworks.compile.c OPTIONS all : -w2 ; + +flags intel-vxworks.compile.c++ OPTIONS off : -w0 ; +flags intel-vxworks.compile.c++ OPTIONS on : -w1 ; +flags intel-vxworks.compile.c++ OPTIONS all : -w2 ; + +actions compile.c +{ + "$(CONFIG_COMMAND)" -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +actions compile.c++ +{ + "$(CONFIG_COMMAND)" -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +flags intel-vxworks ARFLAGS ; + +.AR = ar ; + +rule archive ( targets * : sources * : properties * ) +{ + # Always remove archive and start again. + # of the archive. + # + local clean.a = $(targets[1])(clean) ; + TEMPORARY $(clean.a) ; + NOCARE $(clean.a) ; + LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ; + DEPENDS $(clean.a) : $(sources) ; + DEPENDS $(targets) : $(clean.a) ; + common.RmTemps $(clean.a) : $(targets) ; +} + +actions piecemeal archive +{ + "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)" +} + +flags intel-vxworks.link USER_OPTIONS ; + +# Declare actions for linking +rule link ( targets * : sources * : properties * ) +{ + SPACE on $(targets) = " " ; + # Serialize execution of the 'link' action, since + # running N links in parallel is just slower. + JAM_SEMAPHORE on $(targets) = intel-vxworks-link-semaphore ; +} + +actions link bind LIBRARIES +{ + "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) +} + +actions link.dll bind LIBRARIES +{ + "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) +}