From f9c00aaee6d94e404ce43bc2003cb239a8308193 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 14 Apr 2020 09:40:27 -0400 Subject: [PATCH 1/9] For gcc use response file under Windows as well as forward slash paths. --- src/tools/gcc.jam | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 5ceb038fc..a83f8f122 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -1100,11 +1100,31 @@ rule link ( targets * : sources * : properties * ) quote-rpath $(targets) ; } +if [ os.name ] in NT +{ +.nl = " +" ; +} + +if [ os.name ] in NT +{ + +actions link bind LIBRARIES +{ + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<:WT)" @"@($(<[1]:WT).rsp:E=$(.nl)$(START-GROUP) $(.nl)"$(>:WT)" $(.nl)"$(LIBRARIES)" $(.nl)$(FINDLIBS-ST-PFX) $(.nl)-l$(FINDLIBS-ST) $(.nl)$(FINDLIBS-SA-PFX) $(.nl)-l$(FINDLIBS-SA) $(.nl)$(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +} +else +{ + actions link bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } +} + rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; @@ -1112,12 +1132,28 @@ rule link.dll ( targets * : sources * : properties * ) quote-rpath $(targets) ; } +if [ os.name ] in NT +{ + +# Differs from 'link' above only by -shared. +actions link.dll bind LIBRARIES +{ + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1]:WT)" -o "$(<[-1]:WT)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared @"@($(<[1]:WT).rsp:E=$(.nl)$(START-GROUP) $(.nl)"$(>:WT)" $(.nl)"$(LIBRARIES)" $(.nl)$(FINDLIBS-ST-PFX) $(.nl)-l$(FINDLIBS-ST) $(.nl)$(FINDLIBS-SA-PFX) $(.nl)-l$(FINDLIBS-SA) $(.nl)$(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +} +else +{ + # Differs from 'link' above only by -shared. actions link.dll bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } +} + + ### ### Archive library generation. ### From 580298696871a6ad80f6556e8c4a0323f35f8444 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 14 Apr 2020 18:52:07 -0400 Subject: [PATCH 2/9] Use response files for gcc on Windows and clang targeting gcc on Windows. Use forward slashes for the response file names and paths in the response files. Remove irreleavnt RPATH and SONAME usages in the actions of linking and linking a DLL. --- src/tools/clang-linux.jam | 26 +++++++++++++++++++++----- src/tools/gcc.jam | 38 ++++++++++---------------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index fd753e136..8754a549d 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -17,6 +17,7 @@ import errors ; import generators ; import type ; import numbers ; +import os ; feature.extend-subfeature toolset clang : platform : linux ; @@ -207,17 +208,32 @@ rule link ( targets * : sources * : properties * ) { JAM_SEMAPHORE on $(targets) = clang-linux-link-semaphore ; } -actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) -} - rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = clang-linux-link-semaphore ; } -# Differ from 'link' above only by -shared. +if [ os.name ] in NT +{ + +actions link bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +actions link.dll bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" -shared @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +} +else +{ + +actions link bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) +} + actions link.dll bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } +} diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index a83f8f122..f29a788b8 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -1100,10 +1100,11 @@ rule link ( targets * : sources * : properties * ) quote-rpath $(targets) ; } -if [ os.name ] in NT +rule link.dll ( targets * : sources * : properties * ) { -.nl = " -" ; + SPACE on $(targets) = " " ; + JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; + quote-rpath $(targets) ; } if [ os.name ] in NT @@ -1111,7 +1112,12 @@ if [ os.name ] in NT actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<:WT)" @"@($(<[1]:WT).rsp:E=$(.nl)$(START-GROUP) $(.nl)"$(>:WT)" $(.nl)"$(LIBRARIES)" $(.nl)$(FINDLIBS-ST-PFX) $(.nl)-l$(FINDLIBS-ST) $(.nl)$(FINDLIBS-SA-PFX) $(.nl)-l$(FINDLIBS-SA) $(.nl)$(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +actions link.dll bind LIBRARIES +{ + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" -shared @"@($(<[-1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } } @@ -1123,29 +1129,6 @@ actions link bind LIBRARIES "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } -} - -rule link.dll ( targets * : sources * : properties * ) -{ - SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; - quote-rpath $(targets) ; -} - -if [ os.name ] in NT -{ - -# Differs from 'link' above only by -shared. -actions link.dll bind LIBRARIES -{ - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1]:WT)" -o "$(<[-1]:WT)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared @"@($(<[1]:WT).rsp:E=$(.nl)$(START-GROUP) $(.nl)"$(>:WT)" $(.nl)"$(LIBRARIES)" $(.nl)$(FINDLIBS-ST-PFX) $(.nl)-l$(FINDLIBS-ST) $(.nl)$(FINDLIBS-SA-PFX) $(.nl)-l$(FINDLIBS-SA) $(.nl)$(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) -} - -} -else -{ - -# Differs from 'link' above only by -shared. actions link.dll bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) @@ -1153,7 +1136,6 @@ actions link.dll bind LIBRARIES } - ### ### Archive library generation. ### From cc1245b9e306a23a9265dc6d10684178187a5995 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 14 Apr 2020 23:19:16 -0400 Subject: [PATCH 3/9] Create linking specifically for gcc/mingw(-64) on Windows. --- src/tools/gcc.jam | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index f29a788b8..ed77d40e3 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -831,14 +831,14 @@ g = [ new gcc-linking-generator gcc.mingw.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : gcc windows ] ; -$(g).set-rule-name gcc.link ; +$(g).set-rule-name gcc.link.mingw ; generators.register $(g) ; g = [ new gcc-linking-generator gcc.mingw.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : IMPORT_LIB SHARED_LIB : gcc windows ] ; -$(g).set-rule-name gcc.link.dll ; +$(g).set-rule-name gcc.link.dll.mingw ; generators.register $(g) ; generators.register @@ -1107,23 +1107,31 @@ rule link.dll ( targets * : sources * : properties * ) quote-rpath $(targets) ; } -if [ os.name ] in NT +rule link.mingw ( 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 + # good idea to serialize all links. + JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; +} -actions link bind LIBRARIES +rule link.dll.mingw ( targets * : sources * : properties * ) +{ + SPACE on $(targets) = " " ; + JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; +} + +actions link.mingw bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } -actions link.dll bind LIBRARIES +actions link.dll.mingw bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" -shared @"@($(<[-1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } -} -else -{ - actions link bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) @@ -1134,8 +1142,6 @@ actions link.dll bind LIBRARIES "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } -} - ### ### Archive library generation. ### From 2627ef3a85e482fda23132fee4470918248edb37 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 15 Apr 2020 22:12:45 -0400 Subject: [PATCH 4/9] Create cross-platform linking for clang-linux. Update embarcadero to use its own named JAM_SEMAPHORE. --- src/tools/clang-linux.jam | 90 +++++++++++++++++++++++++++++++++++++-- src/tools/embarcadero.jam | 4 +- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index 8754a549d..c37105cdc 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -18,6 +18,7 @@ import generators ; import type ; import numbers ; import os ; +import property ; feature.extend-subfeature toolset clang : platform : linux ; @@ -206,34 +207,115 @@ SPACE = " " ; rule link ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = clang-linux-link-semaphore ; + + local tosw ; + local pselect = [ property.select : $(properties) ] ; + + if $(pselect) + { + + local tosv = [ feature.get-values : $(pselect) ] ; + + if $(tosv) = windows + { + tosw = 1 ; + } + } + else if [ os.name ] in NT + { + tosw = 1 ; + } + if $(tosw) + { + link-w $(targets) : $(sources) ; + } + else + { + link-o $(targets) : $(sources) ; + } } rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = clang-linux-link-semaphore ; + + local tosw ; + local pselect = [ property.select : $(properties) ] ; + + if $(pselect) + { + + local tosv = [ feature.get-values : $(pselect) ] ; + + if $(tosv) = windows + { + tosw = 1 ; + } + } + else if [ os.name ] in NT + { + tosw = 1 ; + } + if $(tosw) + { + link.dll-w $(targets) : $(sources) ; + } + else + { + link.dll-o $(targets) : $(sources) ; + } } if [ os.name ] in NT { -actions link bind LIBRARIES { +# All the links on Windows use a response file because of Windows line limit issues + +# Target OS is not Windows, needs the RPATH stuff +actions link-o bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +# Target OS is not Windows, needs the RPATH and SONAME stuff +actions link.dll-o bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) +} + +# Target OS is Windows, does not need the RPATH stuff +actions link-w bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } -actions link.dll bind LIBRARIES { +# Target OS is Windows, does not need the RPATH and SONAME stuff +actions link.dll-w bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" -shared @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) + } } else { -actions link bind LIBRARIES { +# None of the links on non-Windows need a response file + +# Target OS is not Windows, needs the RPATH stuff +actions link-o bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } -actions link.dll bind LIBRARIES { +# Target OS is not Windows, needs the RPATH and SONAME stuff +actions link.dll-o bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } +# Target OS is Windows, does not need the RPATH stuff +actions link-w bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) +} + +# Target OS is Windows, does not need the RPATH and SONAME stuff +actions link.dll-w bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) +} + } diff --git a/src/tools/embarcadero.jam b/src/tools/embarcadero.jam index 003dc5b1d..c9d51d86e 100644 --- a/src/tools/embarcadero.jam +++ b/src/tools/embarcadero.jam @@ -592,11 +592,11 @@ actions updated together piecemeal archive } rule link ( targets * : sources * : properties * ) { - JAM_SEMAPHORE on $(targets) = clang-linux-link-semaphore ; + JAM_SEMAPHORE on $(targets) = embarcadero-link-semaphore ; } rule link.dll ( targets * : sources * : properties * ) { - JAM_SEMAPHORE on $(targets) = clang-linux-link-semaphore ; + JAM_SEMAPHORE on $(targets) = embarcadero-link-semaphore ; } actions link bind LIBRARIES { From 3c06be3d2f3cb0743fa9a6eb133094e0eaf1f2e6 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Sat, 2 May 2020 00:37:39 -0400 Subject: [PATCH 5/9] Updated fies. --- src/tools/clang-linux.jam | 38 ++-------------------- test/toolset-mock/src/clang-linux-3.9.0.py | 21 ++++++------ 2 files changed, 14 insertions(+), 45 deletions(-) diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index c37105cdc..d5c9ed744 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -1,3 +1,4 @@ +# Copyright 2020 Rene Rivera # Copyright (c) 2003 Michael Stevens # Copyright (c) 2010-2011 Bryce Lelbach (blelbach@cct.lsu.edu, maintainer) # @@ -266,19 +267,14 @@ rule link.dll ( targets * : sources * : properties * ) { } } -if [ os.name ] in NT -{ - -# All the links on Windows use a response file because of Windows line limit issues - # Target OS is not Windows, needs the RPATH stuff actions link-o bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @"@($(<[1]:T).rsp:E=-Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" $(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } # Target OS is not Windows, needs the RPATH and SONAME stuff actions link.dll-o bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @"@($(<[1]:T).rsp:E=-Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } # Target OS is Windows, does not need the RPATH stuff @@ -291,31 +287,3 @@ actions link.dll-w bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" -shared @"@($(<[1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS) } - -} -else -{ - -# None of the links on non-Windows need a response file - -# Target OS is not Windows, needs the RPATH stuff -actions link-o bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) -} - -# Target OS is not Windows, needs the RPATH and SONAME stuff -actions link.dll-o bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) -} - -# Target OS is Windows, does not need the RPATH stuff -actions link-w bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) -} - -# Target OS is Windows, does not need the RPATH and SONAME stuff -actions link.dll-w bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) -} - -} diff --git a/test/toolset-mock/src/clang-linux-3.9.0.py b/test/toolset-mock/src/clang-linux-3.9.0.py index 242d25624..c37be259f 100644 --- a/test/toolset-mock/src/clang-linux-3.9.0.py +++ b/test/toolset-mock/src/clang-linux-3.9.0.py @@ -1,6 +1,7 @@ #!/usr/bin/python # # Copyright 2017 Steven Watanabe +# Copyright 2020 Rene Rivera # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at @@ -13,36 +14,36 @@ command('clang++', '-print-prog-name=ranlib', stdout=script('ranlib.py')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/libl1.so.rsp'), unordered('-g', '-fPIC')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) - command('clang++', '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-o', output_file('bin/clang-linux-3.9.0/debug/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/main.o'), input_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug/test.rsp'), unordered('-g', '-fPIC')) if allow_properties('variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-fPIC', '-Wl,--strip-all')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/libl1.so'), arg_file('@bin/clang-linux-3.9.0/release/strip-on/libl1.so.rsp'), unordered('-fPIC', '-Wl,--strip-all')) command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/main.o'), input_file(source='main.cpp')) - command('clang++', '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/release/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/release/libl1.so')), '-o', output_file('bin/clang-linux-3.9.0/release/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/main.o'), input_file('bin/clang-linux-3.9.0/release/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-fPIC', '-Wl,--strip-all')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), arg_file('@bin/clang-linux-3.9.0/release/strip-on/test.rsp'), unordered('-fPIC', '-Wl,--strip-all')) if allow_properties('variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/threading-multi/libl1.so.rsp'), unordered('-g', '-pthread', '-fPIC')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file(source='main.cpp')) - command('clang++', '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so')), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), arg_file('@bin/clang-linux-3.9.0/debug/threading-multi/test.rsp'), unordered('-g', '-pthread', '-fPIC')) if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/lib.o'), input_file(source='lib.cpp')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file('bin/clang-linux-3.9.0/debug/link-static/libl1.a'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-g') + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static/test.rsp'), '-g') if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/libl1.a'), '-Wl,--end-group', unordered('-g', '-static')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test.rsp'), unordered('-g', '-static')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/libl1.so.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) - command('clang++', '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-o', output_file('bin/clang-linux-3.9.0/debug/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/main.o'), input_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/test.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) main() From 2f914d1acfdde076f11707eaafb99b84881ad98d Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 13 May 2020 16:41:07 -0400 Subject: [PATCH 6/9] Use nasm as the 64-bit assembler --- src/tools/embarcadero.jam | 51 +++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/src/tools/embarcadero.jam b/src/tools/embarcadero.jam index c9d51d86e..2ad845883 100644 --- a/src/tools/embarcadero.jam +++ b/src/tools/embarcadero.jam @@ -81,6 +81,15 @@ is not used to initialize the toolset. Specifies the user interface for applications. Valid choices are `console` for a console applicatiuon and `gui` for a Windows application. +`asm64`:: +Specifies the full file spec of the `nasm` assembler to be used in 64-bit builds. +The `nasm` assembler is not distributed by Embarcadero but may be downloaded +from `https://www.nasm.us/`. If this option is not specified it is assumed that +the `nasm` assembler can be invoked directly without a full filespec, so most +probably in that case it will be in the Windows PATH. For the 32-bit assembler +the `tasm32` assembler distributed by Embarcadero as part of their compiler will +be used, and does not have to be specified. + `root`:: Normallly Boost Build will automatically be able to determine the root of the Embarcadero C++ installation. It does this in various ways, but primarily @@ -391,6 +400,9 @@ rule init ( version ? : command * : options * ) local archiver ; local arflags ; local implib ; + local assembler ; + local asmflags ; + local asmoutput ; if $(compiler) = bcc32x { @@ -399,14 +411,38 @@ rule init ( version ? : command * : options * ) archiver = tlib ; arflags = /P512 ; implib = implib ; + assembler = $(root)/bin/tasm32 ; + + # /ml makes all symbol names case-sensitive + + asmflags = /ml ; + asmoutput = "," ; } else if $(compiler) = bcc64 { + lib_dir_release = $(root)/lib/win64/release $(root)/lib/win64/release/psdk ; lib_dir_debug = $(root)/lib/win64/debug ; archiver = tlib64 ; arflags = /P2048 ; implib = mkexp ; + + local asm64 = [ feature.get-values : $(options) ] ; + + if $(asm64) + { + assembler = $(asm64) ; + } + else + { + assembler = nasm ; + } + + # -t is tasm compatibility + # -f elf64 is ELF 64-bit format + + asmflags = -t -f elf64 ; + asmoutput = "-o" ; } flags embarcadero.compile .EMB_SYSINC $(condition) : $(system_include_option)$(system_include_directories) ; @@ -414,7 +450,9 @@ rule init ( version ? : command * : options * ) flags embarcadero.link LINKPATH $(condition)/debug : $(lib_dir_debug) $(lib_dir_release) ; flags embarcadero.archive .AR $(condition) : $(root)/bin/$(archiver) ; flags embarcadero.archive .ARFLAGS $(condition) : $(arflags) ; - flags embarcadero.asm .TASM $(condition) : $(root)/bin/tasm32 ; + flags embarcadero.asm .ASM $(condition) : $(assembler) ; + flags embarcadero.asm .ASMFLAGS $(condition) : $(asmflags) ; + flags embarcadero.asm .ASMOUTPUT $(condition) : $(asmoutput) ; flags embarcadero.asm USER_OPTIONS $(condition) : [ feature.get-values : $(options) ] ; flags embarcadero.archive AROPTIONS $(condition) : [ feature.get-values : $(options) ] ; flags embarcadero.link.dll .IMPLIB_COMMAND $(condition) : $(root)/bin/$(implib) ; @@ -505,15 +543,15 @@ local rule handle-options ( condition * : command * : options * ) $(condition:E=(empty)) ; } - toolset.flags embarcadero CONFIG_COMMAND $(condition) : $(command) ; + flags embarcadero CONFIG_COMMAND $(condition) : $(command) ; - toolset.flags embarcadero.compile OPTIONS $(condition) : + flags embarcadero.compile OPTIONS $(condition) : [ feature.get-values : $(options) ] ; - toolset.flags embarcadero.compile.c++ OPTIONS $(condition) : + flags embarcadero.compile.c++ OPTIONS $(condition) : [ feature.get-values : $(options) ] ; - toolset.flags embarcadero.link OPTIONS $(condition) : + flags embarcadero.link OPTIONS $(condition) : [ feature.get-values : $(options) ] ; } @@ -611,8 +649,7 @@ rule asm ( targets * : sources * : properties * ) { } -# /ml makes all symbol names case-sensitive actions asm { - $(.TASM) /ml $(USER_OPTIONS) "$(>)" "$(<)" + $(.ASM) $(.ASMFLAGS) $(USER_OPTIONS) "$(>)" $(.ASMOUTPUT) "$(<)" } From 06adb9c6fe8e897f7633750f0801019f5296258e Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 13 May 2020 20:32:45 -0400 Subject: [PATCH 7/9] Updated the 64-bit assembler to use the built-in one in bcc64. --- src/tools/embarcadero.jam | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/src/tools/embarcadero.jam b/src/tools/embarcadero.jam index 2b6489942..c54a1ef5e 100644 --- a/src/tools/embarcadero.jam +++ b/src/tools/embarcadero.jam @@ -81,15 +81,6 @@ is not used to initialize the toolset. Specifies the user interface for applications. Valid choices are `console` for a console applicatiuon and `gui` for a Windows application. -`asm64`:: -Specifies the full file spec of the `nasm` assembler to be used in 64-bit builds. -The `nasm` assembler is not distributed by Embarcadero but may be downloaded -from `https://www.nasm.us/`. If this option is not specified it is assumed that -the `nasm` assembler can be invoked directly without a full filespec, so most -probably in that case it will be in the Windows PATH. For the 32-bit assembler -the `tasm32` assembler distributed by Embarcadero as part of their compiler will -be used, and does not have to be specified. - `root`:: Normallly Boost Build will automatically be able to determine the root of the Embarcadero C++ installation. It does this in various ways, but primarily @@ -428,23 +419,6 @@ rule init ( version ? : command * : options * ) archiver = tlib64 ; arflags = /P2048 ; implib = mkexp ; - - local asm64 = [ feature.get-values : $(options) ] ; - - if $(asm64) - { - assembler = $(asm64) ; - } - else - { - assembler = nasm ; - } - - # -t is tasm compatibility - # -f elf64 is ELF 64-bit format - - asmflags = -t -f elf64 ; - asmoutput = "-o" ; } flags embarcadero.compile .EMB_SYSINC $(condition) : $(system_include_option)$(system_include_directories) ; @@ -573,7 +547,8 @@ generators.register-linker embarcadero.link.dll : OBJ SEARCHED_LIB STATIC_LIB IM generators.register-archiver embarcadero.archive : OBJ : STATIC_LIB : embarcadero ; generators.register-c-compiler embarcadero.compile.c++ : CPP : OBJ : embarcadero ; generators.register-c-compiler embarcadero.compile.c : C : OBJ : embarcadero ; -generators.register-standard embarcadero.asm : ASM : OBJ : embarcadero ; +generators.register-c-compiler embarcadero.compile.asm : ASM : OBJ : embarcadero 64 ; +generators.register-standard embarcadero.asm : ASM : OBJ : embarcadero 32 ; # Flags @@ -655,3 +630,13 @@ actions asm { $(.ASM) $(.ASMFLAGS) $(USER_OPTIONS) "$(>)" $(.ASMOUTPUT) "$(<)" } + +rule compile.asm ( targets * : sources * : properties * ) +{ + LANG on $(<) = "-x assembler-with-cpp" ; +} + +actions compile.asm +{ + "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} From e1b30dddd9db79bb455e18a0ae9b9074b619fb78 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 13 May 2020 23:22:10 -0400 Subject: [PATCH 8/9] Corrected version checking. A version like 14.2xxx, where xxx is a non-number, has always been allowed to distinguish different setups of the same version or versions that do not differ by version number but do differ in implementation, such as 14.2 and 14.2 preview. --- src/tools/msvc.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 90c296229..07c2bc536 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -459,14 +459,14 @@ rule configure-version-specific ( toolset : version : conditions ) # 12.0 (VS2013 Update 2) introduced /Zc:inline opt-in standard conformance # compiler flag that also similar to linker /opt:ref removes unreferenced # variables and functions that have internal linkage - if ! [ version.version-less [ SPLIT_BY_CHARACTERS $(version) : . ] : 12 ] + if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 12 ] { toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:inline" ; } # 14.0 introduced /Zc:throwingNew opt-in flag that disables a workaround # for not throwing operator new in VC up to 6.0 - if ! [ version.version-less [ SPLIT_BY_CHARACTERS $(version) : . ] : 14 ] + if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 ] { toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:throwingNew" ; } From 992e1044ba11d6c6018efc883679d4e2071016c5 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 4 Jun 2020 22:21:11 -0400 Subject: [PATCH 9/9] Using latest clang-linux-3.9.0.py. Corrected msvc.jam once again. --- src/tools/msvc.jam | 2 +- test/toolset-mock/src/clang-linux-3.9.0.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 92d54cd36..7e9653c18 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -524,7 +524,7 @@ rule configure-version-specific ( toolset : version : conditions ) toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-arm) : "/MACHINE:ARM" ; toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-arm64) : "/MACHINE:ARM64" ; - if [ version.version-less [ SPLIT_BY_CHARACTERS $(version) : . ] : 11 ] + if [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 11 ] { # Make sure that manifest will be generated even if there is no # dependencies to put there. diff --git a/test/toolset-mock/src/clang-linux-3.9.0.py b/test/toolset-mock/src/clang-linux-3.9.0.py index c37be259f..02d28db54 100644 --- a/test/toolset-mock/src/clang-linux-3.9.0.py +++ b/test/toolset-mock/src/clang-linux-3.9.0.py @@ -14,36 +14,36 @@ command('clang++', '-print-prog-name=ranlib', stdout=script('ranlib.py')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/libl1.so.rsp'), unordered('-g', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug*/libl1.so.rsp'), unordered('-g', '-fPIC')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug/test.rsp'), unordered('-g', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug*/test.rsp'), unordered('-g', '-fPIC')) if allow_properties('variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/libl1.so'), arg_file('@bin/clang-linux-3.9.0/release/strip-on/libl1.so.rsp'), unordered('-fPIC', '-Wl,--strip-all')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/libl1.so'), arg_file('@bin/clang-linux-3.9.0/release/strip-on*/libl1.so.rsp'), unordered('-fPIC', '-Wl,--strip-all')) command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), arg_file('@bin/clang-linux-3.9.0/release/strip-on/test.rsp'), unordered('-fPIC', '-Wl,--strip-all')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), arg_file('@bin/clang-linux-3.9.0/release/strip-on*/test.rsp'), unordered('-fPIC', '-Wl,--strip-all')) if allow_properties('variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/threading-multi/libl1.so.rsp'), unordered('-g', '-pthread', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug*/threading-multi/libl1.so.rsp'), unordered('-g', '-pthread', '-fPIC')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), arg_file('@bin/clang-linux-3.9.0/debug/threading-multi/test.rsp'), unordered('-g', '-pthread', '-fPIC')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), arg_file('@bin/clang-linux-3.9.0/debug*/threading-multi/test.rsp'), unordered('-g', '-pthread', '-fPIC')) if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/lib.o'), input_file(source='lib.cpp')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static/test.rsp'), '-g') + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static*/test.rsp'), '-g') if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test.rsp'), unordered('-g', '-static')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test'), arg_file('@bin/clang-linux-3.9.0/debug/link-static/runtime-link-static*/test.rsp'), unordered('-g', '-static')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/libl1.so.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86*/libl1.so.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/test.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), arg_file('@bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86*/test.rsp'), unordered('-g', '-march=i686', '-fPIC', '-m32')) main()