From c6dca91367cf0e4410691f203c47d3d900b8599b Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 11:13:33 -0400 Subject: [PATCH 1/9] Add basic support to build and test VxWorks with b2 jam files ( requires special handling of shared library paths in a cross build enviorment) --- src/tools/features/os-feature.jam | 2 +- src/tools/testing.jam | 31 +++++++++++++++++++++++++++---- src/util/os.jam | 5 +++++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/tools/features/os-feature.jam b/src/tools/features/os-feature.jam index b9c3c0f94..abeb39bf3 100644 --- a/src/tools/features/os-feature.jam +++ b/src/tools/features/os-feature.jam @@ -11,7 +11,7 @@ import os ; .os-names = aix android appletv bsd cygwin darwin freebsd haiku hpux iphone linux - netbsd openbsd osf qnx qnxnto sgi solaris unix unixware windows vms + netbsd openbsd osf qnx qnxnto sgi solaris unix unixware windows vms vxworks # Not actually an OS -- used for targeting bare metal where object # format is ELF. This catches both -elf and -eabi gcc targets as well diff --git a/src/tools/testing.jam b/src/tools/testing.jam index 0f6359d20..d9190ea6e 100644 --- a/src/tools/testing.jam +++ b/src/tools/testing.jam @@ -410,9 +410,13 @@ rule run-path-setup ( target : source : properties * ) # test are found. So, we collect all paths from dependency libraries (via # xdll-path property) and add whatever explicit dll-path user has specified. # The resulting paths are added to the environment on each test invocation. + local target-os = [ feature.get-values : $(properties) ] ; local dll-paths = [ feature.get-values : $(properties) ] ; dll-paths += [ feature.get-values : $(properties) ] ; - dll-paths += [ on $(source) return $(RUN_PATH) ] ; + if $(target-os) != vxworks + { + dll-paths += [ on $(source) return $(RUN_PATH) ] ; + } dll-paths = [ sequence.unique $(dll-paths) ] ; if $(dll-paths) { @@ -421,9 +425,28 @@ rule run-path-setup ( target : source : properties * ) { translate-to-os = path.to-VMS ; } - dll-paths = [ sequence.transform $(translate-to-os) : $(dll-paths) ] ; - PATH_SETUP on $(target) = [ common.prepend-path-variable-command - [ os.shared-library-path-variable ] : $(dll-paths) ] ; + if $(target-os) = vxworks + { + # map paths to paths + local save-os = [ modules.peek os : .name ] ; + modules.poke os : .name : VXWORKS ; + local parent = [ os.environ PKG_SRC_BUILD_DIR ] ; + local prefix = [ os.environ LAYER_SRC_PATH ] ; + local target-dll-paths ; + for local e in $(dll-paths) + { + target-dll-paths += [ path.join $(prefix) [ path.relative $(e) $(parent) : noerror ] ] ; + } + PATH_SETUP on $(target) = [ common.prepend-path-variable-command + [ os.shared-library-path-variable ] : $(target-dll-paths) ] ; + modules.poke os : .name : $(save-os) ; + } + else + { + dll-paths = [ sequence.transform path.native : $(dll-paths) ] ; + PATH_SETUP on $(target) = [ common.prepend-path-variable-command + [ os.shared-library-path-variable ] : $(dll-paths) ] ; + } } } diff --git a/src/util/os.jam b/src/util/os.jam index 7a5ef08dc..1700c8358 100644 --- a/src/util/os.jam +++ b/src/util/os.jam @@ -65,6 +65,7 @@ if $(.name) = NT # constant whose value would be the same as the default, below. .shared-library-path-variable-NT = $(.executable-path-variable-NT) ; .path-separator-NT = ";" ; +.path-separator-VXWORKS = ";" ; .expand-variable-prefix-NT = % ; .expand-variable-suffix-NT = % ; .executable-suffix-NT = .exe ; @@ -83,6 +84,10 @@ if $(.name) = NT .expand-variable-suffix-VMS = ' ; .executable-suffix-VMS = .exe ; +# VxWorks uses the default LD_LIBRARY_PATH, but we need an alternate +# name on the cross build host to propigate to the target system +.shared-library-path-variable-VXWORKS = VSB_LD_LIBRARY_PATH ; + # Default constants .shared-library-path-variable = LD_LIBRARY_PATH ; .path-separator = ":" ; From 73b60a8d7481313d79562947bef732c424a9bd50 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 11:15:20 -0400 Subject: [PATCH 2/9] Add diab.jam to support building VxWorks with Wind River's Diab compiler with b2 --- src/tools/diab.jam | 130 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 src/tools/diab.jam diff --git a/src/tools/diab.jam b/src/tools/diab.jam new file mode 100644 index 000000000..e8c596ea2 --- /dev/null +++ b/src/tools/diab.jam @@ -0,0 +1,130 @@ +# Copyright 2015, Wind River 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) + +# +# Diab C++ Compiler +# + +import feature generators common ; +import toolset : flags ; +import os ; + +feature.extend toolset : diab ; + +# Inherit from Unix toolset to get library ordering magic. +toolset.inherit diab : unix ; + +generators.override diab.prebuilt : builtin.lib-generator ; +generators.override diab.prebuilt : builtin.prebuilt ; +generators.override diab.searched-lib-generator : searched-lib-generator ; + + +rule init ( version ? : command * : options * ) +{ + local condition = [ common.check-init-parameters diab : version $(version) ] ; + + local command = [ common.get-invocation-command diab : dcc : $(command) ] ; + + if $(command) + { + local root = [ common.get-absolute-tool-path $(command[-1]) ] ; + + if $(root) + { + flags diab .root linux : "\"$(root)\"/" ; + flags diab .root windows : $(root:T)/ ; + } + } + # If we can't find 'CC' anyway, at least show 'CC' in the commands + command ?= CC ; + + common.handle-options diab : $(condition) : $(command) : $(options) ; +} + +generators.register-c-compiler diab.compile.c++ : CPP : OBJ : diab ; +generators.register-c-compiler diab.compile.c : C : OBJ : diab ; + + +# unlike most compliers, Diab defaults to static linking. +# flags cxx LINKFLAGS static : ; +flags diab.compile OPTIONS on : -g ; +flags diab.link OPTIONS on : -g ; + +flags diab.compile OPTIONS off : ; +flags diab.compile OPTIONS speed : -speed ; +flags diab.compile OPTIONS space : -size ; + +# flags diab.compile OPTIONS off : -Xinline=0 ; +# flags diab.compile OPTIONS on : -Xinline=10 ; +# flags diab.compile OPTIONS full : -Xinline=50 ; + +flags diab.compile OPTIONS ; +flags diab.compile.c++ OPTIONS ; +flags diab.compile DEFINES ; + +flags diab.compile.c++ OPTIONS off : -Xno-exceptions ; +# So Dinkum STL knows when exceptions are disabled +flags diab.compile DEFINES off : _NO_EX=1 ; +flags diab.compile INCLUDES ; +flags diab.link OPTIONS ; + +flags diab.compile OPTIONS shared : -Xpic ; +#flags diab.compile OPTIONS static : ; +# get VxWorks link options from shell enviorment +flags diab.link OPTIONS static : [ os.environ LDFLAGS_STATIC ] ; +flags diab.link.dll OPTIONS : [ os.environ LDFLAGS_SO ] ; +flags diab.link OPTIONS shared : [ os.environ LDFLAGS_DYNAMIC ] ; + +flags diab.link LOPTIONS shared : -Xdynamic -Xshared -Xpic ; + +flags diab.link LIBPATH ; +flags diab.link LIBRARIES ; +flags diab.link FINDLIBS-ST ; +flags diab.link FINDLIBS-SA ; + +actions link bind LIBRARIES +{ + $(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 +# symbols, therefore all unresolved symbols are marked as expected by +# '-expect_unresolved *'. This also mirrors the behaviour of the GNU tool +# chain. + +actions link.dll bind LIBRARIES +{ + $(.root:E=)dplus $(OPTIONS) $(LOPTIONS) "$(LIBRARIES)" -o "$(<[1])" -L$(LIBPATH) "$(>)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) +} + +#rule compile.asm ( targets * : sources * : properties * ) +#{ +# setup-fpic $(targets) : $(sources) : $(properties) ; +# setup-address-model $(targets) : $(sources) : $(properties) ; +#} + +actions compile.asm +{ + "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + + + +actions compile.c +{ + $(.root:E=)dcc -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)" +} + +actions compile.c++ +{ + $(.root:E=)dplus -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)" +} + +# Always create archive from scratch. See the gcc toolet for rationale. +RM = [ common.rm-command ] ; +actions together piecemeal archive +{ + $(RM) "$(<)" + dar rc $(<) $(>) +} From 39f8866c2f47fe3b7060b5d33cab65600652a7b5 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 11:25:55 -0400 Subject: [PATCH 3/9] Update gcc.jam with support for building VxWorks --- src/tools/gcc.jam | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index a8ab0ecf1..9d8d39bf6 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -166,6 +166,11 @@ rule init ( version ? : command * : options * ) local bin ; # The compiler flavor. local flavor = [ feature.get-values : $(options) ] ; + # vxworks build on windows uses csh that is neither mingw or cygwin + if [ feature.get-values : $(options) ] = vxworks + { + flavor ?= vxworks ; + } # Autodetect the root and bin dir if not given. if $(command) { @@ -288,9 +293,10 @@ rule .get-prog-name ( command-string : tool : flavor ? ) { local prog-name = [ NORMALIZE_PATH [ MATCH "(.*)[\n]+" : [ SHELL "$(command-string) -print-prog-name=$(tool)" ] ] ] ; - if $(flavor) != mingw && [ os.name ] = NT + + if !($(flavor) = vxworks || $(flavor) = mingw) && [ os.name ] = NT { - prog-name = [ cygwin.cygwin-to-windows-path $(prog-name) ] ; + prog-name = [ cygwin.cygwin-to-windows-path $(prog-name) ] ; } return $(prog-name) ; } @@ -396,6 +402,8 @@ toolset.flags gcc.compile OPTIONS on : -pg ; toolset.flags gcc.compile.c++ OPTIONS off : -fno-rtti ; toolset.flags gcc.compile.c++ OPTIONS off : -fno-exceptions ; +# tell Dinkum STL exceptions are off +toolset.flags gcc.compile.c++ DEFINES off/vxworks : _NO_EX=1 ; rule setup-fpic ( targets * : sources * : properties * ) { @@ -808,6 +816,14 @@ rule init-link-flags ( toolset linker condition ) toolset.flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; + case vxworks : + # On VxWorks we want to reflect what ever special flags have been set in the + # environment for the CPU we are targeting in the cross build + toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,--strip-all : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/static : [ os.environ LDFLAGS_STATIC ] : unchecked ; + toolset.flags $(toolset).link.dll OPTIONS $(condition) : [ os.environ LDFLAGS_SO ] : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/shared : [ os.environ LDFLAGS_DYNAMIC ] : unchecked ; + case gnu : # Strip the binary when no debugging is needed. We use --strip-all flag # as opposed to -s since icc (intel's compiler) is generally @@ -1035,6 +1051,7 @@ rule setup-threading ( targets * : sources * : properties * ) case *bsd : option = -pthread ; # There is no -lrt on BSD. case sgi : # gcc on IRIX does not support multi-threading. case darwin : # No threading options. + case vxworks : # No threading options. case * : option = -pthread ; libs = rt ; } From 8c793fc56a25d76fa77bacd30db5a4874ff12df8 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 11:37:06 -0400 Subject: [PATCH 4/9] 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) +} From 83dbca18b3d589d747809e324b095a62efae8634 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 11:42:24 -0400 Subject: [PATCH 5/9] Add clang-vxworks.jam to support building VxWorks with the LLVM compiler using b2 --- src/tools/clang-vxworks.jam | 151 ++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 src/tools/clang-vxworks.jam diff --git a/src/tools/clang-vxworks.jam b/src/tools/clang-vxworks.jam new file mode 100644 index 000000000..203a3a320 --- /dev/null +++ b/src/tools/clang-vxworks.jam @@ -0,0 +1,151 @@ +# Copyright Brian Kuhl 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 clang ; +import feature : feature get-values ; +import os ; +import toolset ; +import toolset : flags ; +import gcc ; +import common ; +import errors ; +import generators ; + + +feature.extend-subfeature toolset clang : platform : vxworks ; + +toolset.inherit-generators clang-vxworks + clang 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 clang-vxworks.prebuilt : builtin.lib-generator ; +generators.override clang-vxworks.prebuilt : builtin.prebuilt ; +generators.override clang-vxworks.searched-lib-generator : searched-lib-generator ; + + +toolset.inherit-rules clang-vxworks : gcc ; +toolset.inherit-flags clang-vxworks : gcc + : off on full space + off all on + x86/32 + x86/64 + ; + +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} + +# vectorization diagnostics +feature vectorize : off on full ; + +# Initializes the clang-vxworks toolset +# version in optional +# compile and link options allow you to specify addition command line options for each version +rule init ( version ? : command * : options * ) +{ + command = [ common.get-invocation-command clang-vxworks : ccllvm + : $(command) ] ; + + linker = [ get-values : $(options) ] ; + linker ?= ld ; + + # Determine the version + local command-string = $(command:J=" ") ; + if $(command) + { + version ?= [ MATCH "^([0-9.]+)" + : [ SHELL "$(command-string) -dumpversion" ] ] ; + } + + local condition = [ common.check-init-parameters clang-vxworks + : version $(version) ] ; + + common.handle-options clang-vxworks : $(condition) : $(command) : $(options) ; + + gcc.init-link-flags clang-vxworks vxworks $(condition) ; + + toolset.flags clang-vxworks.link .LD : $(linker) ; +} + +SPACE = " " ; + +toolset.flags clang-vxworks.compile OPTIONS ; +toolset.flags clang-vxworks.compile.c++ OPTIONS ; +toolset.flags clang-vxworks.compile INCLUDES ; + +# Declare flags and action for compilation. +toolset.flags clang-vxworks.compile OPTIONS off : -O0 ; +toolset.flags clang-vxworks.compile OPTIONS speed : -O3 ; +toolset.flags clang-vxworks.compile OPTIONS space : -Os ; + +# For clang, 'on' and 'full' are identical +toolset.flags clang-vxworks.compile OPTIONS off : -fno-inline ; +toolset.flags clang-vxworks.compile OPTIONS on : -Wno-inline ; +toolset.flags clang-vxworks.compile OPTIONS full : -Wno-inline ; + +toolset.flags clang-vxworks.compile OPTIONS off : -w ; +toolset.flags clang-vxworks.compile OPTIONS on : -Wall ; +toolset.flags clang-vxworks.compile OPTIONS all : -Wall -pedantic ; +toolset.flags clang-vxworks.compile OPTIONS on : -Werror ; + +toolset.flags clang-vxworks.compile OPTIONS on : -g ; +toolset.flags clang-vxworks.compile OPTIONS on : -pg ; +toolset.flags clang-vxworks.compile OPTIONS off : -fno-rtti ; + +toolset.flags clang-vxworks.compile OPTIONS ; + + +actions compile.c +{ + "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +actions compile.c++ +{ + "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + + + +flags clang-vxworks ARFLAGS ; + +# Default value. Mostly for the sake of clang-linux +# that inherits from gcc, but does not has the same +# logic to set the .AR variable. We can put the same +# logic in clang-linux, but that's hardly worth the trouble +# as on Linux, 'ar' is always available. +.AR = ar ; + + +actions piecemeal archive +{ + "$(.AR)" $(AROPTIONS) rcu "$(<)" "$(>)" +} + +flags clang-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) = clang-vxworks-link-semaphore ; +} + +actions link bind LIBRARIES +{ + "$(.LD)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) + } + +actions link.dll bind LIBRARIES +{ + "$(.LD)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) -fpic -shared -non-static +} From 7931b9a1d06fc8bbe60b74aa9674ca6d2fa67451 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Wed, 16 Aug 2017 12:14:36 -0400 Subject: [PATCH 6/9] fix up dll-paths argument (preserve special logic for VMS ) --- src/tools/testing.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/testing.jam b/src/tools/testing.jam index d9190ea6e..55576f136 100644 --- a/src/tools/testing.jam +++ b/src/tools/testing.jam @@ -410,7 +410,7 @@ rule run-path-setup ( target : source : properties * ) # test are found. So, we collect all paths from dependency libraries (via # xdll-path property) and add whatever explicit dll-path user has specified. # The resulting paths are added to the environment on each test invocation. - local target-os = [ feature.get-values : $(properties) ] ; + local target-os = [ feature.get-values : $(properties) ] ; local dll-paths = [ feature.get-values : $(properties) ] ; dll-paths += [ feature.get-values : $(properties) ] ; if $(target-os) != vxworks @@ -443,7 +443,7 @@ rule run-path-setup ( target : source : properties * ) } else { - dll-paths = [ sequence.transform path.native : $(dll-paths) ] ; + dll-paths = [ sequence.transform $(translate-to-os) : $(dll-paths) ] ; PATH_SETUP on $(target) = [ common.prepend-path-variable-command [ os.shared-library-path-variable ] : $(dll-paths) ] ; } From f655db884de4ce46b29922c688512ebedd351654 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Fri, 1 Sep 2017 23:05:01 -0400 Subject: [PATCH 7/9] fix up bad merge --- src/tools/gcc.jam | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 924ae248f..a3e218cbe 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -1022,12 +1022,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) OPTIONS on $(targets) += -static ; } -<<<<<<< HEAD case vxworks : - -======= - case vxworks : ->>>>>>> 75beb798ab1f71bb3b93ba2cbc79be371881b55a # On VxWorks we want to reflect what ever special flags have been set in the # environment for the CPU we are targeting in the cross build toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,--strip-all : unchecked ; @@ -1035,11 +1030,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) toolset.flags $(toolset).link.dll OPTIONS $(condition) : [ os.environ LDFLAGS_SO ] : unchecked ; toolset.flags $(toolset).link OPTIONS $(condition)/shared : [ os.environ LDFLAGS_DYNAMIC ] : unchecked ; -<<<<<<< HEAD case gnu : -======= - case gnu : ->>>>>>> 75beb798ab1f71bb3b93ba2cbc79be371881b55a # Strip the binary when no debugging is needed. We use --strip-all flag # as opposed to -s since icc (intel's compiler) is generally @@ -1286,7 +1277,6 @@ actions piecemeal archive ### CPU architecture and instruction set options. ### - case vxworks : # No threading options. local rule cpu-flags ( toolset variable : architecture : instruction-set + : values + : default ? ) { From afd3834c4990e5d4fba95adaabd70d017876c927 Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Fri, 1 Sep 2017 23:05:01 -0400 Subject: [PATCH 8/9] fix up bad merge --- src/tools/gcc.jam | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 924ae248f..84aaf4aeb 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -1022,12 +1022,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) OPTIONS on $(targets) += -static ; } -<<<<<<< HEAD case vxworks : - -======= - case vxworks : ->>>>>>> 75beb798ab1f71bb3b93ba2cbc79be371881b55a # On VxWorks we want to reflect what ever special flags have been set in the # environment for the CPU we are targeting in the cross build toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,--strip-all : unchecked ; @@ -1035,11 +1030,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) toolset.flags $(toolset).link.dll OPTIONS $(condition) : [ os.environ LDFLAGS_SO ] : unchecked ; toolset.flags $(toolset).link OPTIONS $(condition)/shared : [ os.environ LDFLAGS_DYNAMIC ] : unchecked ; -<<<<<<< HEAD case gnu : -======= - case gnu : ->>>>>>> 75beb798ab1f71bb3b93ba2cbc79be371881b55a # Strip the binary when no debugging is needed. We use --strip-all flag # as opposed to -s since icc (intel's compiler) is generally @@ -1114,7 +1105,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) OPTIONS on $(targets) += -static ; } - case hpux : + case hpux : if on in $(properties) { @@ -1128,7 +1119,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) HAVE_SONAME on $(targets) += "" ; SONAME_OPTION on $(targets) += +h ; - case osf : + case osf : # No --strip-all, just -s. OPTIONS @@ -1146,7 +1137,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) OPTIONS on $(targets) += -static ; } - case sun : + case sun : if on in $(properties) { @@ -1172,7 +1163,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) if static in $(properties) { OPTIONS on $(targets) += -static ; - } + } } # [1] @@ -1286,7 +1277,6 @@ actions piecemeal archive ### CPU architecture and instruction set options. ### - case vxworks : # No threading options. local rule cpu-flags ( toolset variable : architecture : instruction-set + : values + : default ? ) { From d938b005671d8f12796674a5dee27befafdf648e Mon Sep 17 00:00:00 2001 From: Brian Kuhl Date: Fri, 1 Sep 2017 23:14:51 -0400 Subject: [PATCH 9/9] whitespace --- src/tools/gcc.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 84aaf4aeb..5786dd301 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -818,7 +818,7 @@ class gcc-linking-generator : unix-linking-generator { case vms : no-static-link = ; case windows : no-static-link = ; - } + } local properties = [ $(property-set).raw ] ; local reason ; @@ -969,7 +969,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) switch $(linker-type:G=) { - case aix : + case aix : # On AIX we *have* to use the native linker. # @@ -1005,7 +1005,7 @@ rule set-link-options ( action-name targets + : sources * : properties * ) OPTIONS on $(targets) += -static ; } - case darwin : + case darwin : # On Darwin, the -s option to ld does not work unless we pass -static, # and passing -static unconditionally is a bad idea. So, do not pass -s