From 598425e2946ca1796661974e64d48918fd7e0833 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 7 Jun 2020 08:07:08 -0500 Subject: [PATCH 001/126] Start of 64bit clean compile of b2 engine. --- src/engine/debug.cpp | 2 +- src/engine/debug.h | 2 +- src/engine/execcmd.cpp | 2 +- src/engine/execcmd.h | 2 +- src/engine/jam_strings.h | 4 ++-- src/engine/md5.cpp | 10 +++++----- src/engine/md5.h | 2 +- src/engine/object.cpp | 2 +- src/engine/object.h | 2 +- src/engine/pathnt.cpp | 10 +++++----- src/engine/pathsys.h | 2 +- src/engine/w32_getreg.cpp | 4 ++-- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/engine/debug.cpp b/src/engine/debug.cpp index 2a19e072bb..8fcf7e362e 100644 --- a/src/engine/debug.cpp +++ b/src/engine/debug.cpp @@ -73,7 +73,7 @@ void profile_enter( OBJECT * rulename, profile_frame * frame ) } -void profile_memory( long mem ) +void profile_memory( size_t mem ) { if ( DEBUG_PROFILE ) if ( profile_stack && profile_stack->info ) diff --git a/src/engine/debug.h b/src/engine/debug.h index d61faf450c..20824577e3 100644 --- a/src/engine/debug.h +++ b/src/engine/debug.h @@ -45,7 +45,7 @@ typedef struct profile_frame profile_frame * profile_init( OBJECT * rulename, profile_frame * ); void profile_enter( OBJECT * rulename, profile_frame * ); -void profile_memory( long mem ); +void profile_memory( size_t mem ); void profile_exit( profile_frame * ); void profile_dump(); double profile_clock(); diff --git a/src/engine/execcmd.cpp b/src/engine/execcmd.cpp index 8e6ec4f504..ecc554664f 100644 --- a/src/engine/execcmd.cpp +++ b/src/engine/execcmd.cpp @@ -75,7 +75,7 @@ void argv_from_shell( char const * * argv, LIST * shell, char const * command, * maximum. */ int check_cmd_for_too_long_lines( char const * command, size_t max, - int * const error_length, int * const error_max_length ) + size_t * const error_length, size_t * const error_max_length ) { while ( *command ) { diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index b39e8ae2dc..36f13aecf7 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -110,6 +110,6 @@ int is_raw_command_request( LIST * shell ); * are under the specified length limit. */ int check_cmd_for_too_long_lines( char const * command, size_t max, - int * const error_length, int * const error_max_length ); + size_t * const error_length, size_t * const error_max_length ); #endif diff --git a/src/engine/jam_strings.h b/src/engine/jam_strings.h index f47db10af7..8cfa119d00 100644 --- a/src/engine/jam_strings.h +++ b/src/engine/jam_strings.h @@ -14,8 +14,8 @@ typedef struct string { char * value; - unsigned long size; - unsigned long capacity; + size_t size; + size_t capacity; char opt[ 32 ]; #ifndef NDEBUG char magic[ 4 ]; diff --git a/src/engine/md5.cpp b/src/engine/md5.cpp index c35d96c5ef..2c53be85e9 100644 --- a/src/engine/md5.cpp +++ b/src/engine/md5.cpp @@ -320,25 +320,25 @@ md5_init(md5_state_t *pms) } void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +md5_append(md5_state_t *pms, const md5_byte_t *data, size_t nbytes) { const md5_byte_t *p = data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; + size_t left = nbytes; + size_t offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); if (nbytes <= 0) return; /* Update the message length. */ - pms->count[1] += nbytes >> 29; + pms->count[1] += md5_word_t(nbytes >> 29); pms->count[0] += nbits; if (pms->count[0] < nbits) pms->count[1]++; /* Process an initial partial block. */ if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes); memcpy(pms->buf + offset, p, copy); if (offset + copy < 64) diff --git a/src/engine/md5.h b/src/engine/md5.h index 698c995d8f..d76ddcf2cf 100644 --- a/src/engine/md5.h +++ b/src/engine/md5.h @@ -79,7 +79,7 @@ extern "C" void md5_init(md5_state_t *pms); /* Append a string to the message. */ -void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); +void md5_append(md5_state_t *pms, const md5_byte_t *data, size_t nbytes); /* Finish the message and return the digest. */ void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); diff --git a/src/engine/object.cpp b/src/engine/object.cpp index 07866baf46..90af921173 100644 --- a/src/engine/object.cpp +++ b/src/engine/object.cpp @@ -248,7 +248,7 @@ static void object_validate( OBJECT * obj ) * object_new_range() - create an object from a string of given length */ -OBJECT * object_new_range( char const * const string, int const size ) +OBJECT * object_new_range( char const * const string, size_t size ) { ++strcount_in; diff --git a/src/engine/object.h b/src/engine/object.h index 03fc0692b5..fe59319d2d 100644 --- a/src/engine/object.h +++ b/src/engine/object.h @@ -16,7 +16,7 @@ typedef struct _object OBJECT; OBJECT * object_new( char const * const ); -OBJECT * object_new_range( char const * const, int const size ); +OBJECT * object_new_range( char const * const, size_t size ); void object_done( void ); #if defined(NDEBUG) && !defined(BJAM_NO_MEM_CACHE) diff --git a/src/engine/pathnt.cpp b/src/engine/pathnt.cpp index 5b0cc4659e..51faf3d3d5 100644 --- a/src/engine/pathnt.cpp +++ b/src/engine/pathnt.cpp @@ -94,11 +94,11 @@ void path_get_temp_path_( string * buffer ) * - path_key_cache path/key mapping cache object already initialized */ -static int canonicWindowsPath( char const * const path, int const path_length, +static int canonicWindowsPath( char const * const path, size_t path_length, string * const out ) { char const * last_element; - unsigned long saved_size; + size_t saved_size; char const * p; int missing_parent; @@ -138,7 +138,7 @@ static int canonicWindowsPath( char const * const path, int const path_length, if ( p >= path ) { char const * const dir = path; - int const dir_length = p - path; + const size_t dir_length = p - path; OBJECT * const dir_obj = object_new_range( dir, dir_length ); int found; path_key_entry * const result = (path_key_entry *)hash_insert( @@ -170,7 +170,7 @@ static int canonicWindowsPath( char const * const path, int const path_length, if ( !missing_parent ) { char const * const n = last_element; - int const n_length = path + path_length - n; + size_t n_length = path + path_length - n; if ( !( n_length == 1 && n[ 0 ] == '.' ) && !( n_length == 2 && n[ 0 ] == '.' && n[ 1 ] == '.' ) ) { @@ -239,7 +239,7 @@ static path_key_entry * path_key( OBJECT * const path, if ( !found ) { OBJECT * normalized; - int normalized_size; + size_t normalized_size; path_key_entry * nresult; result->path = path; { diff --git a/src/engine/pathsys.h b/src/engine/pathsys.h index 839476e940..89fac645c9 100644 --- a/src/engine/pathsys.h +++ b/src/engine/pathsys.h @@ -29,7 +29,7 @@ typedef struct _pathpart { char const * ptr; - int len; + size_t len; } PATHPART; typedef struct _pathname diff --git a/src/engine/w32_getreg.cpp b/src/engine/w32_getreg.cpp index 1ba06274b4..9c83e212a2 100644 --- a/src/engine/w32_getreg.cpp +++ b/src/engine/w32_getreg.cpp @@ -43,7 +43,7 @@ static HKEY get_key(char const** path) for (p = dlRootKeys; p->name; ++p) { - int n = strlen(p->name); + size_t n = strlen(p->name); if (!strncmp(*path,p->name,n)) { if ((*path)[n] == '\\' || (*path)[n] == 0) @@ -87,7 +87,7 @@ LIST * builtin_system_registry( FRAME * frame, int flags ) while ( (len = ExpandEnvironmentStringsA( - (LPCSTR)data, expanded->value, expanded->capacity)) + (LPCSTR)data, expanded->value, (DWORD)expanded->capacity)) > expanded->capacity ) string_reserve(expanded, len); From c9e858223d199605dadbe88abb18df1be2ddf9fa Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 10 Jun 2020 18:19:24 -0500 Subject: [PATCH 002/126] Add some CI testing for 64bit warnings. --- azure-pipelines.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d6e34cfbeb..98a4f4f9da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -166,6 +166,12 @@ stages: echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} displayName: "No Warnings" + - bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} address-model=64 + displayName: "No-Warn 64bit" - bash: | set -e CXX_PATH=`which ${CXX}` @@ -212,6 +218,12 @@ stages: echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on toolset=$env:TEST_TOOLSET displayName: "No Warnings" + - powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on toolset=$env:TEST_TOOLSET address-model=64 + displayName: "No-Warn 64bit" - powershell: | $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH $env:path += ';' + $env:CXX_PATH @@ -313,6 +325,12 @@ stages: echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} displayName: "No Warnings" + - bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} address-model=64 + displayName: "No-Warn 64bit" - bash: | set -e CXX_PATH=`which ${CXX}` From 444e7f91d1deef1c29843d6db65195db2890ae2f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 28 Aug 2020 10:21:04 -0500 Subject: [PATCH 003/126] Tweaks to engine build. Fixes left over build residue. Supports using CXFLAGS during engine build. Add thread flags for building with gcc on AIX. --- .vscode/launch.json | 38 +++++++++++++++++++++++++++++++ src/engine/build.bat | 2 +- src/engine/build.sh | 54 ++++++++++++++++++++++++++++---------------- 3 files changed, 73 insertions(+), 21 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 608af29b10..227e0c62d2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,5 +16,43 @@ "externalConsole": true, "MIMode": "lldb" }, + { + "name": "(gdb) Launch: example/hello", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/.build/clang-linux-10.0.0/debug/cxxstd-11-iso/b2", + "args": ["-n", "toolset=clang"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}/example/hello", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) Launch: home/tmp/prebuild", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/.build/gcc-10.1.0/debug/cxxstd-11-iso/b2", + "args": ["-n","-sBOOST_BUILD_PATH=/home/grafik/Sync/DevRoots/B2/mainline/test/..","debug","release","-j1","-d2","toolset=gcc"], + "stopAtEntry": false, + "cwd": "/home/grafik/tmp/prebuilt-1", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, ] } \ No newline at end of file diff --git a/src/engine/build.bat b/src/engine/build.bat index 4360c31ccf..b466609b10 100644 --- a/src/engine/build.bat +++ b/src/engine/build.bat @@ -28,7 +28,7 @@ ECHO ### You can specify the toolset as the argument, i.e.: ECHO ### .\build.bat msvc ECHO ### ECHO ### Toolsets supported by this script are: borland, como, gcc, -ECHO ### gcc-nocygwin, intel-win32, metrowerks, mingw, +ECHO ### gcc-nocygwin, intel-win32, mingw, ECHO ### vc12, vc14, vc141, vc142 ECHO ### ECHO ### If you have Visual Studio 2017 installed you will need to either update diff --git a/src/engine/build.sh b/src/engine/build.sh index 565a9c4a69..dd82273a94 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -1,6 +1,6 @@ #!/bin/sh -#~ Copyright 2002-2019 Rene Rivera. +#~ Copyright 2002-2020 Rene Rivera. #~ 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) @@ -77,26 +77,32 @@ test_exec () # Check that the compiler can do C++11. test_cxx11 () { + local CXX=${CXX} + local CXXFLAGS=${CXXFLAGS} + if test ${NO_CXX_VARS} ; then + CXX= + CXXFLAGS= + fi if ! test $NO_CXX11_CHECK ; then case $1 in - gcc) ( ${CXX:=g++} -x c++ -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - intel-darwin) ( ${CXX:=icc} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - intel-linux) ( ${CXX:=icc} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - vacpp) ( ${CXX:=xlC_r} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - xlcpp) ( ${CXX:=xlC_r} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - como) ( ${CXX:=como} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - kcc) ( ${CXX:=KCC} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - kylix) ( ${CXX:=bc++} -tC -q check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - mipspro) ( ${CXX:=CC} -FE:template_in_elf_section -ptused check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - pathscale) ( ${CXX:=pathCC} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - pgi) ( ${CXX:=pgc++} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - sun*) ( ${CXX:=CC} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - clang*) ( ${CXX:=clang++} -x c++ -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - tru64cxx) ( ${CXX:=cc} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - acc) ( ${CXX:=aCC} -AA check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - qcc) ( ${CXX:=QCC} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - cxx) ( ${CXX:=cxx} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - cross-cxx) ( ${CXX:=cxx} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + gcc) ( ${CXX:=g++} ${CXXFLAGS} -x c++ -std=c++11 -c check_cxx11.cpp && rm -f check_cxx11.o* ) 1>/dev/null 2>/dev/null ;; + intel-darwin) ( ${CXX:=icc} ${CXXFLAGS} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + intel-linux) ( ${CXX:=icc} ${CXXFLAGS} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + vacpp) ( ${CXX:=xlC_r} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + xlcpp) ( ${CXX:=xlC_r} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + como) ( ${CXX:=como} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + kcc) ( ${CXX:=KCC} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + kylix) ( ${CXX:=bc++} ${CXXFLAGS} -tC -q check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + mipspro) ( ${CXX:=CC} ${CXXFLAGS} -FE:template_in_elf_section -ptused check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + pathscale) ( ${CXX:=pathCC} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + pgi) ( ${CXX:=pgc++} ${CXXFLAGS} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + sun*) ( ${CXX:=CC} ${CXXFLAGS} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + clang*) ( ${CXX:=clang++} ${CXXFLAGS} -x c++ -std=c++11 -c check_cxx11.cpp && rm -f check_cxx11.o* ) 1>/dev/null 2>/dev/null ;; + tru64cxx) ( ${CXX:=cc} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + acc) ( ${CXX:=aCC} ${CXXFLAGS} -AA check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + qcc) ( ${CXX:=QCC} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + cxx) ( ${CXX:=cxx} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + cross-cxx) ( ${BUILD_CXX:=cxx} ${BUILD_CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; *) test "0" = "1" ;; esac else @@ -107,6 +113,7 @@ test_cxx11 () # Try and guess the toolset to bootstrap the build with... guess_toolset () { + local NO_CXX_VARS=1 if test_uname Darwin && test_cxx11 clang ; then B2_TOOLSET=clang elif test_uname IRIX && test_cxx11 mipspro ; then B2_TOOLSET=mipspro elif test_uname IRIX64 && test_cxx11 mipspro ; then B2_TOOLSET=mipspro @@ -189,7 +196,7 @@ case "$1" in *) guess_toolset ;; esac -# We need a C++11 compiler. Check here and given some feedback about it. +# We need a C++11 compiler. Check here and give some feedback about it. if ! test_cxx11 $B2_TOOLSET ; then error_exit " A C++11 capable compiler is required for building the B2 engine. @@ -231,6 +238,13 @@ case $B2_TOOLSET in B2_CXXFLAGS_DEBUG="-O0 -g" ;; + *ibm-aix*) + # AIX needs threading option to use std::thread, it seems. + B2_CXX="${CXX} -x c++ -std=c++11 -pthread" + B2_CXXFLAGS_RELEASE="-O2 -s" + B2_CXXFLAGS_DEBUG="-O0 -g" + ;; + *) B2_CXX="${CXX} -x c++ -std=c++11" B2_CXXFLAGS_RELEASE="-O2 -s" From 54f811b7593dc751ec1b306cad27f32cfce81f36 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 28 Aug 2020 10:36:41 -0500 Subject: [PATCH 004/126] Remove limit on one link at a time limit. The reason for limiting links to one at a time is long obsolete. Hence we can remove almost all uses of JAM_SEMAPHORE to impose that one-link-at-a-time limit. --- src/tools/clang-darwin.jam | 3 - src/tools/clang-linux.jam | 20 +++--- src/tools/clang-vxworks.jam | 25 ++++---- src/tools/cray.jam | 5 -- src/tools/embarcadero.jam | 124 ++++++++++++++++++------------------ src/tools/gcc.jam | 10 --- src/tools/intel-darwin.jam | 43 ++++++------- src/tools/intel-linux.jam | 68 ++++++++++---------- src/tools/intel-vxworks.jam | 5 +- src/tools/qcc.jam | 5 -- 10 files changed, 135 insertions(+), 173 deletions(-) diff --git a/src/tools/clang-darwin.jam b/src/tools/clang-darwin.jam index 11f62d298b..0618d9f054 100644 --- a/src/tools/clang-darwin.jam +++ b/src/tools/clang-darwin.jam @@ -173,9 +173,6 @@ actions piecemeal archive 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-darwin-link-semaphore ; } actions link bind LIBRARIES diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index d5c9ed744e..28ddcde7ba 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -207,16 +207,15 @@ 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 ; @@ -238,16 +237,15 @@ rule link ( targets * : sources * : properties * ) { 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 ; @@ -285,5 +283,5 @@ actions link-w 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) - + } diff --git a/src/tools/clang-vxworks.jam b/src/tools/clang-vxworks.jam index d5dfc33a0d..33fe3ef2bf 100644 --- a/src/tools/clang-vxworks.jam +++ b/src/tools/clang-vxworks.jam @@ -16,9 +16,9 @@ import generators ; feature.extend-subfeature toolset clang : platform : vxworks ; -toolset.inherit-generators clang-vxworks - clang vxworks - : gcc +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 @@ -30,12 +30,12 @@ generators.override clang-vxworks.searched-lib-generator : searched-lib-generato toolset.inherit-rules clang-vxworks : gcc ; -toolset.inherit-flags clang-vxworks : gcc +toolset.inherit-flags clang-vxworks : gcc : full x86/32 x86/64 ; - + if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { .debug-configuration = true ; @@ -45,22 +45,22 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] # 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 = [ 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) ] ; + : version $(version) ] ; common.handle-options clang-vxworks : $(condition) : $(command) : $(options) ; @@ -112,14 +112,11 @@ actions piecemeal archive 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) + "$(.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 diff --git a/src/tools/cray.jam b/src/tools/cray.jam index d586af3af4..e4f4ec0d4b 100644 --- a/src/tools/cray.jam +++ b/src/tools/cray.jam @@ -644,10 +644,6 @@ rule gcc-link-procedure ( targets * : sources * : properties * ) # Copied from 'gcc.jam'. 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 ; gcc.quote-rpath $(targets) ; } @@ -657,7 +653,6 @@ rule gcc-link-dll-procedure ( targets * : sources * : properties * ) # Copied from 'gcc.jam'. SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; gcc.quote-rpath $(targets) ; } diff --git a/src/tools/embarcadero.jam b/src/tools/embarcadero.jam index c54a1ef5eb..9bf094f21b 100644 --- a/src/tools/embarcadero.jam +++ b/src/tools/embarcadero.jam @@ -25,7 +25,7 @@ several versions of the compiler. `version`: -The version should be the compiler version if specified. if the +The version should be the compiler version if specified. if the version is not specified Boost Build will find the latest installed version of Embarcadero C++ and use that for the version. If the version is specified Boost Build does not check if this matches any particular @@ -146,8 +146,8 @@ generators.override embarcadero.prebuilt : builtin.prebuilt ; generators.override embarcadero.searched-lib-generator : searched-lib-generator ; toolset.inherit-rules embarcadero : clang-linux ; -toolset.inherit-flags embarcadero - : clang-linux +toolset.inherit-flags embarcadero + : clang-linux : shared shared multi @@ -192,9 +192,9 @@ rule init ( version ? : command * : options * ) local compiler = bcc64 ; local preprocessor = cpp64 ; local amodel = 64 ; - + local optam = [ feature.get-values : $(options) ] ; - + if $(optam) { if $(optam) = 32 @@ -208,29 +208,29 @@ rule init ( version ? : command * : options * ) $(optam) = "" ; } } - + command = [ common.get-invocation-command embarcadero : $(compiler) : $(command) ] ; - + switch $(command[1]:BL) { case bcc32x : compiler = bcc32x ; preprocessor = cpp32x ; amodel = 32 ; - case bcc64 : + case bcc64 : compiler = bcc64 ; preprocessor = cpp64 ; amodel = 64 ; - case "bcc32x.exe" : + case "bcc32x.exe" : compiler = bcc32x ; preprocessor = cpp32x ; amodel = 32 ; - case "bcc64.exe" : + case "bcc64.exe" : compiler = bcc64 ; preprocessor = cpp64 ; amodel = 64 ; } - + if $(optam) && $(optam) != $(amodel) { errors.user-error "embarcadero initialization: compiler and address model" : @@ -250,43 +250,43 @@ rule init ( version ? : command * : options * ) cl_version = 5.0 ; } } - + local condition = [ common.check-init-parameters embarcadero : version $(version) ] ; handle-options $(condition) : $(command) : $(options) ; - + # Support for the Embarcadero root directory. If the Embarcadero binary # directory is not in the PATH we need to tell the underlying clang # implementation where to find the Embarcadero header/library files # and set the correct runtime path so that we can execute Embarcadero # programs and find Embarcadero DLLs. - + local root = [ feature.get-values : $(options) ] ; - + # 1) Look in registry - + if ! $(root) { - + local sdkdir = [ get_sdk_dir ] ; - + if $(sdkdir) { - + local bdsv = [ get_bds_version $(sdkdir) ] ; - + if $(bdsv) { - + local has_dec = [ MATCH "(.+[.])" : $(bdsv) ] ; local bdsv_full ; - + if ! $(has_dec) { bdsv_full = $(bdsv).0 ; } - + local troot = [ W32_GETREG "HKEY_LOCAL_MACHINE\\SOFTWARE\\Embarcadero\\BDS\\$(bdsv)" : RootDir ] ; - + if $(troot) { troot = $(troot:T) ; @@ -320,44 +320,44 @@ rule init ( version ? : command * : options * ) troot = [ concatenate $(troot) : name ] ; root = $(troot:D) ; } - } + } } } } } } - - + + # 2) Look for path in the command - + if ! $(root) { - + local cpath = $(command[1]:D) ; - + if $(cpath) { root = $(cpath:P) ; } } - + # 3) Search for the directory of the command - - if ! $(root) + + if ! $(root) { - + local pdirs = [ path.programs-path ] ; - + for local dir in $(pdirs) { - + local match = [ MATCH "/(.:.+)" : $(dir) ] ; - + if $(match) { dir = "$(match)" ; } - + if [ CHECK_IF_FILE $(dir)/$(command) ] { root = $(dir:P) ; @@ -370,24 +370,24 @@ rule init ( version ? : command * : options * ) } } } - - if ! $(root) + + if ! $(root) { errors.user-error "Embarcadero toolset initialization: the root directory for the Embarcadero installation can not be found" ; } else { - + local lib_path = $(root)/bin $(root)/bin64 $(root)/Bpl C:/Users/Public/Documents/Embarcadero ; if $(.debug-configuration) { ECHO "notice:" using Embarcadero libraries with clang compilation"::" $(condition) "::" $(lib_path) ; } flags embarcadero.link RUN_PATH $(condition) : $(lib_path) ; - + local system_include_option = "-isystem " ; local system_include_directories = $(root)/include/windows/crtl $(root)/include/windows/sdk $(root)/include/windows/rtl $(root)/include/dinkumware64 ; - + local lib_dir_release ; local lib_dir_debug ; local archiver ; @@ -396,7 +396,7 @@ rule init ( version ? : command * : options * ) local assembler ; local asmflags ; local asmoutput ; - + if $(compiler) = bcc32x { lib_dir_release = $(root)/lib/win32c/release $(root)/lib/win32c/release/psdk ; @@ -405,7 +405,7 @@ rule init ( version ? : command * : options * ) arflags = /P512 ; implib = implib ; assembler = $(root)/bin/tasm32 ; - + # /ml makes all symbol names case-sensitive asmflags = /ml ; @@ -413,14 +413,14 @@ rule init ( version ? : command * : options * ) } 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 ; } - + flags embarcadero.compile .EMB_SYSINC $(condition) : $(system_include_option)$(system_include_directories) ; flags embarcadero.link LINKPATH $(condition)/release : $(lib_dir_release) ; flags embarcadero.link LINKPATH $(condition)/debug : $(lib_dir_debug) $(lib_dir_release) ; @@ -432,9 +432,9 @@ rule init ( version ? : command * : options * ) 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) ; - + local mte = [ feature.get-values : $(options) ] ; - + if $(mte) { flags embarcadero OPTIONS EXE/$(condition) : $(mte) ; @@ -453,7 +453,7 @@ local rule concatenate ( path : name ) local result ; local has_ending_slash = [ MATCH ".*([/\\])$" : $(path) ] ; local has_backward_slash = [ MATCH ".*([\\])" : $(path) ] ; - + if $(has_ending_slash) { result = $(path)$(name) ; @@ -471,28 +471,28 @@ local rule concatenate ( path : name ) local rule get_sdk_dir ( ) { - + local ret ; local appdata = [ os.environ APPDATA ] ; - + if $(appdata) { ret = $(appdata:T)/Embarcadero/BDS ; } return $(ret) ; } - + local rule get_bds_version ( sdir ) { - + local ret ; local flist = [ GLOB $(sdir) : * ] ; - + if $(flist) { - + local dirs ; - + for local file in $(flist) { if ! [ CHECK_IF_FILE $(file) ] @@ -502,9 +502,9 @@ local rule get_bds_version ( sdir ) } if $(dirs) { - + local ldir = $(dirs[-1]) ; - + ret = $(ldir:B) ; } } @@ -559,7 +559,7 @@ local opt_drtl = -tR ; local opt_dapp = -tW ; local opt_compile_flags = -DNDEBUG ; local opt_lflags = "-lS:1048576 -lSc:4098 -lH:1048576 -lHc:8192" ; - + flags embarcadero OPTIONS console : $(opt_console) ; flags embarcadero OPTIONS gui : $(opt_dapp) ; flags embarcadero OPTIONS shared : $(opt_drtl) ; @@ -602,16 +602,14 @@ rule archive ( targets * : sources * : properties * ) } actions updated together piecemeal archive -{ +{ "$(.AR)" $(AROPTIONS) $(.ARFLAGS) /u /a /C "$(<)" +-"$(>)" } rule link ( targets * : sources * : properties * ) { - JAM_SEMAPHORE on $(targets) = embarcadero-link-semaphore ; } rule link.dll ( targets * : sources * : properties * ) { - JAM_SEMAPHORE on $(targets) = embarcadero-link-semaphore ; } actions link bind LIBRARIES { diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index ff3209f7b8..1fb10e01ab 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -1096,33 +1096,23 @@ rule quote-rpath ( targets * ) rule link ( 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 ; quote-rpath $(targets) ; } rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; quote-rpath $(targets) ; } 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 ; } rule link.dll.mingw ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; } actions link.mingw bind LIBRARIES diff --git a/src/tools/intel-darwin.jam b/src/tools/intel-darwin.jam index 6dc5d8e3bf..7da7b079c6 100644 --- a/src/tools/intel-darwin.jam +++ b/src/tools/intel-darwin.jam @@ -16,9 +16,9 @@ import generators ; feature.extend-subfeature toolset intel : platform : darwin ; -toolset.inherit-generators intel-darwin - intel darwin - : gcc +toolset.inherit-generators intel-darwin + intel darwin + : 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 @@ -29,20 +29,20 @@ generators.override intel-darwin.prebuilt : builtin.prebuilt ; generators.override intel-darwin.searched-lib-generator : searched-lib-generator ; toolset.inherit-rules intel-darwin : gcc ; -toolset.inherit-flags intel-darwin : gcc - : off on full space +toolset.inherit-flags intel-darwin : gcc + : off on full space off all on extra pedantic off on x86/32 x86/64 ; - + if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { .debug-configuration = true ; } - + # Initializes the intel-darwin toolset # version in mandatory # name (default icc) is used to invoke the specified intel compiler @@ -51,8 +51,8 @@ rule init ( version ? : command * : options * ) { local condition = [ common.check-init-parameters intel-darwin : version $(version) ] ; - - command = [ common.get-invocation-command intel-darwin : icc + + command = [ common.get-invocation-command intel-darwin : icc : $(command) : /opt/intel_cc_80/bin ] ; common.handle-options intel-darwin : $(condition) : $(command) : $(options) ; @@ -67,12 +67,12 @@ rule init ( version ? : command * : options * ) { 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 (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) @@ -80,7 +80,7 @@ rule init ( version ? : command * : options * ) ECHO notice\: using intel libraries "::" $(condition) "::" $(lib_path) ; } flags intel-darwin.link RUN_PATH $(condition) : $(lib_path) ; - } + } } local m = [ MATCH (..).* : $(version) ] ; @@ -90,7 +90,7 @@ rule init ( version ? : command * : options * ) } local major = $(m) ; - + if $(major) = "9" { flags intel-darwin.compile OPTIONS $(condition)/off : -Ob0 ; flags intel-darwin.compile OPTIONS $(condition)/on : -Ob1 ; @@ -136,7 +136,7 @@ flags intel-darwin.compile.c++ OPTIONS ; flags intel-darwin.compile OPTIONS space : -O1 ; # no specific space optimization flag in icc -# +# .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 @@ -190,11 +190,11 @@ rule archive ( targets * : sources * : properties * ) # Always remove archive and start again. Here's rationale from # Andre Hentz: # - # I had a file, say a1.c, that was included into liba.a. - # I moved a1.c to a2.c, updated my Jamfiles and rebuilt. - # My program was crashing with absurd errors. - # After some debugging I traced it back to the fact that a1.o was *still* - # in liba.a + # I had a file, say a1.c, that was included into liba.a. + # I moved a1.c to a2.c, updated my Jamfiles and rebuilt. + # My program was crashing with absurd errors. + # After some debugging I traced it back to the fact that a1.o was *still* + # in liba.a # # Rene Rivera: # @@ -226,9 +226,6 @@ flags intel-darwin.link USER_OPTIONS ; 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-darwin-link-semaphore ; } actions link bind LIBRARIES diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index 920cefed0f..d97ee231c0 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -19,7 +19,7 @@ import numbers ; feature.extend-subfeature toolset intel : platform : linux ; -toolset.inherit-generators intel-linux +toolset.inherit-generators intel-linux intel linux : gcc : gcc.mingw.link gcc.mingw.link.dll ; generators.override intel-linux.prebuilt : builtin.lib-generator ; generators.override intel-linux.prebuilt : builtin.prebuilt ; @@ -28,23 +28,23 @@ generators.override intel-linux.searched-lib-generator : searched-lib-generator # Override default do-nothing generators. generators.override intel-linux.compile.c.pch : pch.default-c-pch-generator ; generators.override intel-linux.compile.c++.pch : pch.default-cpp-pch-generator ; - + type.set-generated-target-suffix PCH : intel linux : pchi ; toolset.inherit-rules intel-linux : gcc ; -toolset.inherit-flags intel-linux : gcc +toolset.inherit-flags intel-linux : gcc : off on full space speed off all on extra pedantic off on ; - + if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { .debug-configuration = true ; } - + # Initializes the intel-linux toolset # version in mandatory # name (default icpc) is used to invoke the specified intel-linux compiler @@ -53,7 +53,7 @@ rule init ( version ? : command * : options * ) { local condition = [ common.check-init-parameters intel-linux : version $(version) ] ; - + if $(.debug-configuration) { ECHO "notice: intel-linux version is" $(version) ; @@ -66,83 +66,83 @@ rule init ( version ? : command * : options * ) # to a sane 'intel' folder in /opt. if [ MATCH "(12[.]0|12)" : $(version) ] { default_path = /opt/intel/bin ; } - # Intel C++ Compiler 11.1. + # Intel C++ Compiler 11.1. else if [ MATCH "(11[.]1)" : $(version) ] { default_path = /opt/intel_cce_11.1.064.x86_64/bin ; } - # Intel C++ Compiler 11.0. + # Intel C++ Compiler 11.0. else if [ MATCH "(11[.]0|11)" : $(version) ] { default_path = /opt/intel_cce_11.0.074.x86_64/bin ; } - # Intel C++ Compiler 10.1. + # Intel C++ Compiler 10.1. else if [ MATCH "(10[.]1)" : $(version) ] { default_path = /opt/intel_cce_10.1.013_x64/bin ; } - # Intel C++ Compiler 9.1. + # Intel C++ Compiler 9.1. else if [ MATCH "(9[.]1)" : $(version) ] { default_path = /opt/intel_cc_91/bin ; } - # Intel C++ Compiler 9.0. + # Intel C++ Compiler 9.0. else if [ MATCH "(9[.]0|9)" : $(version) ] { default_path = /opt/intel_cc_90/bin ; } - # Intel C++ Compiler 8.1. + # Intel C++ Compiler 8.1. else if [ MATCH "(8[.]1)" : $(version) ] { default_path = /opt/intel_cc_81/bin ; } # Intel C++ Compiler 8.0 - this used to be the default, so now it's the - # fallback. - else + # fallback. + else { default_path = /opt/intel_cc_80/bin ; } - + if $(.debug-configuration) { ECHO "notice: default search path for intel-linux is" $(default_path) ; } - command = [ common.get-invocation-command intel-linux : icpc + command = [ common.get-invocation-command intel-linux : icpc : $(command) : $(default_path) ] ; - + common.handle-options intel-linux : $(condition) : $(command) : $(options) ; - + local root = [ feature.get-values : $(options) ] ; local bin ; if $(command) || $(root) { bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; root ?= $(bin:D) ; - + local command-string = $(command:J=" ") ; local version-output = [ SHELL "$(command-string) --version" ] ; local real-version = [ MATCH "([0-9.]+)" : $(version-output) ] ; local major = [ MATCH "([0-9]+).*" : $(real-version) ] ; - + # If we failed to determine major version, use the behaviour for # the current compiler. if $(major) && [ numbers.less $(major) 10 ] { flags intel-linux.compile OPTIONS $(condition)/off : "-Ob0" ; flags intel-linux.compile OPTIONS $(condition)/on : "-Ob1" ; - flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; } else if $(major) && [ numbers.less $(major) 11 ] { - flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; - flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; - flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; } else # newer version of intel do have -Os (at least 11+, don't know about 10) - { - flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; - flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; - flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + { + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; flags intel-linux.compile OPTIONS $(condition)/space : "-Os" ; flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; - } - + } + if $(root) { # Libraries required to run the executable may be in either - # $(root)/lib (10.1 and earlier) - # or + # $(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) @@ -150,7 +150,7 @@ rule init ( version ? : command * : options * ) ECHO notice\: using intel libraries "::" $(condition) "::" $(lib_path) ; } flags intel-linux.link RUN_PATH $(condition) : $(lib_path) ; - } + } } } @@ -213,7 +213,6 @@ actions compile.c.pch rule link ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = intel-linux-link-semaphore ; } actions link bind LIBRARIES @@ -224,7 +223,6 @@ actions link bind LIBRARIES rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = intel-linux-link-semaphore ; } # Differ from 'link' above only by -shared. diff --git a/src/tools/intel-vxworks.jam b/src/tools/intel-vxworks.jam index c217ead32c..e70e4e2610 100644 --- a/src/tools/intel-vxworks.jam +++ b/src/tools/intel-vxworks.jam @@ -156,7 +156,7 @@ flags intel-vxworks ARFLAGS ; rule archive ( targets * : sources * : properties * ) { - # Always remove archive and start again. + # Always remove archive and start again. # of the archive. # local clean.a = $(targets[1])(clean) ; @@ -179,9 +179,6 @@ flags intel-vxworks.link USER_OPTIONS ; 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 diff --git a/src/tools/qcc.jam b/src/tools/qcc.jam index 740e90705d..aac6059661 100644 --- a/src/tools/qcc.jam +++ b/src/tools/qcc.jam @@ -240,10 +240,6 @@ toolset.flags qcc.link RPATH_LINK : : unchecked ; rule link ( 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 qcc links while it might - # be a good idea to serialize all links. - JAM_SEMAPHORE on $(targets) = qcc-link-semaphore ; check-target-platform $(1) ; } @@ -289,7 +285,6 @@ actions piecemeal archive rule link.dll ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = qcc-link-semaphore ; check-target-platform $(1) ; } From 64248802f887775b9637ad49a8991c3a08c878c6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 28 Aug 2020 21:20:16 -0500 Subject: [PATCH 005/126] Bump to v4.4. --- doc/src/history.adoc | 9 +++++++++ src/build/version.jam | 2 +- src/engine/patchlevel.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/src/history.adoc b/doc/src/history.adoc index d471655f0c..9b1aa80a3c 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -1,6 +1,15 @@ [[b2.history]] = History +== Version 4.4.0 + +* Remove one at time linking limit. Once upon a time this was a performance + tweak as hardware and software was not up to doing multiple links at once. + Common setups are better equipped. + -- _René Ferdinand Rivera Morell_ +* Fix building engine with GCC on AIX. + -- _René Ferdinand Rivera Morell_ + == Version 4.3.0 There are many invidual fixes in this release. Many thanks for the diff --git a/src/build/version.jam b/src/build/version.jam index 14f22b0ec8..2aa8dcfef5 100644 --- a/src/build/version.jam +++ b/src/build/version.jam @@ -8,7 +8,7 @@ import numbers ; # Mirror engine JAM_VERSION .major = "4" ; -.minor = "3" ; +.minor = "4" ; rule boost-build ( ) diff --git a/src/engine/patchlevel.h b/src/engine/patchlevel.h index 69fe073d8e..c9d1f259b3 100644 --- a/src/engine/patchlevel.h +++ b/src/engine/patchlevel.h @@ -12,5 +12,5 @@ Distributed under the Boost Software License, Version 1.0. #define VERSION_MAJOR 4 -#define VERSION_MINOR 3 +#define VERSION_MINOR 4 #define VERSION_PATCH 0 From 1da0fe27d108c3d49652524d9c83aefe96d3a92a Mon Sep 17 00:00:00 2001 From: David McFarland Date: Sat, 29 Aug 2020 01:54:24 -0300 Subject: [PATCH 006/126] Use /proc/self/exe for executable_path on Cygwin (#644) --- src/engine/jam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/jam.cpp b/src/engine/jam.cpp index 07ed5e52c0..c419f1fa1e 100644 --- a/src/engine/jam.cpp +++ b/src/engine/jam.cpp @@ -747,7 +747,7 @@ char * executable_path( char const * argv0 ) sysctl( mib, 4, buf, &size, NULL, 0 ); return ( !size || size == sizeof( buf ) ) ? NULL : strndup( buf, size ); } -#elif defined(__linux__) +#elif defined(__linux__) || defined(__CYGWIN__) # include char * executable_path( char const * argv0 ) { From 456be0b7ecca065fbccf380c2f51e0985e608ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Aum=C3=BCller?= Date: Sat, 29 Aug 2020 07:02:45 +0200 Subject: [PATCH 007/126] use '-arch arm64' for 64-bit builds using darwin.jam (#642) Even for 64-bit architectures, b2 would add '-arch arm' to the compiler options - but this is only valid for 32-bit arm builds. The problem was also observed here: https://stackoverflow.com/a/47096479 --- src/tools/darwin.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index c28ca42b01..4841cbf5c7 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -502,6 +502,8 @@ rule setup-address-model ( targets * : sources * : properties * ) { if $(instruction-set) { options = -arch$(_)$(instruction-set) ; + } else if $(address-model) = 64 { + options = -arch arm64 ; } else { options = -arch arm ; } From 86271a42865b2d6ebf4440549e9df1ccc05e9d13 Mon Sep 17 00:00:00 2001 From: Alain Miniussi Date: Tue, 1 Sep 2020 06:34:59 +0200 Subject: [PATCH 008/126] Bugfix/634 intel linux icpc (#639) * repace icc with "official" icpc driver with intel-linux * the right dialect selecton option needs a space with intel-linux * Check for oneapi setvar script with intel-linux * Consider oneapi from Intel if compiler not provided. * Fix comment about fallback when looking for compiler --- src/engine/build.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index dd82273a94..4fcdbfdfed 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -87,7 +87,7 @@ test_cxx11 () case $1 in gcc) ( ${CXX:=g++} ${CXXFLAGS} -x c++ -std=c++11 -c check_cxx11.cpp && rm -f check_cxx11.o* ) 1>/dev/null 2>/dev/null ;; intel-darwin) ( ${CXX:=icc} ${CXXFLAGS} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - intel-linux) ( ${CXX:=icc} ${CXXFLAGS} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + intel-linux) ( ${CXX:=icpc} ${CXXFLAGS} -x c++ -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; vacpp) ( ${CXX:=xlC_r} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; xlcpp) ( ${CXX:=xlC_r} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; como) ( ${CXX:=como} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; @@ -131,7 +131,10 @@ guess_toolset () elif test_uname FreeBSD && test_path freebsd-version && test_path clang++ && test_cxx11 clang ; then B2_TOOLSET=clang elif test_path g++ && test_cxx11 gcc ; then B2_TOOLSET=gcc elif test_path clang++ && test_cxx11 clang ; then B2_TOOLSET=clang - elif test_path icc && test_cxx11 intel-linux ; then B2_TOOLSET=intel-linux + elif test_path icpc && test_cxx11 intel-linux ; then B2_TOOLSET=intel-linux + elif test -r /opt/intel/inteloneapi/setvars.sh && test_cxx11 intel-linux ; then + B2_TOOLSET=intel-linux + B2_TOOLSET_ROOT=/opt/intel/inteloneapi elif test -r /opt/intel/cc/9.0/bin/iccvars.sh && test_cxx11 intel-linux ; then B2_TOOLSET=intel-linux B2_TOOLSET_ROOT=/opt/intel/cc/9.0 @@ -261,18 +264,19 @@ case $B2_TOOLSET in ;; intel-linux) - CXX=${CXX:=icc} + CXX=${CXX:=icpc} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - test_path ${CXX} >/dev/null 2>&1 - if test $? ; then + if test_path ${CXX} ; then echo "Found ${CXX} in environment" - B2_TOOLSET_ROOT=`echo ${CXX}| sed -e 's/bin.*\/icc//'` + B2_TOOLSET_ROOT=`echo ${CXX}| sed -e 's/bin.*\/icpc//'` # probably the most widespread ARCH=intel64 else echo "No intel compiler in current path" - echo "Look in a few old place for legacy reason" - if test -r /opt/intel/cc/9.0/bin/iccvars.sh ; then + echo "Look in a few common places just in case" + if test -r /opt/intel/inteloneapi/setvars.sh ; then + B2_TOOLSET_ROOT=/opt/intel/inteloneapi + elif test -r /opt/intel/cc/9.0/bin/iccvars.sh ; then B2_TOOLSET_ROOT=/opt/intel/cc/9.0/ elif test -r /opt/intel_cc_80/bin/iccvars.sh ; then B2_TOOLSET_ROOT=/opt/intel_cc_80/ @@ -284,9 +288,11 @@ case $B2_TOOLSET in B2_TOOLSET_ROOT=/opt/intel/compiler50/ia32/ fi fi - if test -r ${B2_TOOLSET_ROOT}bin/iccvars.sh ; then + if test -r ${B2_TOOLSET_ROOT}/setvars.sh ; then + . ${B2_TOOLSET_ROOT}/setvars.sh + elif test -r ${B2_TOOLSET_ROOT}bin/iccvars.sh ; then # iccvars does not change LD_RUN_PATH. We adjust LD_RUN_PATH here in - # order not to have to rely on ld.so.conf knowing the icc library + # order not to have to rely on ld.so.conf knowing the icpc library # directory. We do this before running iccvars.sh in order to allow a # user to add modifications to LD_RUN_PATH in iccvars.sh. if test -z "${LD_RUN_PATH}"; then @@ -297,7 +303,7 @@ case $B2_TOOLSET in export LD_RUN_PATH . ${B2_TOOLSET_ROOT}bin/iccvars.sh $ARCH fi - B2_CXX="${CXX} -xc++" + B2_CXX="${CXX} -x c++ -std=c++11" B2_CXXFLAGS_RELEASE="-O3 -s" B2_CXXFLAGS_DEBUG="-O0 -g -p" ;; From 681362ba31d99484946e14b33732f520411d4b4c Mon Sep 17 00:00:00 2001 From: viccie30 Date: Wed, 2 Sep 2020 04:51:03 +0200 Subject: [PATCH 009/126] Add quotes to fix error on CXXFLAGS (#648) --- src/engine/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 4fcdbfdfed..3cf0f53a30 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -77,8 +77,8 @@ test_exec () # Check that the compiler can do C++11. test_cxx11 () { - local CXX=${CXX} - local CXXFLAGS=${CXXFLAGS} + local CXX="${CXX}" + local CXXFLAGS="${CXXFLAGS}" if test ${NO_CXX_VARS} ; then CXX= CXXFLAGS= From 59065850ec058907ceca9e9ab4c2bac87a87ac28 Mon Sep 17 00:00:00 2001 From: sjcooke Date: Tue, 1 Sep 2020 22:52:44 -0400 Subject: [PATCH 010/126] Add missing relevant features for searched lib targets (Fixes #515) (#640) * Add missing relevant features for searched lib targets (#515) * Added a regression test for searched lib targets (#515) --- src/tools/generators/searched-lib-generator.jam | 6 +++--- test/searched_lib.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/tools/generators/searched-lib-generator.jam b/src/tools/generators/searched-lib-generator.jam index b3435daa35..84757a018c 100644 --- a/src/tools/generators/searched-lib-generator.jam +++ b/src/tools/generators/searched-lib-generator.jam @@ -38,7 +38,7 @@ class searched-lib-generator : generator local search = [ feature.get-values : $(properties) ] ; - local a = [ new null-action [ $(property-set).add-raw link ] ] ; + local a = [ new null-action [ $(property-set).add-raw link search ] ] ; local lib-name = [ feature.get-values : $(properties) ] ; lib-name ?= $(name) ; local t = [ new searched-lib-target $(lib-name) : $(project) @@ -47,7 +47,7 @@ class searched-lib-generator : generator # lib png : z : png ; # the 'z' target should be returned, so that apps linking to 'png' # will link to 'z', too. - return [ property-set.create $(search) link ] + return [ property-set.create $(search) link search name ] [ virtual-target.register $(t) ] $(sources) ; } } @@ -88,7 +88,7 @@ class searched-lib-target : abstract-file-target rule relevant ( ) { - return [ property-set.create link ] ; + return [ property-set.create link search ] ; } rule path ( ) diff --git a/test/searched_lib.py b/test/searched_lib.py index 2081230a12..5c1da5f35b 100644 --- a/test/searched_lib.py +++ b/test/searched_lib.py @@ -163,6 +163,22 @@ t.run_build_system(["-n"]) +# A regression test. Virtual targets distinguished by their search paths were +# not differentiated when registered, which caused search paths to be selected +# incorrectly for build requests with multiple feature values. +t.write("jamroot.jam", "") +t.write("a.cpp", "") +t.write("jamfile.jam", """\ +exe a : a.cpp l ; +lib l : : l lib32 32 ; +lib l : : l lib64 64 ; +""") + +t.run_build_system(["-n","address-model=32,64"]) +t.fail_test(t.stdout().find("lib32") == -1) +t.fail_test(t.stdout().find("lib64") == -1) + + # Make sure plain "lib foobar ; " works. t.write("jamfile.jam", """\ exe a : a.cpp foobar ; From 0485ed055b5aea933cf27d25204024513f01fc36 Mon Sep 17 00:00:00 2001 From: hia3 Date: Wed, 2 Sep 2020 05:53:40 +0300 Subject: [PATCH 011/126] optional package-name of package.install-data (#630) Judging by this line: package-name ?= target-name ; package-name argument meant to be optional. --- src/tools/package.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/package.jam b/src/tools/package.jam index 7ae9dc54a0..a61a9e5244 100644 --- a/src/tools/package.jam +++ b/src/tools/package.jam @@ -253,9 +253,9 @@ rule install ( name package-name ? : requirements * : binaries * : libraries * : $(name)-lib-shared-universe $(name)-lib-shared-cygwin ; } -rule install-data ( target-name : package-name : data * : requirements * ) +rule install-data ( target-name : package-name ? : data * : requirements * ) { - package-name ?= target-name ; + package-name ?= $(target-name) ; local paths = [ paths $(package-name) : $(requirements) ] ; local datadir = [ $(paths).datarootdir ] ; From 7cacaef33516ac1d9b3b9c1eba2c107a07cb07ea Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 2 Sep 2020 23:46:48 -0500 Subject: [PATCH 012/126] Tweaks to support 64 bit compile of engine. --- src/engine/execcmd.h | 4 ++-- src/engine/execnt.cpp | 4 ++-- src/engine/execunix.cpp | 4 ++-- src/engine/execvms.cpp | 4 ++-- src/engine/jamgram.cpp | 22 +++++++++++----------- src/engine/jamgram.hpp | 2 +- src/engine/make1.cpp | 6 +++--- src/engine/md5.h | 4 +++- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index 36f13aecf7..ec7a226490 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -54,8 +54,8 @@ int exec_check ( string const * command, LIST * * pShell, - int * error_length, - int * error_max_length + size_t * error_length, + size_t * error_max_length ); /* exec_check() return codes. */ diff --git a/src/engine/execnt.cpp b/src/engine/execnt.cpp index 0b28087fe3..512d405fe8 100644 --- a/src/engine/execnt.cpp +++ b/src/engine/execnt.cpp @@ -270,8 +270,8 @@ int exec_check ( string const * command, LIST * * pShell, - int * error_length, - int * error_max_length + size_t * error_length, + size_t * error_max_length ) { /* Default shell does nothing when triggered with an empty or a diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index 2740743c71..8719424816 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -140,8 +140,8 @@ int exec_check ( string const * command, LIST * * pShell, - int * error_length, - int * error_max_length + size_t * error_length, + size_t * error_max_length ) { int const is_raw_cmd = is_raw_command_request( *pShell ); diff --git a/src/engine/execvms.cpp b/src/engine/execvms.cpp index b4b0618455..3ed161649d 100644 --- a/src/engine/execvms.cpp +++ b/src/engine/execvms.cpp @@ -75,8 +75,8 @@ int exec_check ( string const * command, LIST * * pShell, - int * error_length, - int * error_max_length + size_t * error_length, + size_t * error_max_length ) { int const is_raw_cmd = 1; diff --git a/src/engine/jamgram.cpp b/src/engine/jamgram.cpp index 163428b1d3..2f7382dfae 100644 --- a/src/engine/jamgram.cpp +++ b/src/engine/jamgram.cpp @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.6.2. */ +/* A Bison parser, made by GNU Bison 3.6.4. */ /* Bison implementation for Yacc-like parsers in C @@ -49,7 +49,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.6.2" +#define YYBISON_VERSION "3.6.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -764,7 +764,7 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINEYYN -- Source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 145, 145, 147, 158, 160, 164, 166, 168, 168, @@ -846,7 +846,7 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACTSTATE-NUM -- Index in YYTABLE of the portion describing + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { @@ -873,7 +873,7 @@ static const yytype_int16 yypact[] = -119, 115, -119, -119, -119, 140, -119 }; - /* YYDEFACTSTATE-NUM -- Default reduction number in state STATE-NUM. + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_int8 yydefact[] = @@ -901,7 +901,7 @@ static const yytype_int8 yydefact[] = 60, 0, 19, 95, 37, 11, 96 }; - /* YYPGOTONTERM-NUM. */ + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -119, -119, -118, 25, -119, -119, 96, -119, -119, -119, @@ -913,7 +913,7 @@ static const yytype_int16 yypgoto[] = -119, -119, -119, -119, -119, -119, -119, -119 }; - /* YYDEFGOTONTERM-NUM. */ + /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 17, 38, 39, 31, 168, 40, 109, 140, 175, @@ -925,7 +925,7 @@ static const yytype_int16 yydefgoto[] = 53, 84, 149, 148, 23, 61, 87, 121 }; - /* YYTABLEYYPACT[STATE-NUM] -- What to do in state STATE-NUM. If + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = @@ -986,7 +986,7 @@ static const yytype_int16 yycheck[] = 14, 15, 16 }; - /* YYSTOSSTATE-NUM -- The (internal number of the) accessing + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_int8 yystos[] = { @@ -1013,7 +1013,7 @@ static const yytype_int8 yystos[] = 48, 53, 63, 10, 48, 105, 53 }; - /* YYR1YYN -- Symbol number of symbol that rule YYN derives. */ + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int8 yyr1[] = { 0, 51, 52, 52, 53, 53, 54, 54, 55, 56, @@ -1031,7 +1031,7 @@ static const yytype_int8 yyr1[] = 118, 117 }; - /* YYR2YYN -- Number of symbols on the right hand side of rule YYN. */ + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 1, 1, 1, 1, 2, 0, 0, diff --git a/src/engine/jamgram.hpp b/src/engine/jamgram.hpp index 6d19ae77b4..325bbe1419 100644 --- a/src/engine/jamgram.hpp +++ b/src/engine/jamgram.hpp @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.6.2. */ +/* A Bison parser, made by GNU Bison 3.6.4. */ /* Bison interface for Yacc-like parsers in C diff --git a/src/engine/make1.cpp b/src/engine/make1.cpp index 61f0614a1a..1ab3beafcd 100644 --- a/src/engine/make1.cpp +++ b/src/engine/make1.cpp @@ -1179,8 +1179,8 @@ static CMD * make1cmds( TARGET * t ) { CMD * cmd; int cmd_check_result; - int cmd_error_length; - int cmd_error_max_length; + size_t cmd_error_length; + size_t cmd_error_max_length; int retry = 0; int accept_command = 0; @@ -1219,7 +1219,7 @@ static CMD * make1cmds( TARGET * t ) : "contains a line that is too long"; assert( cmd_check_result == EXEC_CHECK_TOO_LONG || cmd_check_result == EXEC_CHECK_LINE_TOO_LONG ); - out_printf( "%s action %s (%d, max %d):\n", object_str( + out_printf( "%s action %s (%zd, max %zd):\n", object_str( rule->name ), error_message, cmd_error_length, cmd_error_max_length ); diff --git a/src/engine/md5.h b/src/engine/md5.h index d76ddcf2cf..cbfde59767 100644 --- a/src/engine/md5.h +++ b/src/engine/md5.h @@ -50,6 +50,8 @@ #ifndef md5_INCLUDED # define md5_INCLUDED +#include + /* * This package supports both compile-time and run-time determination of CPU * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be @@ -71,7 +73,7 @@ typedef struct md5_state_s { } md5_state_t; #ifdef __cplusplus -extern "C" +extern "C" { #endif From 874fadedbd188a409c5479c10caf10d2809ff7c4 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 3 Sep 2020 07:38:48 -0500 Subject: [PATCH 013/126] Fix msvc/windows 64 bit build on older compilers. --- src/engine/filent.cpp | 2 +- src/engine/make1.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/engine/filent.cpp b/src/engine/filent.cpp index af89d5ef22..72448f1e24 100644 --- a/src/engine/filent.cpp +++ b/src/engine/filent.cpp @@ -62,7 +62,7 @@ int file_collect_dir_content_( file_info_t * const d ) string pathspec[ 1 ]; string pathname[ 1 ]; LIST * files = L0; - int d_length; + size_t d_length; assert( d ); assert( d->is_dir ); diff --git a/src/engine/make1.cpp b/src/engine/make1.cpp index 1ab3beafcd..cfc302214a 100644 --- a/src/engine/make1.cpp +++ b/src/engine/make1.cpp @@ -1219,9 +1219,16 @@ static CMD * make1cmds( TARGET * t ) : "contains a line that is too long"; assert( cmd_check_result == EXEC_CHECK_TOO_LONG || cmd_check_result == EXEC_CHECK_LINE_TOO_LONG ); - out_printf( "%s action %s (%zd, max %zd):\n", object_str( - rule->name ), error_message, cmd_error_length, - cmd_error_max_length ); + if (sizeof(size_t) == (sizeof(long int))) + out_printf( + "%s action %s (%ld, max %ld):\n", + object_str( rule->name ), error_message, + cmd_error_length, cmd_error_max_length ); + else + out_printf( + "%s action %s (%d, max %d):\n", + object_str( rule->name ), error_message, + cmd_error_length, cmd_error_max_length ); /* Tell the user what did not fit. */ out_puts( cmd->buf->value ); From 8eeed08f011ca6f6d1a79ecee53583c43f176ccc Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 3 Sep 2020 08:43:46 -0500 Subject: [PATCH 014/126] More b64 fixes for windows. --- src/engine/execnt.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/execnt.cpp b/src/engine/execnt.cpp index 512d405fe8..45f2062c84 100644 --- a/src/engine/execnt.cpp +++ b/src/engine/execnt.cpp @@ -71,7 +71,7 @@ /* get the maximum shell command line length according to the OS */ static int maxline(); /* valid raw command string length */ -static long raw_command_length( char const * command ); +static size_t raw_command_length( char const * command ); /* add two 64-bit unsigned numbers, h1l1 and h2l2 */ static FILETIME add_64( unsigned long h1, unsigned long l1, @@ -185,7 +185,7 @@ void execnt_unit_test() * Use a table instead. */ { - typedef struct test { const char * command; int result; } test; + typedef struct test { const char * command; size_t result; } test; test tests[] = { { "", 0 }, { " ", 0 }, @@ -218,7 +218,7 @@ void execnt_unit_test() } { - int const length = maxline() + 9; + size_t const length = maxline() + 9; char * const cmd = (char *)BJAM_MALLOC_ATOMIC( length + 1 ); memset( cmd, 'x', length ); cmd[ length ] = 0; @@ -290,7 +290,7 @@ int exec_check /* Check prerequisites for executing raw commands. */ if ( is_raw_command_request( *pShell ) ) { - long const raw_cmd_length = raw_command_length( command->value ); + size_t const raw_cmd_length = raw_command_length( command->value ); if ( raw_cmd_length < 0 ) { /* Invalid characters detected - fallback to default shell. */ @@ -380,7 +380,7 @@ void exec_cmd end = p; string_new( cmd_local ); string_append_range( cmd_local, start, end ); - assert( long(cmd_local->size) == raw_command_length( cmd_orig->value ) ); + assert( size_t(cmd_local->size) == raw_command_length( cmd_orig->value ) ); } /* If we are not running a raw command directly, prepare a command file to * be executed using an external shell and the actual command string using @@ -632,7 +632,7 @@ static void string_renew( string * const s ) * affect the executed command). */ -static long raw_command_length( char const * command ) +static size_t raw_command_length( char const * command ) { char const * p; char const * escape = 0; From 210cef7ae2aeb98eec8bfdc8cd0d02ab711669bd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 3 Sep 2020 22:33:02 -0500 Subject: [PATCH 015/126] Another attempt at correct cmd length check. --- src/engine/make1.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/make1.cpp b/src/engine/make1.cpp index cfc302214a..fe6a94f9ce 100644 --- a/src/engine/make1.cpp +++ b/src/engine/make1.cpp @@ -1219,7 +1219,12 @@ static CMD * make1cmds( TARGET * t ) : "contains a line that is too long"; assert( cmd_check_result == EXEC_CHECK_TOO_LONG || cmd_check_result == EXEC_CHECK_LINE_TOO_LONG ); - if (sizeof(size_t) == (sizeof(long int))) + if (sizeof(size_t) == (sizeof(long long int))) + out_printf( + "%s action %s (%lld, max %lld):\n", + object_str( rule->name ), error_message, + cmd_error_length, cmd_error_max_length ); + else if (sizeof(size_t) == (sizeof(long int))) out_printf( "%s action %s (%ld, max %ld):\n", object_str( rule->name ), error_message, From 1c3636e8edf95888bc30c789145bafb3e4ab7b12 Mon Sep 17 00:00:00 2001 From: Gei0r Date: Tue, 8 Sep 2020 03:01:18 +0200 Subject: [PATCH 016/126] Enable building with clang on Windows (#651) --- src/engine/config_toolset.bat | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/config_toolset.bat b/src/engine/config_toolset.bat index d13fcc667f..0a0a9b1097 100644 --- a/src/engine/config_toolset.bat +++ b/src/engine/config_toolset.bat @@ -14,6 +14,7 @@ if "_%B2_TOOLSET%_" == "_vc142_" call :Config_VC142 if "_%B2_TOOLSET%_" == "_borland_" call :Config_BORLAND if "_%B2_TOOLSET%_" == "_como_" call :Config_COMO if "_%B2_TOOLSET%_" == "_gcc_" call :Config_GCC +if "_%B2_TOOLSET%_" == "_clang_" call :Config_CLANG if "_%B2_TOOLSET%_" == "_gcc-nocygwin_" call :Config_GCC_NOCYGWIN if "_%B2_TOOLSET%_" == "_intel-win32_" call :Config_INTEL_WIN32 if "_%B2_TOOLSET%_" == "_mingw_" call :Config_MINGW @@ -185,6 +186,12 @@ set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -o b2.exe" set "_known_=1" goto :eof +:Config_CLANG +if not defined CXX ( set "CXX=clang++" ) +set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -o b2.exe" +set "_known_=1" +goto :eof + :Config_GCC_NOCYGWIN if not defined CXX ( set "CXX=g++" ) set "B2_CXX=%CXX% -x c++ -std=c++11 -s -O3 -mno-cygwin -o b2.exe" From 84666e77fab97c5fc7fe3688955bc833602c52c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Wed, 9 Sep 2020 09:46:08 -0500 Subject: [PATCH 017/126] 64/32 bit compile working by using int32 types as needed. --- src/engine/builtins.cpp | 16 +- src/engine/debug.cpp | 2 +- src/engine/debug.h | 2 +- src/engine/debugger.cpp | 10 +- src/engine/execcmd.cpp | 6 +- src/engine/execcmd.h | 8 +- src/engine/execnt.cpp | 112 +++---- src/engine/execunix.cpp | 4 +- src/engine/execvms.cpp | 4 +- src/engine/filent.cpp | 8 +- src/engine/fileunix.cpp | 2 +- src/engine/filevms.cpp | 2 +- src/engine/function.cpp | 440 ++++++++++++++-------------- src/engine/function.h | 8 +- src/engine/hash.cpp | 38 +-- src/engine/hash.h | 4 +- src/engine/jam.cpp | 2 +- src/engine/jam_strings.cpp | 32 +- src/engine/jam_strings.h | 8 +- src/engine/lists.cpp | 69 +++-- src/engine/lists.h | 16 +- src/engine/make.cpp | 40 +-- src/engine/make.h | 18 +- src/engine/make1.cpp | 95 +++--- src/engine/modules/order.cpp | 42 +-- src/engine/modules/property-set.cpp | 14 +- src/engine/modules/regex.cpp | 2 +- src/engine/native.cpp | 4 +- src/engine/native.h | 4 +- src/engine/object.cpp | 29 +- src/engine/object.h | 2 +- src/engine/pathnt.cpp | 10 +- src/engine/pathsys.cpp | 12 +- src/engine/pathsys.h | 2 +- src/engine/regexp.cpp | 106 +++---- src/engine/regexp.h | 4 +- src/engine/search.cpp | 6 +- src/engine/sysinfo.cpp | 4 +- src/engine/variable.cpp | 2 +- src/engine/w32_getreg.cpp | 4 +- 40 files changed, 590 insertions(+), 603 deletions(-) diff --git a/src/engine/builtins.cpp b/src/engine/builtins.cpp index cf3971621e..2f6ff22176 100644 --- a/src/engine/builtins.cpp +++ b/src/engine/builtins.cpp @@ -911,7 +911,7 @@ LIST * glob_recursive( char const * pattern ) { OBJECT * p; path->f_dir.ptr = object_str( list_item( iter ) ); - path->f_dir.len = strlen( object_str( list_item( iter ) ) ); + path->f_dir.len = int32_t(strlen( object_str( list_item( iter ) ) )); path_build( path, file_string ); p = object_new( file_string->value ); @@ -1749,14 +1749,14 @@ LIST * builtin_pad( FRAME * frame, int flags ) OBJECT * string = list_front( lol_get( frame->args, 0 ) ); char const * width_s = object_str( list_front( lol_get( frame->args, 1 ) ) ); - int current = strlen( object_str( string ) ); - int desired = atoi( width_s ); + int32_t current = int32_t(strlen( object_str( string ) )); + int32_t desired = atoi( width_s ); if ( current >= desired ) return list_new( object_copy( string ) ); else { char * buffer = (char *)BJAM_MALLOC( desired + 1 ); - int i; + int32_t i; LIST * result; strcpy( buffer, object_str( string ) ); @@ -1886,7 +1886,7 @@ LIST *builtin_readlink( FRAME * frame, int flags ) #else char static_buf[256]; char * buf = static_buf; - size_t bufsize = 256; + int32_t bufsize = 256; LIST * result = 0; while (1) { ssize_t len = readlink( path, buf, bufsize ); @@ -1894,7 +1894,7 @@ LIST *builtin_readlink( FRAME * frame, int flags ) { break; } - else if ( size_t(len) < bufsize ) + else if ( int32_t(len) < bufsize ) { buf[ len ] = '\0'; result = list_new( object_new( buf ) ); @@ -2400,7 +2400,7 @@ LIST * builtin_shell( FRAME * frame, int flags ) LIST * command = lol_get( frame->args, 0 ); LIST * result = L0; string s; - int ret; + int32_t ret; char buffer[ 1024 ]; FILE * p = NULL; int exit_status = -1; @@ -2435,7 +2435,7 @@ LIST * builtin_shell( FRAME * frame, int flags ) string_new( &s ); - while ( ( ret = fread( buffer, sizeof( char ), sizeof( buffer ) - 1, p ) ) > + while ( ( ret = int32_t(fread( buffer, sizeof( char ), sizeof( buffer ) - 1, p )) ) > 0 ) { buffer[ ret ] = 0; diff --git a/src/engine/debug.cpp b/src/engine/debug.cpp index 8fcf7e362e..dbdef4ef77 100644 --- a/src/engine/debug.cpp +++ b/src/engine/debug.cpp @@ -73,7 +73,7 @@ void profile_enter( OBJECT * rulename, profile_frame * frame ) } -void profile_memory( size_t mem ) +void profile_memory( int32_t mem ) { if ( DEBUG_PROFILE ) if ( profile_stack && profile_stack->info ) diff --git a/src/engine/debug.h b/src/engine/debug.h index 20824577e3..7d9d10ee8a 100644 --- a/src/engine/debug.h +++ b/src/engine/debug.h @@ -45,7 +45,7 @@ typedef struct profile_frame profile_frame * profile_init( OBJECT * rulename, profile_frame * ); void profile_enter( OBJECT * rulename, profile_frame * ); -void profile_memory( size_t mem ); +void profile_memory( int32_t mem ); void profile_exit( profile_frame * ); void profile_dump(); double profile_clock(); diff --git a/src/engine/debugger.cpp b/src/engine/debugger.cpp index 051166699b..3486c60c03 100644 --- a/src/engine/debugger.cpp +++ b/src/engine/debugger.cpp @@ -328,7 +328,7 @@ static OBJECT * make_absolute_path( OBJECT * filename ) const char * root = object_str( cwd() ); path_parse( object_str( filename ), path1 ); path1->f_root.ptr = root; - path1->f_root.len = strlen( root ); + path1->f_root.len = int32_t(strlen( root )); string_new( buf ); path_build( path1, buf ); result = object_new( buf->value ); @@ -580,7 +580,7 @@ static int debug_add_breakpoint( const char * name ) long line = strtoul( ptr + 1, &end, 10 ); if ( line > 0 && line <= INT_MAX && end != ptr + 1 && *end == 0 ) { - OBJECT * file = object_new_range( file_ptr, ptr - file_ptr ); + OBJECT * file = object_new_range( file_ptr, int32_t(ptr - file_ptr) ); return add_line_breakpoint( file, line ); } else @@ -615,7 +615,7 @@ static int get_breakpoint_by_name( const char * name ) long line = strtoul( ptr + 1, &end, 10 ); if ( line > 0 && line <= INT_MAX && end != ptr + 1 && *end == 0 ) { - OBJECT * file = object_new_range( file_ptr, ptr - file_ptr ); + OBJECT * file = object_new_range( file_ptr, int32_t(ptr - file_ptr) ); result = handle_line_breakpoint( file, line ); object_free( file ); } @@ -772,7 +772,7 @@ static int get_module_filename( string * out ) DWORD result; string_reserve( out, 256 + 1 ); string_truncate( out, 256 ); - while( ( result = GetModuleFileNameA( NULL, out->value, out->size ) ) == out->size ) + while( ( result = GetModuleFileNameA( NULL, out->value, DWORD(out->size) ) ) == out->size ) { string_reserve( out, out->size * 2 + 1); string_truncate( out, out->size * 2 ); @@ -2690,7 +2690,7 @@ static int process_command( char * line ) *iter++ = '\0'; } } - result = run_command( current - buffer, (const char **)buffer ); + result = run_command( int(current - buffer), (const char **)buffer ); free( (void *)buffer ); return result; } diff --git a/src/engine/execcmd.cpp b/src/engine/execcmd.cpp index ecc554664f..b6c715171d 100644 --- a/src/engine/execcmd.cpp +++ b/src/engine/execcmd.cpp @@ -74,12 +74,12 @@ void argv_from_shell( char const * * argv, LIST * shell, char const * command, /* Returns whether the given command string contains lines longer than the given * maximum. */ -int check_cmd_for_too_long_lines( char const * command, size_t max, - size_t * const error_length, size_t * const error_max_length ) +int check_cmd_for_too_long_lines( char const * command, int32_t max, + int32_t * const error_length, int32_t * const error_max_length ) { while ( *command ) { - size_t const l = strcspn( command, "\n" ); + int32_t const l = int32_t(strcspn( command, "\n" )); if ( l > max ) { *error_length = l; diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index ec7a226490..206fb77883 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -54,8 +54,8 @@ int exec_check ( string const * command, LIST * * pShell, - size_t * error_length, - size_t * error_max_length + int32_t * error_length, + int32_t * error_max_length ); /* exec_check() return codes. */ @@ -109,7 +109,7 @@ int is_raw_command_request( LIST * shell ); /* Utility worker for exec_check() checking whether all the given command lines * are under the specified length limit. */ -int check_cmd_for_too_long_lines( char const * command, size_t max, - size_t * const error_length, size_t * const error_max_length ); +int check_cmd_for_too_long_lines( char const * command, int32_t max, + int32_t * const error_length, int32_t * const error_max_length ); #endif diff --git a/src/engine/execnt.cpp b/src/engine/execnt.cpp index 45f2062c84..be0a57a9b9 100644 --- a/src/engine/execnt.cpp +++ b/src/engine/execnt.cpp @@ -69,9 +69,9 @@ /* get the maximum shell command line length according to the OS */ -static int maxline(); +static int32_t maxline(); /* valid raw command string length */ -static size_t raw_command_length( char const * command ); +static int32_t raw_command_length( char const * command ); /* add two 64-bit unsigned numbers, h1l1 and h2l2 */ static FILETIME add_64( unsigned long h1, unsigned long l1, @@ -87,33 +87,33 @@ static double running_time( HANDLE const ); /* terminate the given process, after terminating all its children first */ static void kill_process_tree( DWORD const procesdId, HANDLE const ); /* waits for a command to complete or time out */ -static int try_wait( int const timeoutMillis ); +static int32_t try_wait( int32_t const timeoutMillis ); /* reads any pending output for running commands */ static void read_output(); /* checks if a command ran out of time, and kills it */ -static int try_kill_one(); +static int32_t try_kill_one(); /* is the first process a parent (direct or indirect) to the second one */ -static int is_parent_child( DWORD const parent, DWORD const child ); +static int32_t is_parent_child( DWORD const parent, DWORD const child ); /* */ static void close_alert( PROCESS_INFORMATION const * const ); /* close any alerts hanging around */ static void close_alerts(); /* prepare a command file to be executed using an external shell */ -static char const * prepare_command_file( string const * command, int slot ); +static char const * prepare_command_file( string const * command, int32_t slot ); /* invoke the actual external process using the given command line */ -static void invoke_cmd( char const * const command, int const slot ); +static void invoke_cmd( char const * const command, int32_t const slot ); /* find a free slot in the running commands table */ -static int get_free_cmdtab_slot(); +static int32_t get_free_cmdtab_slot(); /* put together the final command string we are to run */ static void string_new_from_argv( string * result, char const * const * argv ); /* frees and renews the given string */ static void string_renew( string * const ); /* reports the last failed Windows API related error message */ -static void reportWindowsError( char const * const apiName, int slot ); +static void reportWindowsError( char const * const apiName, int32_t slot ); /* closes a Windows HANDLE and resets its variable to 0. */ static void closeWinHandle( HANDLE * const handle ); /* Adds the job index to the list of currently active jobs. */ -static void register_wait( int job_id ); +static void register_wait( int32_t job_id ); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -132,7 +132,7 @@ static void register_wait( int job_id ); #define EXECCMD_PIPE_READ 0 #define EXECCMD_PIPE_WRITE 1 -static int intr_installed; +static int32_t intr_installed; /* The list of commands we run. */ @@ -154,7 +154,7 @@ static struct _cmdtab_t HANDLE wait_handle; - int flags; + int32_t flags; /* Function called when the command completes. */ ExecCmdCallback func; @@ -162,14 +162,14 @@ static struct _cmdtab_t /* Opaque data passed back to the 'func' callback. */ void * closure; } * cmdtab = NULL; -static int cmdtab_size = 0; +static int32_t cmdtab_size = 0; /* A thread-safe single element queue. Used by the worker threads * to signal the main thread that a process is completed. */ struct { - int job_index; + int32_t job_index; HANDLE read_okay; HANDLE write_okay; } process_queue; @@ -185,7 +185,7 @@ void execnt_unit_test() * Use a table instead. */ { - typedef struct test { const char * command; size_t result; } test; + typedef struct test { const char * command; int32_t result; } test; test tests[] = { { "", 0 }, { " ", 0 }, @@ -218,9 +218,9 @@ void execnt_unit_test() } { - size_t const length = maxline() + 9; - char * const cmd = (char *)BJAM_MALLOC_ATOMIC( length + 1 ); - memset( cmd, 'x', length ); + int32_t const length = maxline() + 9; + char * const cmd = (char *)BJAM_MALLOC_ATOMIC( size_t(length) + 1 ); + memset( cmd, 'x', size_t(length) ); cmd[ length ] = 0; assert( raw_command_length( cmd ) == length ); BJAM_FREE( cmd ); @@ -266,12 +266,12 @@ void exec_done( void ) * exec_check() - preprocess and validate the command */ -int exec_check +int32_t exec_check ( string const * command, LIST * * pShell, - size_t * error_length, - size_t * error_max_length + int32_t * error_length, + int32_t * error_max_length ) { /* Default shell does nothing when triggered with an empty or a @@ -290,7 +290,7 @@ int exec_check /* Check prerequisites for executing raw commands. */ if ( is_raw_command_request( *pShell ) ) { - size_t const raw_cmd_length = raw_command_length( command->value ); + int32_t const raw_cmd_length = raw_command_length( command->value ); if ( raw_cmd_length < 0 ) { /* Invalid characters detected - fallback to default shell. */ @@ -333,14 +333,14 @@ int exec_check void exec_cmd ( string const * cmd_orig, - int flags, + int32_t flags, ExecCmdCallback func, void * closure, LIST * shell ) { - int const slot = get_free_cmdtab_slot(); - int const is_raw_cmd = is_raw_command_request( shell ); + int32_t const slot = get_free_cmdtab_slot(); + int32_t const is_raw_cmd = is_raw_command_request( shell ); string cmd_local[ 1 ]; /* Initialize default shell - anything more than /Q/C is non-portable. */ @@ -380,7 +380,7 @@ void exec_cmd end = p; string_new( cmd_local ); string_append_range( cmd_local, start, end ); - assert( size_t(cmd_local->size) == raw_command_length( cmd_orig->value ) ); + assert( int32_t(cmd_local->size) == raw_command_length( cmd_orig->value ) ); } /* If we are not running a raw command directly, prepare a command file to * be executed using an external shell and the actual command string using @@ -424,8 +424,8 @@ void exec_cmd void exec_wait() { - int i = -1; - int exit_reason; /* reason why a command completed */ + int32_t i = -1; + int32_t exit_reason; /* reason why a command completed */ /* Wait for a command to complete, while snarfing up any output. */ while ( 1 ) @@ -447,7 +447,7 @@ void exec_wait() { DWORD exit_code; timing_info time; - int rstat; + int32_t rstat; /* The time data for the command. */ record_times( cmdtab[ i ].pi.hProcess, &time ); @@ -494,7 +494,7 @@ void exec_wait() * process in our running commands table. */ -static void invoke_cmd( char const * const command, int const slot ) +static void invoke_cmd( char const * const command, int32_t const slot ) { SECURITY_ATTRIBUTES sa = { sizeof( SECURITY_ATTRIBUTES ), 0, 0 }; SECURITY_DESCRIPTOR sd; @@ -577,16 +577,16 @@ static void invoke_cmd( char const * const command, int const slot ) * http://support.microsoft.com/default.aspx?scid=kb;en-us;830473 */ -static int raw_maxline() +static int32_t raw_maxline() { if ( IsWindowsVersionOrGreater(5,0,0) == TRUE ) return 8191; /* XP */ if ( IsWindowsVersionOrGreater(4,0,0) == TRUE ) return 2047; /* NT 4.x */ return 996; /* NT 3.5.1 */ } -static int maxline() +static int32_t maxline() { - static int result; + static int32_t result; if ( !result ) result = raw_maxline(); return result; } @@ -632,7 +632,7 @@ static void string_renew( string * const s ) * affect the executed command). */ -static size_t raw_command_length( char const * command ) +static int32_t raw_command_length( char const * command ) { char const * p; char const * escape = 0; @@ -688,7 +688,7 @@ static size_t raw_command_length( char const * command ) while ( *p ); /* Return the number of characters the command will occupy. */ - return ( newline ? newline : p ) - command; + return int32_t(( newline ? newline : p ) - command); } @@ -771,7 +771,7 @@ static void read_pipe ( HANDLE in, /* the pipe to read from */ string * out, - int forwarding_mode + int32_t forwarding_mode ) { DWORD bytesInBuffer = 0; @@ -820,7 +820,7 @@ static void read_pipe static void read_output() { - int i; + int32_t i; for ( i = 0; i < globs.jobs; ++i ) if ( cmdtab[ i ].pi.hProcess ) { @@ -839,17 +839,17 @@ static void CALLBACK try_wait_callback( void * data, BOOLEAN is_timeout ) { struct _cmdtab_t * slot = ( struct _cmdtab_t * )data; WaitForSingleObject( process_queue.write_okay, INFINITE ); - process_queue.job_index = slot - cmdtab; + process_queue.job_index = int32_t(slot - cmdtab); assert( !is_timeout ); SetEvent( process_queue.read_okay ); /* Okay. Non-blocking. */ UnregisterWait( slot->wait_handle ); } -static int try_wait_impl( DWORD timeout ) +static int32_t try_wait_impl( DWORD timeout ) { - int job_index; - int res = WaitForSingleObject( process_queue.read_okay, timeout ); + int32_t job_index; + int32_t res = WaitForSingleObject( process_queue.read_okay, timeout ); if ( res != WAIT_OBJECT_0 ) return -1; job_index = process_queue.job_index; @@ -857,7 +857,7 @@ static int try_wait_impl( DWORD timeout ) return job_index; } -static void register_wait( int job_id ) +static void register_wait( int32_t job_id ) { if ( globs.jobs > MAXIMUM_WAIT_OBJECTS ) { @@ -874,13 +874,13 @@ static void register_wait( int job_id ) * cmdtab array, or -1. */ -static int try_wait( int const timeoutMillis ) +static int32_t try_wait( int32_t const timeoutMillis ) { if ( globs.jobs <= MAXIMUM_WAIT_OBJECTS ) { - int i; + int32_t i; HANDLE active_handles[ MAXIMUM_WAIT_OBJECTS ]; - int job_ids[ MAXIMUM_WAIT_OBJECTS ]; + int32_t job_ids[ MAXIMUM_WAIT_OBJECTS ]; DWORD num_handles = 0; DWORD wait_api_result; for ( i = 0; i < globs.jobs; ++i ) @@ -910,12 +910,12 @@ static int try_wait( int const timeoutMillis ) } -static int try_kill_one() +static int32_t try_kill_one() { /* Only need to check if a timeout was specified with the -l option. */ if ( globs.timeout > 0 ) { - int i; + int32_t i; for ( i = 0; i < globs.jobs; ++i ) if ( cmdtab[ i ].pi.hProcess ) { @@ -946,7 +946,7 @@ static void close_alerts() */ if ( ( (float)clock() / (float)( CLOCKS_PER_SEC * 5 ) ) < ( 1.0 / 5.0 ) ) { - int i; + int32_t i; for ( i = 0; i < globs.jobs; ++i ) if ( cmdtab[ i ].pi.hProcess ) close_alert( &cmdtab[ i ].pi ); @@ -1034,7 +1034,7 @@ static double creation_time( HANDLE const process ) * process is System (first argument is ignored). */ -static int is_parent_child( DWORD const parent, DWORD const child ) +static int32_t is_parent_child( DWORD const parent, DWORD const child ) { HANDLE process_snapshot_h = INVALID_HANDLE_VALUE; @@ -1202,7 +1202,7 @@ static void close_alert( PROCESS_INFORMATION const * const pi ) * function. */ -static FILE * open_command_file( int const slot ) +static FILE * open_command_file( int32_t const slot ) { string * const command_file = cmdtab[ slot ].command_file; @@ -1234,13 +1234,13 @@ static FILE * open_command_file( int const slot ) { char * const index1 = command_file->value + command_file->size - 6; char * const index2 = index1 + 1; - int waits_remaining; + int32_t waits_remaining; assert( command_file->value < index1 ); assert( index2 + 1 < command_file->value + command_file->size ); assert( index2[ 1 ] == '.' ); for ( waits_remaining = 3; ; --waits_remaining ) { - int index; + int32_t index; for ( index = 0; index != 20; ++index ) { FILE * f; @@ -1262,7 +1262,7 @@ static FILE * open_command_file( int const slot ) * Prepare a command file to be executed using an external shell. */ -static char const * prepare_command_file( string const * command, int slot ) +static char const * prepare_command_file( string const * command, int32_t slot ) { FILE * const f = open_command_file( slot ); if ( !f ) @@ -1280,9 +1280,9 @@ static char const * prepare_command_file( string const * command, int slot ) * Find a free slot in the running commands table. */ -static int get_free_cmdtab_slot() +static int32_t get_free_cmdtab_slot() { - int slot; + int32_t slot; for ( slot = 0; slot < globs.jobs; ++slot ) if ( !cmdtab[ slot ].pi.hProcess ) return slot; @@ -1314,7 +1314,7 @@ static void string_new_from_argv( string * result, char const * const * argv ) * Reports the last failed Windows API related error message. */ -static void reportWindowsError( char const * const apiName, int slot ) +static void reportWindowsError( char const * const apiName, int32_t slot ) { char * errorMessage; char buf[24]; diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index 8719424816..9b6ee0fc9e 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -140,8 +140,8 @@ int exec_check ( string const * command, LIST * * pShell, - size_t * error_length, - size_t * error_max_length + int32_t * error_length, + int32_t * error_max_length ) { int const is_raw_cmd = is_raw_command_request( *pShell ); diff --git a/src/engine/execvms.cpp b/src/engine/execvms.cpp index 3ed161649d..e5a12bc62a 100644 --- a/src/engine/execvms.cpp +++ b/src/engine/execvms.cpp @@ -75,8 +75,8 @@ int exec_check ( string const * command, LIST * * pShell, - size_t * error_length, - size_t * error_max_length + int32_t * error_length, + int32_t * error_max_length ) { int const is_raw_cmd = 1; diff --git a/src/engine/filent.cpp b/src/engine/filent.cpp index 72448f1e24..551f71c757 100644 --- a/src/engine/filent.cpp +++ b/src/engine/filent.cpp @@ -62,13 +62,13 @@ int file_collect_dir_content_( file_info_t * const d ) string pathspec[ 1 ]; string pathname[ 1 ]; LIST * files = L0; - size_t d_length; + int32_t d_length; assert( d ); assert( d->is_dir ); assert( list_empty( d->files ) ); - d_length = strlen( object_str( d->name ) ); + d_length = int32_t(strlen( object_str( d->name ) )); memset( (char *)&f, '\0', sizeof( f ) ); f.f_dir.ptr = object_str( d->name ); @@ -112,7 +112,7 @@ int file_collect_dir_content_( file_info_t * const d ) OBJECT * pathname_obj; f.f_base.ptr = finfo.cFileName; - f.f_base.len = strlen( finfo.cFileName ); + f.f_base.len = int32_t(strlen( finfo.cFileName )); string_truncate( pathname, 0 ); path_build( &f, pathname ); @@ -276,7 +276,7 @@ void file_query_( file_info_t * const info ) if ( ( dir = strrchr( pathstr, '\\' ) ) ) { - parent = object_new_range( pathstr, dir - pathstr ); + parent = object_new_range( pathstr, int32_t(dir - pathstr) ); } else { diff --git a/src/engine/fileunix.cpp b/src/engine/fileunix.cpp index 4c1b6adf34..9d8dc17faf 100644 --- a/src/engine/fileunix.cpp +++ b/src/engine/fileunix.cpp @@ -307,7 +307,7 @@ int file_collect_archive_content_( file_archive_info_t * const archive ) char * src; char * dest; - size_t ar_hdr_name_size = sizeof( ar_hdr.ar_name ); // Workaround for sizeof strncpy warning. + int32_t ar_hdr_name_size = sizeof( ar_hdr.ar_name ); // Workaround for sizeof strncpy warning. strncpy( lar_name, ar_hdr.ar_name, ar_hdr_name_size ); sscanf( ar_hdr.ar_date, "%ld", &lar_date ); diff --git a/src/engine/filevms.cpp b/src/engine/filevms.cpp index ab038d065b..03f980a1e3 100644 --- a/src/engine/filevms.cpp +++ b/src/engine/filevms.cpp @@ -229,7 +229,7 @@ file_cvttime( unsigned int *curtime, time_t *unixtime ) { - static const size_t divisor = 10000000; + static const int32_t divisor = 10000000; static unsigned int bastim[2] = { 0x4BEB4000, 0x007C9567 }; /* 1/1/1970 */ int delta[2], remainder; diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 295192d158..d8971471c1 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -40,7 +40,7 @@ #define PROFILE_EXIT_LOCAL(x) #endif -int glob( char const * s, char const * c ); +int32_t glob( char const * s, char const * c ); void backtrace( FRAME * ); void backtrace_line( FRAME * ); @@ -130,22 +130,22 @@ void backtrace_line( FRAME * ); typedef struct instruction { - unsigned int op_code; - int arg; + uint32_t op_code; + int32_t arg; } instruction; typedef struct _subfunction { OBJECT * name; FUNCTION * code; - int local; + int32_t local; } SUBFUNCTION; typedef struct _subaction { OBJECT * name; FUNCTION * command; - int flags; + int32_t flags; } SUBACTION; #define FUNCTION_BUILTIN 0 @@ -153,7 +153,7 @@ typedef struct _subaction struct argument { - int flags; + int32_t flags; #define ARG_ONE 0 #define ARG_OPTIONAL 1 #define ARG_PLUS 2 @@ -161,45 +161,45 @@ struct argument #define ARG_VARIADIC 4 OBJECT * type_name; OBJECT * arg_name; - int index; + int32_t index; }; struct arg_list { - int size; + int32_t size; struct argument * args; }; struct _function { - int type; - int reference_count; + int32_t type; + int32_t reference_count; OBJECT * rulename; struct arg_list * formal_arguments; - int num_formal_arguments; + int32_t num_formal_arguments; }; typedef struct _builtin_function { FUNCTION base; - LIST * ( * func )( FRAME *, int flags ); - int flags; + LIST * ( * func )( FRAME *, int32_t flags ); + int32_t flags; } BUILTIN_FUNCTION; typedef struct _jam_function { FUNCTION base; - int code_size; + int32_t code_size; instruction * code; - int num_constants; + int32_t num_constants; OBJECT * * constants; - int num_subfunctions; + int32_t num_subfunctions; SUBFUNCTION * functions; - int num_subactions; + int32_t num_subactions; SUBACTION * actions; FUNCTION * generic; OBJECT * file; - int line; + int32_t line; } JAM_FUNCTION; @@ -230,7 +230,7 @@ STACK * stack_global() static STACK result; if ( !stack ) { - int const size = 1 << 21; + int32_t const size = 1 << 21; stack = BJAM_MALLOC( size ); result.data = (char *)stack + size; } @@ -251,7 +251,7 @@ static void check_alignment( STACK * s ) assert( (size_t)s->data % LISTPTR_ALIGN == 0 ); } -void * stack_allocate( STACK * s, int size ) +void * stack_allocate( STACK * s, int32_t size ) { check_alignment( s ); s->data = (char *)s->data - size; @@ -259,7 +259,7 @@ void * stack_allocate( STACK * s, int size ) return s->data; } -void stack_deallocate( STACK * s, int size ) +void stack_deallocate( STACK * s, int32_t size ) { check_alignment( s ); s->data = (char *)s->data + size; @@ -284,13 +284,13 @@ LIST * stack_top( STACK * s ) return *(LIST * *)s->data; } -LIST * stack_at( STACK * s, int n ) +LIST * stack_at( STACK * s, int32_t n ) { check_alignment( s ); return *( (LIST * *)s->data + n ); } -void stack_set( STACK * s, int n, LIST * value ) +void stack_set( STACK * s, int32_t n, LIST * value ) { check_alignment( s ); *((LIST * *)s->data + n) = value; @@ -302,56 +302,56 @@ void * stack_get( STACK * s ) return s->data; } -LIST * frame_get_local( FRAME * frame, int idx ) +LIST * frame_get_local( FRAME * frame, int32_t idx ) { /* The only local variables are the arguments. */ return list_copy( lol_get( frame->args, idx ) ); } -static OBJECT * function_get_constant( JAM_FUNCTION * function, int idx ) +static OBJECT * function_get_constant( JAM_FUNCTION * function, int32_t idx ) { return function->constants[ idx ]; } static LIST * function_get_variable( JAM_FUNCTION * function, FRAME * frame, - int idx ) + int32_t idx ) { return list_copy( var_get( frame->module, function->constants[ idx ] ) ); } static void function_set_variable( JAM_FUNCTION * function, FRAME * frame, - int idx, LIST * value ) + int32_t idx, LIST * value ) { var_set( frame->module, function->constants[ idx ], value, VAR_SET ); } static LIST * function_swap_variable( JAM_FUNCTION * function, FRAME * frame, - int idx, LIST * value ) + int32_t idx, LIST * value ) { return var_swap( frame->module, function->constants[ idx ], value ); } static void function_append_variable( JAM_FUNCTION * function, FRAME * frame, - int idx, LIST * value ) + int32_t idx, LIST * value ) { var_set( frame->module, function->constants[ idx ], value, VAR_APPEND ); } static void function_default_variable( JAM_FUNCTION * function, FRAME * frame, - int idx, LIST * value ) + int32_t idx, LIST * value ) { var_set( frame->module, function->constants[ idx ], value, VAR_DEFAULT ); } static void function_set_rule( JAM_FUNCTION * function, FRAME * frame, - STACK * s, int idx ) + STACK * s, int32_t idx ) { SUBFUNCTION * sub = function->functions + idx; new_rule_body( frame->module, sub->name, sub->code, !sub->local ); } static void function_set_actions( JAM_FUNCTION * function, FRAME * frame, - STACK * s, int idx ) + STACK * s, int32_t idx ) { SUBACTION * sub = function->actions + idx; LIST * bindlist = stack_pop( s ); @@ -365,7 +365,7 @@ static void function_set_actions( JAM_FUNCTION * function, FRAME * frame, * returns -1. */ -static int get_argument_index( char const * s ) +static int32_t get_argument_index( char const * s ) { if ( s[ 0 ] != '\0') { @@ -412,7 +412,7 @@ static int get_argument_index( char const * s ) static LIST * function_get_named_variable( JAM_FUNCTION * function, FRAME * frame, OBJECT * name ) { - int const idx = get_argument_index( object_str( name ) ); + int32_t const idx = get_argument_index( object_str( name ) ); return idx == -1 ? list_copy( var_get( frame->module, name ) ) : list_copy( lol_get( frame->args, idx ) ); @@ -443,10 +443,10 @@ static void function_default_named_variable( JAM_FUNCTION * function, } static LIST * function_call_rule( JAM_FUNCTION * function, FRAME * frame, - STACK * s, int n_args, char const * unexpanded, OBJECT * file, int line ) + STACK * s, int32_t n_args, char const * unexpanded, OBJECT * file, int32_t line ) { FRAME inner[ 1 ]; - int i; + int32_t i; LIST * first = stack_pop( s ); LIST * result = L0; OBJECT * rulename; @@ -497,10 +497,10 @@ static LIST * function_call_rule( JAM_FUNCTION * function, FRAME * frame, return result; } -static LIST * function_call_member_rule( JAM_FUNCTION * function, FRAME * frame, STACK * s, int n_args, OBJECT * rulename, OBJECT * file, int line ) +static LIST * function_call_member_rule( JAM_FUNCTION * function, FRAME * frame, STACK * s, int32_t n_args, OBJECT * rulename, OBJECT * file, int32_t line ) { FRAME inner[ 1 ]; - int i; + int32_t i; LIST * first = stack_pop( s ); LIST * result = L0; RULE * rule; @@ -613,8 +613,8 @@ static LIST * function_call_member_rule( JAM_FUNCTION * function, FRAME * frame, typedef struct { - int sub1; - int sub2; + int32_t sub1; + int32_t sub2; } subscript_t; typedef struct @@ -631,9 +631,9 @@ typedef struct } VAR_EDITS; static LIST * apply_modifiers_impl( LIST * result, string * buf, - VAR_EDITS * edits, int n, LISTITER iter, LISTITER end ); + VAR_EDITS * edits, int32_t n, LISTITER iter, LISTITER end ); static void get_iters( subscript_t const subscript, LISTITER * const first, - LISTITER * const last, int const length ); + LISTITER * const last, int32_t const length ); /* @@ -671,7 +671,7 @@ static void get_iters( subscript_t const subscript, LISTITER * const first, * var_edit_file() below and path_build() obligingly follow this convention. */ -static int var_edit_parse( char const * mods, VAR_EDITS * edits, int havezeroed +static int32_t var_edit_parse( char const * mods, VAR_EDITS * edits, int32_t havezeroed ) { while ( *mods ) @@ -709,7 +709,7 @@ static int var_edit_parse( char const * mods, VAR_EDITS * edits, int havezeroed { if ( !havezeroed++ ) { - int i; + int32_t i; for ( i = 0; i < 6; ++i ) { edits->f.part[ i ].len = 0; @@ -731,7 +731,7 @@ static int var_edit_parse( char const * mods, VAR_EDITS * edits, int havezeroed else { fp->ptr = ++mods; - fp->len = strlen( mods ); + fp->len = int32_t(strlen( mods )); mods += fp->len; } } @@ -779,12 +779,12 @@ static void var_edit_file( char const * in, string * out, VAR_EDITS * edits ) * var_edit_translate_path() - translate path to os native format. */ -static void var_edit_translate_path( string * out, size_t pos, VAR_EDITS * edits ) +static void var_edit_translate_path( string * out, int32_t pos, VAR_EDITS * edits ) { if ( edits->to_windows ) { string result[ 1 ]; - int translated; + int32_t translated; /* Translate path to os native format. */ translated = path_translate_to_os( out->value + pos, result ); @@ -806,7 +806,7 @@ static void var_edit_translate_path( string * out, size_t pos, VAR_EDITS * edits * var_edit_shift() - do upshift/downshift & other mods. */ -static void var_edit_shift( string * out, size_t pos, VAR_EDITS * edits ) +static void var_edit_shift( string * out, int32_t pos, VAR_EDITS * edits ) { #if defined( OS_CYGWIN ) || defined( OS_VMS ) var_edit_translate_path( out, pos, edits ); @@ -834,10 +834,10 @@ static void var_edit_shift( string * out, size_t pos, VAR_EDITS * edits ) * Returns the number of VAR_EDITS pushed onto the STACK. */ -static int expand_modifiers( STACK * s, int n ) +static int32_t expand_modifiers( STACK * s, int32_t n ) { - int i; - int total = 1; + int32_t i; + int32_t total = 1; LIST * * args = (LIST**)stack_get( s ); for ( i = 0; i < n; ++i ) total *= list_length( args[ i ] ); @@ -850,7 +850,7 @@ static int expand_modifiers( STACK * s, int n ) iter[ i ] = list_begin( args[ i ] ); i = 0; { - int havezeroed; + int32_t havezeroed; loop: memset( out, 0, sizeof( *out ) ); havezeroed = 0; @@ -873,7 +873,7 @@ static int expand_modifiers( STACK * s, int n ) return total; } -static LIST * apply_modifiers( STACK * s, int n ) +static LIST * apply_modifiers( STACK * s, int32_t n ) { LIST * value = stack_top( s ); LIST * result = L0; @@ -953,7 +953,7 @@ static LIST * apply_subscript( STACK * s ) LIST * value = stack_top( s ); LIST * indices = stack_at( s, 1 ); LIST * result = L0; - int length = list_length( value ); + int32_t length = list_length( value ); string buf[ 1 ]; LISTITER indices_iter = list_begin( indices ); LISTITER const indices_end = list_end( indices ); @@ -980,10 +980,10 @@ static LIST * apply_subscript( STACK * s ) */ static void get_iters( subscript_t const subscript, LISTITER * const first, - LISTITER * const last, int const length ) + LISTITER * const last, int32_t const length ) { - int start; - int size; + int32_t start; + int32_t size; LISTITER iter; LISTITER end; { @@ -1028,9 +1028,9 @@ static void get_iters( subscript_t const subscript, LISTITER * const first, } static LIST * apply_modifiers_empty( LIST * result, string * buf, - VAR_EDITS * edits, int n ) + VAR_EDITS * edits, int32_t n ) { - int i; + int32_t i; for ( i = 0; i < n; ++i ) { if ( edits[ i ].empty.ptr ) @@ -1046,9 +1046,9 @@ static LIST * apply_modifiers_empty( LIST * result, string * buf, } static LIST * apply_modifiers_non_empty( LIST * result, string * buf, - VAR_EDITS * edits, int n, LISTITER begin, LISTITER end ) + VAR_EDITS * edits, int32_t n, LISTITER begin, LISTITER end ) { - int i; + int32_t i; LISTITER iter; for ( i = 0; i < n; ++i ) { @@ -1059,7 +1059,7 @@ static LIST * apply_modifiers_non_empty( LIST * result, string * buf, for ( iter = list_next( begin ); iter != end; iter = list_next( iter ) ) { - size_t size; + int32_t size; string_append( buf, edits[ i ].join.ptr ); size = buf->size; var_edit_file( object_str( list_item( iter ) ), buf, edits + i @@ -1084,20 +1084,20 @@ static LIST * apply_modifiers_non_empty( LIST * result, string * buf, } static LIST * apply_modifiers_impl( LIST * result, string * buf, - VAR_EDITS * edits, int n, LISTITER iter, LISTITER end ) + VAR_EDITS * edits, int32_t n, LISTITER iter, LISTITER end ) { return iter == end ? apply_modifiers_empty( result, buf, edits, n ) : apply_modifiers_non_empty( result, buf, edits, n, iter, end ); } -static LIST * apply_subscript_and_modifiers( STACK * s, int n ) +static LIST * apply_subscript_and_modifiers( STACK * s, int32_t n ) { LIST * const value = stack_top( s ); LIST * const indices = stack_at( s, 1 ); LIST * result = L0; VAR_EDITS * const edits = (VAR_EDITS *)((LIST * *)stack_get( s ) + 2); - int const length = list_length( value ); + int32_t const length = list_length( value ); string buf[ 1 ]; LISTITER indices_iter = list_begin( indices ); LISTITER const indices_end = list_end( indices ); @@ -1158,17 +1158,17 @@ typedef struct expansion_item /* Internal data initialized and used inside expand(). */ LISTITER current; /* Currently used value. */ - int size; /* Concatenated string length prior to concatenating the + int32_t size; /* Concatenated string length prior to concatenating the * item's current value. */ } expansion_item; -static LIST * expand( expansion_item * items, int const length ) +static LIST * expand( expansion_item * items, int32_t const length ) { LIST * result = L0; string buf[ 1 ]; - int size = 0; - int i; + int32_t size = 0; + int32_t i; assert( length > 0 ); for ( i = 0; i < length; ++i ) @@ -1190,10 +1190,10 @@ static LIST * expand( expansion_item * items, int const length ) * strings. */ { - int max = 0; + int32_t max = 0; for ( ; iter != end; iter = list_next( iter ) ) { - int const len = strlen( object_str( list_item( iter ) ) ); + int32_t const len = int32_t(strlen( object_str( list_item( iter ) ) )); if ( len > max ) max = len; } size += max; @@ -1230,9 +1230,9 @@ static LIST * expand( expansion_item * items, int const length ) return result; } -static void combine_strings( STACK * s, int n, string * out ) +static void combine_strings( STACK * s, int32_t n, string * out ) { - int i; + int32_t i; for ( i = 0; i < n; ++i ) { LIST * const values = stack_pop( s ); @@ -1254,8 +1254,8 @@ static void combine_strings( STACK * s, int n, string * out ) struct dynamic_array { - int size; - int capacity; + int32_t size; + int32_t capacity; void * data; }; @@ -1272,7 +1272,7 @@ static void dynamic_array_free( struct dynamic_array * array ) } static void dynamic_array_push_impl( struct dynamic_array * const array, - void const * const value, int const unit_size ) + void const * const value, int32_t const unit_size ) { if ( array->capacity == 0 ) { @@ -1302,7 +1302,7 @@ static void dynamic_array_push_impl( struct dynamic_array * const array, struct label_info { - int absolute_position; + int32_t absolute_position; struct dynamic_array uses[ 1 ]; }; @@ -1311,18 +1311,18 @@ struct label_info struct loop_info { - int type; - int label; - int cleanup_depth; + int32_t type; + int32_t label; + int32_t cleanup_depth; }; struct stored_rule { OBJECT * name; PARSE * parse; - int num_arguments; + int32_t num_arguments; struct arg_list * arguments; - int local; + int32_t local; }; typedef struct compiler @@ -1349,7 +1349,7 @@ static void compiler_init( compiler * c ) static void compiler_free( compiler * c ) { - int i; + int32_t i; dynamic_array_free( c->actions ); dynamic_array_free( c->rules ); for ( i = 0; i < c->labels->size; ++i ) @@ -1367,9 +1367,9 @@ static void compile_emit_instruction( compiler * c, instruction instr ) dynamic_array_push( c->code, instr ); } -static int compile_new_label( compiler * c ) +static int32_t compile_new_label( compiler * c ) { - int result = c->labels->size; + int32_t result = c->labels->size; struct label_info info; info.absolute_position = -1; dynamic_array_init( info.uses ); @@ -1377,23 +1377,23 @@ static int compile_new_label( compiler * c ) return result; } -static void compile_set_label( compiler * c, int label ) +static void compile_set_label( compiler * c, int32_t label ) { struct label_info * const l = &dynamic_array_at( struct label_info, c->labels, label ); - int const pos = c->code->size; - int i; + int32_t const pos = c->code->size; + int32_t i; assert( l->absolute_position == -1 ); l->absolute_position = pos; for ( i = 0; i < l->uses->size; ++i ) { - int id = dynamic_array_at( int, l->uses, i ); - int offset = (int)( pos - id - 1 ); + int32_t id = dynamic_array_at( int32_t, l->uses, i ); + int32_t offset = (int32_t)( pos - id - 1 ); dynamic_array_at( instruction, c->code, id ).arg = offset; } } -static void compile_emit( compiler * c, unsigned int op_code, int arg ) +static void compile_emit( compiler * c, uint32_t op_code, int32_t arg ) { instruction instr; instr.op_code = op_code; @@ -1401,11 +1401,11 @@ static void compile_emit( compiler * c, unsigned int op_code, int arg ) compile_emit_instruction( c, instr ); } -static void compile_emit_branch( compiler * c, unsigned int op_code, int label ) +static void compile_emit_branch( compiler * c, uint32_t op_code, int32_t label ) { struct label_info * const l = &dynamic_array_at( struct label_info, c->labels, label ); - int const pos = c->code->size; + int32_t const pos = c->code->size; instruction instr; instr.op_code = op_code; if ( l->absolute_position == -1 ) @@ -1414,18 +1414,18 @@ static void compile_emit_branch( compiler * c, unsigned int op_code, int label ) dynamic_array_push( l->uses, pos ); } else - instr.arg = (int)( l->absolute_position - pos - 1 ); + instr.arg = (int32_t)( l->absolute_position - pos - 1 ); compile_emit_instruction( c, instr ); } -static int compile_emit_constant( compiler * c, OBJECT * value ) +static int32_t compile_emit_constant( compiler * c, OBJECT * value ) { OBJECT * copy = object_copy( value ); dynamic_array_push( c->constants, copy ); return c->constants->size - 1; } -static void compile_push_cleanup( compiler * c, unsigned int op_code, int arg ) +static void compile_push_cleanup( compiler * c, uint32_t op_code, int32_t arg ) { instruction instr; instr.op_code = op_code; @@ -1438,19 +1438,19 @@ static void compile_pop_cleanup( compiler * c ) dynamic_array_pop( c->cleanups ); } -static void compile_emit_cleanups( compiler * c, int end ) +static void compile_emit_cleanups( compiler * c, int32_t end ) { - int i; + int32_t i; for ( i = c->cleanups->size; --i >= end; ) { compile_emit_instruction( c, dynamic_array_at( instruction, c->cleanups, i ) ); } } -static void compile_emit_loop_jump( compiler * c, int type ) +static void compile_emit_loop_jump( compiler * c, int32_t type ) { struct loop_info * info = NULL; - int i; + int32_t i; for ( i = c->loop_scopes->size; --i >= 0; ) { struct loop_info * elem = &dynamic_array_at( struct loop_info, c->loop_scopes, i ); @@ -1469,7 +1469,7 @@ static void compile_emit_loop_jump( compiler * c, int type ) compile_emit_branch( c, INSTR_JUMP, info->label ); } -static void compile_push_break_scope( compiler * c, int label ) +static void compile_push_break_scope( compiler * c, int32_t label ) { struct loop_info info; info.type = LOOP_INFO_BREAK; @@ -1478,7 +1478,7 @@ static void compile_push_break_scope( compiler * c, int label ) dynamic_array_push( c->loop_scopes, info ); } -static void compile_push_continue_scope( compiler * c, int label ) +static void compile_push_continue_scope( compiler * c, int32_t label ) { struct loop_info info; info.type = LOOP_INFO_CONTINUE; @@ -1501,8 +1501,8 @@ static void compile_pop_continue_scope( compiler * c ) dynamic_array_pop( c->loop_scopes ); } -static int compile_emit_rule( compiler * c, OBJECT * name, PARSE * parse, - int num_arguments, struct arg_list * arguments, int local ) +static int32_t compile_emit_rule( compiler * c, OBJECT * name, PARSE * parse, + int32_t num_arguments, struct arg_list * arguments, int32_t local ) { struct stored_rule rule; rule.name = object_copy( name ); @@ -1511,10 +1511,10 @@ static int compile_emit_rule( compiler * c, OBJECT * name, PARSE * parse, rule.arguments = arguments; rule.local = local; dynamic_array_push( c->rules, rule ); - return (int)( c->rules->size - 1 ); + return (int32_t)( c->rules->size - 1 ); } -static int compile_emit_actions( compiler * c, PARSE * parse ) +static int32_t compile_emit_actions( compiler * c, PARSE * parse ) { SUBACTION a; a.name = object_copy( parse->string ); @@ -1522,13 +1522,13 @@ static int compile_emit_actions( compiler * c, PARSE * parse ) parse->file, parse->line ); a.flags = parse->num; dynamic_array_push( c->actions, a ); - return (int)( c->actions->size - 1 ); + return (int32_t)( c->actions->size - 1 ); } static JAM_FUNCTION * compile_to_function( compiler * c ) { JAM_FUNCTION * const result = (JAM_FUNCTION*)BJAM_MALLOC( sizeof( JAM_FUNCTION ) ); - int i; + int32_t i; result->base.type = FUNCTION_JAM; result->base.reference_count = 1; result->base.formal_arguments = 0; @@ -1594,7 +1594,7 @@ typedef struct VAR_PARSE_ACTIONS typedef struct _var_parse { - int type; /* string, variable or file */ + int32_t type; /* string, variable or file */ } VAR_PARSE; typedef struct @@ -1634,7 +1634,7 @@ static VAR_PARSE_GROUP * var_parse_group_new() static void var_parse_group_free( VAR_PARSE_GROUP * group ) { - int i; + int32_t i; for ( i = 0; i < group->elems->size; ++i ) var_parse_free( dynamic_array_at( VAR_PARSE *, group->elems, i ) ); dynamic_array_free( group->elems ); @@ -1689,7 +1689,7 @@ static VAR_PARSE_ACTIONS * var_parse_actions_new() static void var_parse_actions_free( VAR_PARSE_ACTIONS * actions ) { - int i; + int32_t i; for ( i = 0; i < actions->elems->size; ++i ) var_parse_group_free( dynamic_array_at( VAR_PARSE_GROUP *, actions->elems, i ) ); @@ -1714,7 +1714,7 @@ static VAR_PARSE_VAR * var_parse_var_new() static void var_parse_var_free( VAR_PARSE_VAR * var ) { - int i; + int32_t i; var_parse_group_free( var->name ); if ( var->subscript ) var_parse_group_free( var->subscript ); @@ -1760,7 +1760,7 @@ static VAR_PARSE_FILE * var_parse_file_new( void ) static void var_parse_file_free( VAR_PARSE_FILE * file ) { - int i; + int32_t i; for ( i = 0; i < file->filename->size; ++i ) var_parse_group_free( dynamic_array_at( VAR_PARSE_GROUP *, file->filename, i ) ); @@ -1808,9 +1808,9 @@ static void var_parse_group_compile( VAR_PARSE_GROUP const * parse, static void var_parse_var_compile( VAR_PARSE_VAR const * parse, compiler * c ) { - int expand_name = 0; - int is_get_grist = 0; - int has_modifiers = 0; + int32_t expand_name = 0; + int32_t is_get_grist = 0; + int32_t has_modifiers = 0; /* Special case common modifiers */ if ( parse->modifiers->size == 1 ) { @@ -1831,7 +1831,7 @@ static void var_parse_var_compile( VAR_PARSE_VAR const * parse, compiler * c ) /* If there are modifiers, emit them in reverse order. */ if ( parse->modifiers->size > 0 && !is_get_grist ) { - int i; + int32_t i; has_modifiers = 1; for ( i = 0; i < parse->modifiers->size; ++i ) var_parse_group_compile( dynamic_array_at( VAR_PARSE_GROUP *, @@ -1852,7 +1852,7 @@ static void var_parse_var_compile( VAR_PARSE_VAR const * parse, compiler * c ) { OBJECT * const name = ( (VAR_PARSE_STRING *)dynamic_array_at( VAR_PARSE *, parse->name->elems, 0 ) )->s; - int const idx = get_argument_index( object_str( name ) ); + int32_t const idx = get_argument_index( object_str( name ) ); if ( idx != -1 ) compile_emit( c, INSTR_PUSH_ARG, idx ); else @@ -1900,7 +1900,7 @@ static void var_parse_string_compile( VAR_PARSE_STRING const * parse, static void var_parse_file_compile( VAR_PARSE_FILE const * parse, compiler * c ) { - int i; + int32_t i; for ( i = 0; i < parse->filename->size; ++i ) var_parse_group_compile( dynamic_array_at( VAR_PARSE_GROUP *, parse->filename, parse->filename->size - i - 1 ), c ); @@ -1936,7 +1936,7 @@ static void var_parse_group_compile( VAR_PARSE_GROUP const * parse, compiler * c ) { /* Emit the elements in reverse order. */ - int i; + int32_t i; for ( i = 0; i < parse->elems->size; ++i ) var_parse_compile( dynamic_array_at( VAR_PARSE *, parse->elems, parse->elems->size - i - 1 ), c ); @@ -1952,7 +1952,7 @@ static void var_parse_group_compile( VAR_PARSE_GROUP const * parse, compiler * c static void var_parse_actions_compile( VAR_PARSE_ACTIONS const * actions, compiler * c ) { - int i; + int32_t i; for ( i = 0; i < actions->elems->size; ++i ) var_parse_group_compile( dynamic_array_at( VAR_PARSE_GROUP *, actions->elems, actions->elems->size - i - 1 ), c ); @@ -1967,7 +1967,7 @@ static void var_parse_actions_compile( VAR_PARSE_ACTIONS const * actions, static VAR_PARSE * parse_at_file( char const * start, char const * mid, char const * end ); static VAR_PARSE * parse_variable( char const * * string ); -static int try_parse_variable( char const * * s_, char const * * string, +static int32_t try_parse_variable( char const * * s_, char const * * string, VAR_PARSE_GROUP * out ); static void balance_parentheses( char const * * s_, char const * * string, VAR_PARSE_GROUP * out ); @@ -2011,7 +2011,7 @@ static VAR_PARSE_ACTIONS * parse_actions( char const * string ) * starts with a variable, 0 otherwise. */ -static int try_parse_variable( char const * * s_, char const * * string, +static int32_t try_parse_variable( char const * * s_, char const * * string, VAR_PARSE_GROUP * out ) { char const * s = *s_; @@ -2026,7 +2026,7 @@ static int try_parse_variable( char const * * s_, char const * * string, } if ( s[ 0 ] == '@' && s[ 1 ] == '(' ) { - int depth = 1; + int32_t depth = 1; char const * ine; char const * split = 0; var_parse_group_maybe_add_constant( out, *string, s ); @@ -2062,7 +2062,7 @@ static int try_parse_variable( char const * * s_, char const * * string, static char const * current_file = ""; -static int current_line; +static int32_t current_line; static void parse_error( char const * message ) { @@ -2247,7 +2247,7 @@ static VAR_PARSE * parse_at_file( char const * start, char const * mid, void balance_parentheses( char const * * s_, char const * * string, VAR_PARSE_GROUP * out) { - int depth = 1; + int32_t depth = 1; char const * s = *s_; for ( ; ; ) { @@ -2287,10 +2287,10 @@ void balance_parentheses( char const * * s_, char const * * string, #define RESULT_RETURN 1 #define RESULT_NONE 2 -static void compile_parse( PARSE * parse, compiler * c, int result_location ); -static struct arg_list * arg_list_compile( PARSE * parse, int * num_arguments ); +static void compile_parse( PARSE * parse, compiler * c, int32_t result_location ); +static struct arg_list * arg_list_compile( PARSE * parse, int32_t * num_arguments ); -static void compile_condition( PARSE * parse, compiler * c, int branch_true, int label ) +static void compile_condition( PARSE * parse, compiler * c, int32_t branch_true, int32_t label ) { assert( parse->type == PARSE_EVAL ); switch ( parse->num ) @@ -2369,7 +2369,7 @@ static void compile_condition( PARSE * parse, compiler * c, int branch_true, int case EXPR_AND: if ( branch_true ) { - int f = compile_new_label( c ); + int32_t f = compile_new_label( c ); compile_condition( parse->left, c, 0, f ); compile_condition( parse->right, c, 1, label ); compile_set_label( c, f ); @@ -2389,7 +2389,7 @@ static void compile_condition( PARSE * parse, compiler * c, int branch_true, int } else { - int t = compile_new_label( c ); + int32_t t = compile_new_label( c ); compile_condition( parse->left, c, 1, t ); compile_condition( parse->right, c, 0, label ); compile_set_label( c, t ); @@ -2402,8 +2402,8 @@ static void compile_condition( PARSE * parse, compiler * c, int branch_true, int } } -static void adjust_result( compiler * c, int actual_location, - int desired_location ) +static void adjust_result( compiler * c, int32_t actual_location, + int32_t desired_location ) { if ( actual_location == desired_location ) ; @@ -2442,7 +2442,7 @@ static void compile_append_chain( PARSE * parse, compiler * c ) } } -static void compile_emit_debug(compiler * c, int line) +static void compile_emit_debug(compiler * c, int32_t line) { #ifdef JAM_DEBUGGER if ( debug_is_debugging() ) @@ -2450,7 +2450,7 @@ static void compile_emit_debug(compiler * c, int line) #endif } -static void compile_parse( PARSE * parse, compiler * c, int result_location ) +static void compile_parse( PARSE * parse, compiler * c, int32_t result_location ) { compile_emit_debug(c, parse->line); if ( parse->type == PARSE_APPEND ) @@ -2467,8 +2467,8 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) compile_parse( parse->left, c, result_location ); else { - int f = compile_new_label( c ); - int end = compile_new_label( c ); + int32_t f = compile_new_label( c ); + int32_t end = compile_new_label( c ); out_printf( "%s:%d: Conditional used as list (check operator " "precedence).\n", object_str( parse->file ), parse->line ); @@ -2486,10 +2486,10 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_FOREACH ) { - int var = compile_emit_constant( c, parse->string ); - int top = compile_new_label( c ); - int end = compile_new_label( c ); - int continue_ = compile_new_label( c ); + int32_t var = compile_emit_constant( c, parse->string ); + int32_t top = compile_new_label( c ); + int32_t end = compile_new_label( c ); + int32_t continue_ = compile_new_label( c ); /* * Evaluate the list. @@ -2536,7 +2536,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_IF ) { - int f = compile_new_label( c ); + int32_t f = compile_new_label( c ); /* Emit the condition */ compile_condition( parse->left, c, 0, f ); /* Emit the if block */ @@ -2544,7 +2544,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) if ( parse->third->type != PARSE_NULL || result_location != RESULT_NONE ) { /* Emit the else block */ - int end = compile_new_label( c ); + int32_t end = compile_new_label( c ); compile_emit_branch( c, INSTR_JUMP, end ); compile_set_label( c, f ); compile_parse( parse->third, c, result_location ); @@ -2556,12 +2556,12 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_WHILE ) { - int nested_result = result_location == RESULT_NONE + int32_t nested_result = result_location == RESULT_NONE ? RESULT_NONE : RESULT_RETURN; - int test = compile_new_label( c ); - int top = compile_new_label( c ); - int end = compile_new_label( c ); + int32_t test = compile_new_label( c ); + int32_t top = compile_new_label( c ); + int32_t end = compile_new_label( c ); /* Make sure that we return an empty list if the loop runs zero times. */ adjust_result( c, RESULT_NONE, nested_result ); @@ -2590,7 +2590,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_MODULE ) { - int const nested_result = result_location == RESULT_NONE + int32_t const nested_result = result_location == RESULT_NONE ? RESULT_NONE : RESULT_RETURN; compile_parse( parse->left, c, RESULT_STACK ); @@ -2633,7 +2633,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_LOCAL ) { - int nested_result = result_location == RESULT_NONE + int32_t nested_result = result_location == RESULT_NONE ? RESULT_NONE : RESULT_RETURN; /* This should be left recursive group of compile_appends. */ @@ -2658,7 +2658,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) if ( group->elems->size == 1 && dynamic_array_at( VAR_PARSE *, group->elems, 0 )->type == VAR_PARSE_TYPE_STRING ) { - int const name = compile_emit_constant( c, ( + int32_t const name = compile_emit_constant( c, ( (VAR_PARSE_STRING *)dynamic_array_at( VAR_PARSE *, group->elems, 0 ) )->s ); var_parse_group_free( group ); @@ -2736,7 +2736,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) else { /* Too complex. Fall back on push/pop. */ - int end = compile_new_label( c ); + int32_t end = compile_new_label( c ); compile_parse( parse->left, c, RESULT_STACK ); compile_emit_branch( c, INSTR_PUSH_ON, end ); compile_push_cleanup( c, INSTR_POP_ON, 0 ); @@ -2749,7 +2749,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else { - int end = compile_new_label( c ); + int32_t end = compile_new_label( c ); compile_parse( parse->left, c, RESULT_STACK ); compile_emit_branch( c, INSTR_PUSH_ON, end ); compile_push_cleanup( c, INSTR_POP_ON, 0 ); @@ -2763,7 +2763,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) else if ( parse->type == PARSE_RULE ) { PARSE * p; - int n = 0; + int32_t n = 0; VAR_PARSE_GROUP * group; char const * s = object_str( parse->string ); @@ -2811,8 +2811,8 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) else if ( parse->type == PARSE_SET ) { PARSE * vars = parse->left; - unsigned int op_code; - unsigned int op_code_group; + uint32_t op_code; + uint32_t op_code_group; switch ( parse->num ) { @@ -2832,7 +2832,7 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) if ( group->elems->size == 1 && dynamic_array_at( VAR_PARSE *, group->elems, 0 )->type == VAR_PARSE_TYPE_STRING ) { - int const name = compile_emit_constant( c, ( + int32_t const name = compile_emit_constant( c, ( (VAR_PARSE_STRING *)dynamic_array_at( VAR_PARSE *, group->elems, 0 ) )->s ); var_parse_group_free( group ); @@ -2875,16 +2875,16 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_SETCOMP ) { - int n_args; + int32_t n_args; struct arg_list * args = arg_list_compile( parse->right, &n_args ); - int const rule_id = compile_emit_rule( c, parse->string, parse->left, + int32_t const rule_id = compile_emit_rule( c, parse->string, parse->left, n_args, args, parse->num ); compile_emit( c, INSTR_RULE, rule_id ); adjust_result( c, RESULT_NONE, result_location ); } else if ( parse->type == PARSE_SETEXEC ) { - int const actions_id = compile_emit_actions( c, parse ); + int32_t const actions_id = compile_emit_actions( c, parse ); compile_parse( parse->left, c, RESULT_STACK ); compile_emit( c, INSTR_ACTIONS, actions_id ); adjust_result( c, RESULT_NONE, result_location ); @@ -2907,13 +2907,13 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location ) } else if ( parse->type == PARSE_SWITCH ) { - int const switch_end = compile_new_label( c ); + int32_t const switch_end = compile_new_label( c ); compile_parse( parse->left, c, RESULT_STACK ); for ( parse = parse->right; parse; parse = parse->right ) { - int const id = compile_emit_constant( c, parse->left->string ); - int const next_case = compile_new_label( c ); + int32_t const id = compile_emit_constant( c, parse->left->string ); + int32_t const next_case = compile_new_label( c ); compile_emit( c, INSTR_PUSH_CONSTANT, id ); compile_emit_branch( c, INSTR_JUMP_NOT_GLOB, next_case ); compile_parse( parse->left->left, c, result_location ); @@ -2954,7 +2954,7 @@ void function_set_rulename( FUNCTION * function, OBJECT * rulename ) function->rulename = rulename; } -void function_location( FUNCTION * function_, OBJECT * * file, int * line ) +void function_location( FUNCTION * function_, OBJECT * * file, int32_t * line ) { if ( function_->type == FUNCTION_BUILTIN ) { @@ -2978,10 +2978,10 @@ void function_location( FUNCTION * function_, OBJECT * * file, int * line ) } static struct arg_list * arg_list_compile_builtin( char const * * args, - int * num_arguments ); + int32_t * num_arguments ); -FUNCTION * function_builtin( LIST * ( * func )( FRAME * frame, int flags ), - int flags, char const * * args ) +FUNCTION * function_builtin( LIST * ( * func )( FRAME * frame, int32_t flags ), + int32_t flags, char const * * args ) { BUILTIN_FUNCTION * result = (BUILTIN_FUNCTION*)BJAM_MALLOC( sizeof( BUILTIN_FUNCTION ) ); result->base.type = FUNCTION_BUILTIN; @@ -3009,7 +3009,7 @@ FUNCTION * function_compile( PARSE * parse ) } FUNCTION * function_compile_actions( char const * actions, OBJECT * file, - int line ) + int32_t line ) { compiler c[ 1 ]; JAM_FUNCTION * result; @@ -3028,7 +3028,7 @@ FUNCTION * function_compile_actions( char const * actions, OBJECT * file, return (FUNCTION *)result; } -static void argument_list_print( struct arg_list * args, int num_args ); +static void argument_list_print( struct arg_list * args, int32_t num_args ); /* Define delimiters for type check elements in argument lists (and return type @@ -3042,7 +3042,7 @@ static void argument_list_print( struct arg_list * args, int num_args ); * specification. */ -int is_type_name( char const * s ) +int32_t is_type_name( char const * s ) { return s[ 0 ] == TYPE_OPEN_DELIM && s[ strlen( s ) - 1 ] == TYPE_CLOSE_DELIM; @@ -3113,18 +3113,18 @@ static void type_check( OBJECT * type_name, LIST * values, FRAME * caller, caller, called, arg_name ); } -void argument_list_check( struct arg_list * formal, int formal_count, +void argument_list_check( struct arg_list * formal, int32_t formal_count, FUNCTION * function, FRAME * frame ) { LOL * all_actual = frame->args; - int i; + int32_t i; for ( i = 0; i < formal_count; ++i ) { LIST * actual = lol_get( all_actual, i ); LISTITER actual_iter = list_begin( actual ); LISTITER const actual_end = list_end( actual ); - int j; + int32_t j; for ( j = 0; j < formal[ i ].size; ++j ) { struct argument * formal_arg = &formal[ i ].args[ j ]; @@ -3178,18 +3178,18 @@ void argument_list_check( struct arg_list * formal, int formal_count, } } -void argument_list_push( struct arg_list * formal, int formal_count, +void argument_list_push( struct arg_list * formal, int32_t formal_count, FUNCTION * function, FRAME * frame, STACK * s ) { LOL * all_actual = frame->args; - int i; + int32_t i; for ( i = 0; i < formal_count; ++i ) { LIST * actual = lol_get( all_actual, i ); LISTITER actual_iter = list_begin( actual ); LISTITER const actual_end = list_end( actual ); - int j; + int32_t j; for ( j = 0; j < formal[ i ].size; ++j ) { struct argument * formal_arg = &formal[ i ].args[ j ]; @@ -3255,13 +3255,13 @@ void argument_list_push( struct arg_list * formal, int formal_count, } } -void argument_list_pop( struct arg_list * formal, int formal_count, +void argument_list_pop( struct arg_list * formal, int32_t formal_count, FRAME * frame, STACK * s ) { - int i; + int32_t i; for ( i = formal_count - 1; i >= 0; --i ) { - int j; + int32_t j; for ( j = formal[ i ].size - 1; j >= 0 ; --j ) { struct argument * formal_arg = &formal[ i ].args[ j ]; @@ -3288,7 +3288,7 @@ struct argument_compiler { struct dynamic_array args[ 1 ]; struct argument arg; - int state; + int32_t state; #define ARGUMENT_COMPILER_START 0 #define ARGUMENT_COMPILER_FOUND_TYPE 1 #define ARGUMENT_COMPILER_FOUND_OBJECT 2 @@ -3308,7 +3308,7 @@ static void argument_compiler_free( struct argument_compiler * c ) } static void argument_compiler_add( struct argument_compiler * c, OBJECT * arg, - OBJECT * file, int line ) + OBJECT * file, int32_t line ) { switch ( c->state ) { @@ -3391,7 +3391,7 @@ static void argument_compiler_recurse( struct argument_compiler * c, } static struct arg_list arg_compile_impl( struct argument_compiler * c, - OBJECT * file, int line ) + OBJECT * file, int32_t line ) { struct arg_list result; switch ( c->state ) @@ -3458,7 +3458,7 @@ static void argument_list_compiler_recurse( struct argument_list_compiler * c, } } -static struct arg_list * arg_list_compile( PARSE * parse, int * num_arguments ) +static struct arg_list * arg_list_compile( PARSE * parse, int32_t * num_arguments ) { if ( parse ) { @@ -3478,7 +3478,7 @@ static struct arg_list * arg_list_compile( PARSE * parse, int * num_arguments ) } static struct arg_list * arg_list_compile_builtin( char const * * args, - int * num_arguments ) + int32_t * num_arguments ) { if ( args ) { @@ -3518,14 +3518,14 @@ static struct arg_list * arg_list_compile_builtin( char const * * args, return 0; } -static void argument_list_print( struct arg_list * args, int num_args ) +static void argument_list_print( struct arg_list * args, int32_t num_args ) { if ( args ) { - int i; + int32_t i; for ( i = 0; i < num_args; ++i ) { - int j; + int32_t j; if ( i ) out_printf( " : " ); for ( j = 0; j < args[ i ].size; ++j ) { @@ -3547,17 +3547,17 @@ static void argument_list_print( struct arg_list * args, int num_args ) struct arg_list * argument_list_bind_variables( struct arg_list * formal, - int formal_count, module_t * module, int * counter ) + int32_t formal_count, module_t * module, int32_t * counter ) { if ( formal ) { struct arg_list * result = (struct arg_list *)BJAM_MALLOC( sizeof( struct arg_list ) * formal_count ); - int i; + int32_t i; for ( i = 0; i < formal_count; ++i ) { - int j; + int32_t j; struct argument * args = (struct argument *)BJAM_MALLOC( sizeof( struct argument ) * formal[ i ].size ); for ( j = 0; j < formal[ i ].size; ++j ) @@ -3580,12 +3580,12 @@ struct arg_list * argument_list_bind_variables( struct arg_list * formal, } -void argument_list_free( struct arg_list * args, int args_count ) +void argument_list_free( struct arg_list * args, int32_t args_count ) { - int i; + int32_t i; for ( i = 0; i < args_count; ++i ) { - int j; + int32_t j; for ( j = 0; j < args[ i ].size; ++j ) { if ( args[ i ].args[ j ].type_name ) @@ -3614,7 +3614,7 @@ FUNCTION * function_unbind_variables( FUNCTION * f ) } FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, - int * counter ) + int32_t * counter ) { if ( f->type == FUNCTION_BUILTIN ) return f; @@ -3626,7 +3626,7 @@ FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, JAM_FUNCTION * func = (JAM_FUNCTION *)f; JAM_FUNCTION * new_func = (JAM_FUNCTION *)BJAM_MALLOC( sizeof( JAM_FUNCTION ) ); instruction * code; - int i; + int32_t i; assert( f->type == FUNCTION_JAM ); memcpy( new_func, func, sizeof( JAM_FUNCTION ) ); new_func->base.reference_count = 1; @@ -3640,7 +3640,7 @@ FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, for ( i = 0; ; ++i ) { OBJECT * key; - int op_code; + int32_t op_code; code = func->code + i; switch ( code->op_code ) { @@ -3657,7 +3657,7 @@ FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, case INSTR_CALL_RULE: ++i; continue; case INSTR_PUSH_MODULE: { - int depth = 1; + int32_t depth = 1; ++i; while ( depth > 0 ) { @@ -3707,7 +3707,7 @@ LIST * function_get_variables( FUNCTION * f ) JAM_FUNCTION * func = (JAM_FUNCTION *)f; LIST * result = L0; instruction * code; - int i; + int32_t i; assert( f->type == FUNCTION_JAM ); if ( func->generic ) func = ( JAM_FUNCTION * )func->generic; @@ -3723,7 +3723,7 @@ LIST * function_get_variables( FUNCTION * f ) case INSTR_CALL_RULE: ++i; continue; case INSTR_PUSH_MODULE: { - int depth = 1; + int32_t depth = 1; ++i; while ( depth > 0 ) { @@ -3767,7 +3767,7 @@ void function_refer( FUNCTION * func ) void function_free( FUNCTION * function_ ) { - int i; + int32_t i; if ( --function_->reference_count != 0 ) return; @@ -4467,7 +4467,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) OBJECT * varname = function->constants[ code->arg ]; TARGET * t = bindtarget( list_front( targets ) ); SETTINGS * s = t->settings; - int found = 0; + int32_t found = 0; for ( ; s != 0; s = s->next ) { if ( object_equal( s->symbol, varname ) ) @@ -4653,8 +4653,8 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) case INSTR_APPLY_MODIFIERS: { PROFILE_ENTER_LOCAL(function_run_INSTR_APPLY_MODIFIERS); - int n; - int i; + int32_t n; + int32_t i; l = stack_pop( s ); n = expand_modifiers( s, code->arg ); stack_push( s, l ); @@ -4682,8 +4682,8 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) case INSTR_APPLY_INDEX_MODIFIERS: { PROFILE_ENTER_LOCAL(function_run_INSTR_APPLY_INDEX_MODIFIERS); - int i; - int n; + int32_t i; + int32_t n; l = stack_pop( s ); r = stack_pop( s ); n = expand_modifiers( s, code->arg ); @@ -4703,9 +4703,9 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) case INSTR_APPLY_MODIFIERS_GROUP: { PROFILE_ENTER_LOCAL(function_run_INSTR_APPLY_MODIFIERS_GROUP); - int i; + int32_t i; LIST * const vars = stack_pop( s ); - int const n = expand_modifiers( s, code->arg ); + int32_t const n = expand_modifiers( s, code->arg ); LIST * result = L0; LISTITER iter = list_begin( vars ); LISTITER const end = list_end( vars ); @@ -4749,10 +4749,10 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) case INSTR_APPLY_INDEX_MODIFIERS_GROUP: { PROFILE_ENTER_LOCAL(function_run_INSTR_APPLY_INDEX_MODIFIERS_GROUP); - int i; + int32_t i; LIST * const vars = stack_pop( s ); LIST * const r = stack_pop( s ); - int const n = expand_modifiers( s, code->arg ); + int32_t const n = expand_modifiers( s, code->arg ); LIST * result = L0; LISTITER iter = list_begin( vars ); LISTITER const end = list_end( vars ); @@ -4778,11 +4778,11 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) case INSTR_COMBINE_STRINGS: { PROFILE_ENTER_LOCAL(function_run_INSTR_COMBINE_STRINGS); - size_t const buffer_size = code->arg * sizeof( expansion_item ); + int32_t const buffer_size = code->arg * sizeof( expansion_item ); LIST * * const stack_pos = (LIST * * const)stack_get( s ); expansion_item * items = (expansion_item *)stack_allocate( s, buffer_size ); LIST * result; - int i; + int32_t i; for ( i = 0; i < code->arg; ++i ) items[ i ].values = stack_pos[ i ]; result = expand( items, code->arg ); @@ -4809,7 +4809,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) if ( value[ 0 ] == '<' && ( p = strchr( value, '>' ) ) ) { if( p[ 1 ] ) - new_object = object_new_range( value, p - value + 1 ); + new_object = object_new_range( value, int32_t(p - value + 1) ); else new_object = object_copy( list_item( iter ) ); } @@ -4936,7 +4936,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) string buf[ 1 ]; char const * out; OBJECT * tmp_filename = 0; - int out_debug = DEBUG_EXEC ? 1 : 0; + int32_t out_debug = DEBUG_EXEC ? 1 : 0; FILE * out_file = 0; string_new( buf ); combine_strings( s, code->arg, buf ); @@ -4948,7 +4948,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) if ( ( strcmp( "STDOUT", out ) == 0 ) || ( strcmp( "STDERR", out ) == 0 ) ) { - int err_redir = strcmp( "STDERR", out ) == 0; + int32_t err_redir = strcmp( "STDERR", out ) == 0; string result[ 1 ]; tmp_filename = path_tmpfile(); @@ -5069,7 +5069,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) #ifdef HAVE_PYTHON static struct arg_list * arg_list_compile_python( PyObject * bjam_signature, - int * num_arguments ) + int32_t * num_arguments ) { if ( bjam_signature ) { @@ -5127,18 +5127,18 @@ FUNCTION * function_python( PyObject * function, PyObject * bjam_signature ) } -static void argument_list_to_python( struct arg_list * formal, int formal_count, +static void argument_list_to_python( struct arg_list * formal, int32_t formal_count, FUNCTION * function, FRAME * frame, PyObject * kw ) { LOL * all_actual = frame->args; - int i; + int32_t i; for ( i = 0; i < formal_count; ++i ) { LIST * actual = lol_get( all_actual, i ); LISTITER actual_iter = list_begin( actual ); LISTITER const actual_end = list_end( actual ); - int j; + int32_t j; for ( j = 0; j < formal[ i ].size; ++j ) { struct argument * formal_arg = &formal[ i ].args[ j ]; @@ -5259,7 +5259,7 @@ static LIST * call_python_function( PYTHON_FUNCTION * function, FRAME * frame ) LIST * result = 0; PyObject * arguments = 0; PyObject * kw = NULL; - int i; + int32_t i; PyObject * py_result; FRAME * prev_frame_before_python_call; @@ -5290,8 +5290,8 @@ static LIST * call_python_function( PYTHON_FUNCTION * function, FRAME * frame ) { if ( PyList_Check( py_result ) ) { - int size = PyList_Size( py_result ); - int i; + int32_t size = PyList_Size( py_result ); + int32_t i; for ( i = 0; i < size; ++i ) { OBJECT * s = python_to_string( PyList_GetItem( py_result, i ) ); diff --git a/src/engine/function.h b/src/engine/function.h index 73c837f520..397487537e 100644 --- a/src/engine/function.h +++ b/src/engine/function.h @@ -22,18 +22,18 @@ void stack_push( STACK * s, LIST * l ); LIST * stack_pop( STACK * s ); FUNCTION * function_compile( PARSE * parse ); -FUNCTION * function_builtin( LIST * ( * func )( FRAME * frame, int flags ), int flags, const char * * args ); +FUNCTION * function_builtin( LIST * ( * func )( FRAME * frame, int32_t flags ), int32_t flags, const char * * args ); void function_refer( FUNCTION * ); void function_free( FUNCTION * ); OBJECT * function_rulename( FUNCTION * ); void function_set_rulename( FUNCTION *, OBJECT * ); -void function_location( FUNCTION *, OBJECT * *, int * ); +void function_location( FUNCTION *, OBJECT * *, int32_t * ); LIST * function_run( FUNCTION * function, FRAME * frame, STACK * s ); -FUNCTION * function_compile_actions( const char * actions, OBJECT * file, int line ); +FUNCTION * function_compile_actions( const char * actions, OBJECT * file, int32_t line ); void function_run_actions( FUNCTION * function, FRAME * frame, STACK * s, string * out ); -FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, int * counter ); +FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, int32_t * counter ); FUNCTION * function_unbind_variables( FUNCTION * f ); LIST * function_get_variables( FUNCTION * f ); diff --git a/src/engine/hash.cpp b/src/engine/hash.cpp index f3dcef88a5..9dcd5816bf 100644 --- a/src/engine/hash.cpp +++ b/src/engine/hash.cpp @@ -45,12 +45,12 @@ struct hash */ struct { - int nel; + int32_t nel; ITEM * * base; } tab; - int bloat; /* tab.nel / items.nel */ - int inel; /* initial number of elements */ + int32_t bloat; /* tab.nel / items.nel */ + int32_t inel; /* initial number of elements */ /* * the array of records, maintained by these routines - essentially a @@ -58,16 +58,16 @@ struct hash */ struct { - int more; /* how many more ITEMs fit in lists[ list ] */ + int32_t more; /* how many more ITEMs fit in lists[ list ] */ ITEM * free; /* free list of items */ char * next; /* where to put more ITEMs in lists[ list ] */ - int size; /* sizeof( ITEM ) + aligned datalen */ - int nel; /* total ITEMs held by all lists[] */ - int list; /* index into lists[] */ + int32_t size; /* sizeof( ITEM ) + aligned datalen */ + int32_t nel; /* total ITEMs held by all lists[] */ + int32_t list; /* index into lists[] */ struct { - int nel; /* total ITEMs held by this list */ + int32_t nel; /* total ITEMs held by this list */ char * base; /* base of ITEMs array */ } lists[ MAX_LISTS ]; } items; @@ -78,7 +78,7 @@ struct hash static void hashrehash( struct hash * ); static void hashstat( struct hash * ); -static unsigned int hash_keyval( OBJECT * key ) +static uint32_t hash_keyval( OBJECT * key ) { return object_hash( key ); } @@ -96,7 +96,7 @@ static unsigned int hash_keyval( OBJECT * key ) * hashinit() - initialize a hash table, returning a handle */ -struct hash * hashinit( int datalen, char const * name ) +struct hash * hashinit( int32_t datalen, char const * name ) { struct hash * hp = (struct hash *)BJAM_MALLOC( sizeof( *hp ) ); @@ -123,7 +123,7 @@ struct hash * hashinit( int datalen, char const * name ) * bucket or to 0 if our item is the first item in its bucket. */ -static ITEM * hash_search( struct hash * hp, unsigned int keyval, +static ITEM * hash_search( struct hash * hp, uint32_t keyval, OBJECT * keydata, ITEM * * previous ) { ITEM * i = *hash_bucket( hp, keyval ); @@ -146,10 +146,10 @@ static ITEM * hash_search( struct hash * hp, unsigned int keyval, * hash_insert() - insert a record in the table or return the existing one */ -HASHDATA * hash_insert( struct hash * hp, OBJECT * key, int * found ) +HASHDATA * hash_insert( struct hash * hp, OBJECT * key, int32_t * found ) { ITEM * i; - unsigned int keyval = hash_keyval( key ); + uint32_t keyval = hash_keyval( key ); #ifdef HASH_DEBUG_PROFILE profile_frame prof[ 1 ]; @@ -201,7 +201,7 @@ HASHDATA * hash_insert( struct hash * hp, OBJECT * key, int * found ) HASHDATA * hash_find( struct hash * hp, OBJECT * key ) { ITEM * i; - unsigned int keyval = hash_keyval( key ); + uint32_t keyval = hash_keyval( key ); #ifdef HASH_DEBUG_PROFILE profile_frame prof[ 1 ]; @@ -235,7 +235,7 @@ HASHDATA * hash_find( struct hash * hp, OBJECT * key ) static void hashrehash( struct hash * hp ) { - int i = ++hp->items.list; + int32_t i = ++hp->items.list; hp->items.more = i ? 2 * hp->items.nel : hp->inel; hp->items.next = (char *)BJAM_MALLOC( hp->items.more * hp->items.size ); hp->items.free = 0; @@ -254,7 +254,7 @@ static void hashrehash( struct hash * hp ) for ( i = 0; i < hp->items.list; ++i ) { - int nel = hp->items.lists[ i ].nel; + int32_t nel = hp->items.lists[ i ].nel; char * next = hp->items.lists[ i ].base; for ( ; nel--; next += hp->items.size ) @@ -277,11 +277,11 @@ static void hashrehash( struct hash * hp ) void hashenumerate( struct hash * hp, void (* f)( void *, void * ), void * data ) { - int i; + int32_t i; for ( i = 0; i <= hp->items.list; ++i ) { char * next = hp->items.lists[ i ].base; - int nel = hp->items.lists[ i ].nel; + int32_t nel = hp->items.lists[ i ].nel; if ( i == hp->items.list ) nel -= hp->items.more; @@ -301,7 +301,7 @@ void hashenumerate( struct hash * hp, void (* f)( void *, void * ), void * data void hash_free( struct hash * hp ) { - int i; + int32_t i; if ( !hp ) return; if ( hp->tab.base ) diff --git a/src/engine/hash.h b/src/engine/hash.h index 7ed633d731..5f69f97cb0 100644 --- a/src/engine/hash.h +++ b/src/engine/hash.h @@ -28,7 +28,7 @@ typedef struct hashdata HASHDATA; * datalen - item size * name - used for debugging */ -struct hash * hashinit( int datalen, char const * name ); +struct hash * hashinit( int32_t datalen, char const * name ); /* * hash_free() - free a hash table, given its handle @@ -57,7 +57,7 @@ void hashenumerate( struct hash *, void (* f)( void *, void * ), void * data ); * - if the key is present then *found == 1 and the result is a pointer to the * existing record. */ -HASHDATA * hash_insert( struct hash *, OBJECT * key, int * found ); +HASHDATA * hash_insert( struct hash *, OBJECT * key, int32_t * found ); /* * hash_find() - find a record in the table or NULL if none exists diff --git a/src/engine/jam.cpp b/src/engine/jam.cpp index c419f1fa1e..0af7c3d0ff 100644 --- a/src/engine/jam.cpp +++ b/src/engine/jam.cpp @@ -743,7 +743,7 @@ char * executable_path( char const * argv0 ) { int mib[ 4 ] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; char buf[ 1024 ]; - size_t size = sizeof( buf ); + int32_t size = sizeof( buf ); sysctl( mib, 4, buf, &size, NULL, 0 ); return ( !size || size == sizeof( buf ) ) ? NULL : strndup( buf, size ); } diff --git a/src/engine/jam_strings.cpp b/src/engine/jam_strings.cpp index c9ed8a17f0..b8511dd898 100644 --- a/src/engine/jam_strings.cpp +++ b/src/engine/jam_strings.cpp @@ -31,7 +31,7 @@ static void assert_invariants( string * self ) /* String objects modified manually after construction to contain embedded * '\0' characters are considered structurally valid. */ - assert( strlen( self->value ) <= self->size ); + assert( strlen( self->value ) <= size_t(self->size) ); for ( i = 0; i < 4; ++i ) { @@ -67,20 +67,20 @@ void string_free( string * s ) } -static void string_reserve_internal( string * self, size_t capacity ) +static void string_reserve_internal( string * self, int32_t capacity ) { if ( self->value == self->opt ) { - self->value = (char *)BJAM_MALLOC_ATOMIC( capacity + + self->value = (char *)BJAM_MALLOC_ATOMIC( size_t(capacity) + JAM_STRING_MAGIC_SIZE ); self->value[ 0 ] = 0; size_t opt_size = sizeof(self->opt); // Workaround sizeof in strncat warning. strncat( self->value, self->opt, opt_size ); - assert( strlen( self->value ) <= self->capacity && "Regression test" ); + assert( strlen( self->value ) <= size_t(self->capacity) && "Regression test" ); } else { - self->value = (char *)BJAM_REALLOC( self->value, capacity + + self->value = (char *)BJAM_REALLOC( self->value, size_t(capacity) + JAM_STRING_MAGIC_SIZE ); } #ifndef NDEBUG @@ -90,7 +90,7 @@ static void string_reserve_internal( string * self, size_t capacity ) } -void string_reserve( string * self, size_t capacity ) +void string_reserve( string * self, int32_t capacity ) { assert_invariants( self ); if ( capacity <= self->capacity ) @@ -100,12 +100,12 @@ void string_reserve( string * self, size_t capacity ) } -static void maybe_reserve( string * self, size_t new_size ) +static void maybe_reserve( string * self, int32_t new_size ) { - size_t capacity = self->capacity; + int32_t capacity = self->capacity; if ( capacity <= new_size ) { - size_t new_capacity = capacity; + int32_t new_capacity = capacity; while ( new_capacity <= new_size ) new_capacity <<= 1; string_reserve_internal( self, new_capacity ); @@ -115,13 +115,13 @@ static void maybe_reserve( string * self, size_t new_size ) void string_append( string * self, char const * rhs ) { - size_t rhs_size = strlen( rhs ); - size_t new_size = self->size + rhs_size; + int32_t rhs_size = int32_t(strlen( rhs )); + int32_t new_size = self->size + rhs_size; assert_invariants( self ); maybe_reserve( self, new_size ); - memcpy( self->value + self->size, rhs, rhs_size + 1 ); + memcpy( self->value + self->size, rhs, size_t(rhs_size) + 1 ); self->size = new_size; assert_invariants( self ); @@ -130,14 +130,14 @@ void string_append( string * self, char const * rhs ) void string_append_range( string * self, char const * start, char const * finish ) { - size_t rhs_size = finish - start; - size_t new_size = self->size + rhs_size; + int32_t rhs_size = int32_t(finish - start); + int32_t new_size = self->size + rhs_size; assert_invariants( self ); maybe_reserve( self, new_size ); if ( start != finish ) - memcpy( self->value + self->size, start, rhs_size ); + memcpy( self->value + self->size, start, size_t(rhs_size) ); self->size = new_size; self->value[ new_size ] = 0; @@ -151,7 +151,7 @@ void string_copy( string * s, char const * rhs ) string_append( s, rhs ); } -void string_truncate( string * self, size_t n ) +void string_truncate( string * self, int32_t n ) { assert_invariants( self ); assert( n <= self->capacity ); diff --git a/src/engine/jam_strings.h b/src/engine/jam_strings.h index 8cfa119d00..02b744a654 100644 --- a/src/engine/jam_strings.h +++ b/src/engine/jam_strings.h @@ -14,8 +14,8 @@ typedef struct string { char * value; - size_t size; - size_t capacity; + int32_t size; + int32_t capacity; char opt[ 32 ]; #ifndef NDEBUG char magic[ 4 ]; @@ -28,8 +28,8 @@ void string_free( string * ); void string_append( string *, char const * ); void string_append_range( string *, char const *, char const * ); void string_push_back( string * s, char x ); -void string_reserve( string *, size_t ); -void string_truncate( string *, size_t ); +void string_reserve( string *, int32_t ); +void string_truncate( string *, int32_t ); void string_pop_back( string * ); char string_back( string * ); void string_rtrim( string * ); diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index af602b504b..36b1ca9505 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -16,30 +16,30 @@ static LIST * freelist[ 32 ]; /* junkpile for list_dealloc() */ -static unsigned get_bucket( unsigned size ) +static int32_t get_bucket( int32_t size ) { - unsigned bucket = 0; - while ( size > ( 1u << bucket ) ) ++bucket; + int32_t bucket = 0; + while ( size > ( int32_t(1) << bucket ) ) ++bucket; return bucket; } -static LIST * list_alloc( unsigned const size ) +static LIST * list_alloc( int32_t size ) { - unsigned const bucket = get_bucket( size ); + int32_t bucket = get_bucket( size ); if ( freelist[ bucket ] ) { LIST * result = freelist[ bucket ]; freelist[ bucket ] = result->impl.next; return result; } - return (LIST *)BJAM_MALLOC( sizeof( LIST ) + ( 1u << bucket ) * + return (LIST *)BJAM_MALLOC( sizeof( LIST ) + ( size_t( 1 ) << bucket ) * sizeof( OBJECT * ) ); } static void list_dealloc( LIST * l ) { - unsigned size = list_length( l ); - unsigned bucket; + int32_t size = list_length( l ); + int32_t bucket; LIST * node = l; if ( size == 0 ) return; @@ -64,13 +64,13 @@ LIST * list_append( LIST * l, LIST * nl ) return nl; if ( !list_empty( nl ) ) { - unsigned int const l_size = list_length( l ); - int const nl_size = list_length( nl ); - int const size = l_size + nl_size; - unsigned const bucket = get_bucket( size ); + int32_t l_size = list_length( l ); + int32_t nl_size = list_length( nl ); + int32_t size = l_size + nl_size; + int32_t bucket = get_bucket( size ); /* Do we need to reallocate? */ - if ( l_size <= ( 1u << ( bucket - 1 ) ) ) + if ( l_size <= ( int32_t(1) << ( bucket - 1 ) ) ) { LIST * result = list_alloc( size ); memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( @@ -111,7 +111,7 @@ LIST * list_new( OBJECT * value ) LIST * list_push_back( LIST * head, OBJECT * value ) { - unsigned int size = list_length( head ); + int32_t size = list_length( head ); if ( DEBUG_LISTS ) out_printf( "list > %s <\n", object_str( value ) ); @@ -142,8 +142,8 @@ LIST * list_push_back( LIST * head, OBJECT * value ) LIST * list_copy( LIST * l ) { - int size = list_length( l ); - int i; + int32_t size = list_length( l ); + int32_t i; LIST * result; if ( size == 0 ) return L0; @@ -162,7 +162,7 @@ LIST * list_copy_range( LIST * l, LISTITER first, LISTITER last ) return L0; else { - int size = last - first; + int32_t size = int32_t( last - first ); LIST * result = list_alloc( size ); LISTITER dest = list_begin( result ); result->impl.size = size; @@ -177,17 +177,17 @@ LIST * list_copy_range( LIST * l, LISTITER first, LISTITER last ) * list_sublist() - copy a subset of a list of strings. */ -LIST * list_sublist( LIST * l, int start, int count ) +LIST * list_sublist( LIST * l, int32_t start, int32_t count ) { - int end = start + count; - int size = list_length( l ); + int32_t end = start + count; + int32_t size = list_length( l ); if ( start >= size ) return L0; if ( end > size ) end = size; return list_copy_range( l, list_begin( l ) + start, list_begin( l ) + end ); } -static int str_ptr_compare( void const * va, void const * vb ) +static int32_t str_ptr_compare( void const * va, void const * vb ) { OBJECT * a = *( (OBJECT * *)va ); OBJECT * b = *( (OBJECT * *)vb ); @@ -197,7 +197,7 @@ static int str_ptr_compare( void const * va, void const * vb ) LIST * list_sort( LIST * l ) { - int len; + int32_t len; LIST * result; if ( !l ) @@ -235,7 +235,7 @@ void list_free( LIST * head ) LIST * list_pop_front( LIST * l ) { - unsigned size = list_length( l ); + int32_t size = list_length( l ); assert( size ); --size; object_free( list_front( l ) ); @@ -263,11 +263,11 @@ LIST * list_pop_front( LIST * l ) LIST * list_reverse( LIST * l ) { - int size = list_length( l ); + int32_t size = list_length( l ); if ( size == 0 ) return L0; { LIST * const result = list_alloc( size ); - int i; + int32_t i; result->impl.size = size; for ( i = 0; i < size; ++i ) list_begin( result )[ i ] = object_copy( list_begin( l )[ size - i - @@ -276,9 +276,9 @@ LIST * list_reverse( LIST * l ) } } -int list_cmp( LIST * t, LIST * s ) +int32_t list_cmp( LIST * t, LIST * s ) { - int status = 0; + int32_t status = 0; LISTITER t_it = list_begin( t ); LISTITER const t_end = list_end( t ); LISTITER s_it = list_begin( s ); @@ -298,7 +298,7 @@ int list_cmp( LIST * t, LIST * s ) return status; } -int list_is_sublist( LIST * sub, LIST * l ) +int32_t list_is_sublist( LIST * sub, LIST * l ) { LISTITER iter = list_begin( sub ); LISTITER const end = list_end( sub ); @@ -329,13 +329,13 @@ void list_print( LIST * l ) * list_length() - return the number of items in the list */ -int list_length( LIST * l ) +int32_t list_length( LIST * l ) { return l ? l->impl.size : 0; } -int list_in( LIST * l, OBJECT * value ) +int32_t list_in( LIST * l, OBJECT * value ) { LISTITER iter = list_begin( l ); LISTITER end = list_end( l ); @@ -365,8 +365,7 @@ LIST * list_unique( LIST * sorted_list ) void list_done() { - unsigned int i; - for ( i = 0; i < sizeof( freelist ) / sizeof( freelist[ 0 ] ); ++i ) + for ( int32_t i = 0; i < sizeof( freelist ) / sizeof( freelist[ 0 ] ); ++i ) { LIST * l = freelist[ i ]; while ( l ) @@ -406,7 +405,7 @@ void lol_add( LOL * lol, LIST * l ) void lol_free( LOL * lol ) { - int i; + int32_t i; for ( i = 0; i < lol->count; ++i ) list_free( lol->list[ i ] ); lol->count = 0; @@ -417,7 +416,7 @@ void lol_free( LOL * lol ) * lol_get() - return one of the LISTs in the LOL. */ -LIST * lol_get( LOL * lol, int i ) +LIST * lol_get( LOL * lol, int32_t i ) { return i < lol->count ? lol->list[ i ] : L0; } @@ -429,7 +428,7 @@ LIST * lol_get( LOL * lol, int i ) void lol_print( LOL * lol ) { - int i; + int32_t i; for ( i = 0; i < lol->count; ++i ) { if ( i ) diff --git a/src/engine/lists.h b/src/engine/lists.h index c26be620df..2f802b368a 100644 --- a/src/engine/lists.h +++ b/src/engine/lists.h @@ -54,7 +54,7 @@ typedef struct _list { union { - int size; + int32_t size; struct _list * next; OBJECT * align; } impl; @@ -68,7 +68,7 @@ typedef OBJECT * * LISTITER; #define LOL_MAX 19 typedef struct _lol { - int count; + int32_t count; LIST * list[ LOL_MAX ]; } LOL; @@ -79,15 +79,15 @@ LIST * list_copy_range( LIST * destination, LISTITER first, LISTITER last ); void list_free( LIST * head ); LIST * list_push_back( LIST * head, OBJECT * value ); void list_print( LIST * ); -int list_length( LIST * ); -LIST * list_sublist( LIST *, int start, int count ); +int32_t list_length( LIST * ); +LIST * list_sublist( LIST *, int32_t start, int32_t count ); LIST * list_pop_front( LIST * ); LIST * list_sort( LIST * ); LIST * list_unique( LIST * sorted_list ); -int list_in( LIST *, OBJECT * value ); +int32_t list_in( LIST *, OBJECT * value ); LIST * list_reverse( LIST * ); -int list_cmp( LIST * lhs, LIST * rhs ); -int list_is_sublist( LIST * sub, LIST * l ); +int32_t list_cmp( LIST * lhs, LIST * rhs ); +int32_t list_is_sublist( LIST * sub, LIST * l ); void list_done(); LISTITER list_begin( LIST * ); @@ -159,7 +159,7 @@ namespace b2 { namespace jam { inline iterator begin() { return iterator(list_begin(list_obj)); } inline iterator end() { return iterator(list_end(list_obj)); } inline bool empty() const { return list_empty(list_obj) || length() == 0; } - inline int length() const { return list_length(list_obj); } + inline int32_t length() const { return list_length(list_obj); } inline list &append(const list &other) { list_obj = list_append(list_obj, list_copy(other.list_obj)); diff --git a/src/engine/make.cpp b/src/engine/make.cpp index 470626e567..065adcaef4 100644 --- a/src/engine/make.cpp +++ b/src/engine/make.cpp @@ -56,7 +56,7 @@ static TARGETS * make0sort( TARGETS * c ); #ifdef OPT_GRAPH_DEBUG_EXT - static void dependGraphOutput( TARGET * t, int depth ); + static void dependGraphOutput( TARGET * t, int32_t depth ); #endif static char const * target_fate[] = @@ -91,10 +91,10 @@ static char const * target_bind[] = * make() - make a target, given its name. */ -int make( LIST * targets, int anyhow ) +int32_t make( LIST * targets, int32_t anyhow ) { COUNTS counts[ 1 ]; - int status = 0; /* 1 if anything fails */ + int32_t status = 0; /* 1 if anything fails */ #ifdef OPT_HEADER_CACHE_EXT hcache_init(); @@ -188,7 +188,7 @@ static void update_dependants( TARGET * t ) if ( DEBUG_FATE ) { out_printf( "fate change %s from %s to %s (as dependent of %s)\n", - object_str( p->name ), target_fate[ (int) fate0 ], target_fate[ (int) p->fate ], object_str( t->name ) ); + object_str( p->name ), target_fate[ (int32_t) fate0 ], target_fate[ (int32_t) p->fate ], object_str( t->name ) ); } /* If we are done visiting it, go back and make sure its dependants @@ -219,7 +219,7 @@ static void force_rebuilds( TARGET * t ) { if ( DEBUG_FATE ) out_printf( "fate change %s from %s to %s (by rebuild)\n", - object_str( r->name ), target_fate[ (int) r->fate ], target_fate[ T_FATE_REBUILD ] ); + object_str( r->name ), target_fate[ (int32_t) r->fate ], target_fate[ T_FATE_REBUILD ] ); /* Force rebuild it. */ r->fate = T_FATE_REBUILD; @@ -231,9 +231,9 @@ static void force_rebuilds( TARGET * t ) } -int make0rescan( TARGET * t, TARGET * rescanning ) +int32_t make0rescan( TARGET * t, TARGET * rescanning ) { - int result = 0; + int32_t result = 0; TARGETS * c; /* Check whether we have already found a cycle. */ @@ -281,9 +281,9 @@ void make0 ( TARGET * t, TARGET * p, /* parent */ - int depth, /* for display purposes */ + int32_t depth, /* for display purposes */ COUNTS * counts, /* for reporting */ - int anyhow, + int32_t anyhow, TARGET * rescanning ) /* forcibly touch all (real) targets */ { @@ -293,13 +293,13 @@ void make0 timestamp last; timestamp leaf; timestamp hlast; - int fate; + int32_t fate; char const * flag = ""; SETTINGS * s; #ifdef OPT_GRAPH_DEBUG_EXT - int savedFate; - int oldTimeStamp; + int32_t savedFate; + int32_t oldTimeStamp; #endif if ( DEBUG_MAKEPROG ) @@ -392,7 +392,7 @@ void make0 case T_BIND_MISSING: case T_BIND_PARENTS: out_printf( "time\t--\t%s%s: %s\n", spaces( depth ), - object_str( t->name ), target_bind[ (int)t->binding ] ); + object_str( t->name ), target_bind[ (int32_t)t->binding ] ); break; case T_BIND_EXISTS: @@ -409,7 +409,7 @@ void make0 /* Step 3a: Recursively make0() dependencies. */ for ( c = t->depends; c; c = c->next ) { - int const internal = t->flags & T_FLAG_INTERNAL; + int32_t const internal = t->flags & T_FLAG_INTERNAL; /* Warn about circular deps, except for includes, which include each * other alot. @@ -453,7 +453,7 @@ void make0 /* Step 3d: Detect cycles. */ { - int cycle_depth = depth; + int32_t cycle_depth = depth; for ( c = t->depends; c; c = c->next ) { TARGET * scc_root = target_scc( c->target ); @@ -512,8 +512,8 @@ void make0 if ( DEBUG_FATE ) if ( fate < c->target->fate ) out_printf( "fate change %s from %s to %s by dependency %s\n", - object_str( t->name ), target_fate[ (int)fate ], - target_fate[ (int)c->target->fate ], object_str( + object_str( t->name ), target_fate[ (int32_t)fate ], + target_fate[ (int32_t)c->target->fate ], object_str( c->target->name ) ); #endif } @@ -760,7 +760,7 @@ void make0 flag = "*"; if ( DEBUG_MAKEPROG ) - out_printf( "made%s\t%s\t%s%s\n", flag, target_fate[ (int)t->fate ], + out_printf( "made%s\t%s\t%s%s\n", flag, target_fate[ (int32_t)t->fate ], spaces( depth ), object_str( t->name ) ); } @@ -783,7 +783,7 @@ static char const * target_name( TARGET * t ) * dependGraphOutput() - output the DG after make0 has run. */ -static void dependGraphOutput( TARGET * t, int depth ) +static void dependGraphOutput( TARGET * t, int32_t depth ) { TARGETS * c; @@ -864,7 +864,7 @@ static void dependGraphOutput( TARGET * t, int depth ) for ( c = t->depends; c; c = c->next ) { out_printf( " %s : Depends on %s (%s)", spaces( depth ), - target_name( c->target ), target_fate[ (int)c->target->fate ] ); + target_name( c->target ), target_fate[ (int32_t)c->target->fate ] ); if ( !timestamp_cmp( &c->target->time, &t->time ) ) out_printf( " (max time)"); out_printf( "\n" ); diff --git a/src/engine/make.h b/src/engine/make.h index 537b9e98f7..5fcdb7a2e2 100644 --- a/src/engine/make.h +++ b/src/engine/make.h @@ -16,20 +16,20 @@ #include "object.h" #include "rules.h" -int make( LIST * targets, int anyhow ); -int make1( LIST * t ); +int32_t make( LIST * targets, int32_t anyhow ); +int32_t make1( LIST * t ); typedef struct { - int temp; - int updating; - int cantfind; - int cantmake; - int targets; - int made; + int32_t temp; + int32_t updating; + int32_t cantfind; + int32_t cantmake; + int32_t targets; + int32_t made; } COUNTS ; -void make0( TARGET * t, TARGET * p, int depth, COUNTS * counts, int anyhow, +void make0( TARGET * t, TARGET * p, int32_t depth, COUNTS * counts, int32_t anyhow, TARGET * rescanning ); diff --git a/src/engine/make1.cpp b/src/engine/make1.cpp index fe6a94f9ce..1e200d9ede 100644 --- a/src/engine/make1.cpp +++ b/src/engine/make1.cpp @@ -59,24 +59,24 @@ #endif static CMD * make1cmds ( TARGET * ); -static LIST * make1list ( LIST *, TARGETS *, int flags ); +static LIST * make1list ( LIST *, TARGETS *, int32_t flags ); static SETTINGS * make1settings ( struct module_t *, LIST * vars ); static void make1bind ( TARGET * ); -static void push_cmds( CMDLIST * cmds, int status ); -static int cmd_sem_lock( TARGET * t ); +static void push_cmds( CMDLIST * cmds, int32_t status ); +static int32_t cmd_sem_lock( TARGET * t ); static void cmd_sem_unlock( TARGET * t ); -static int targets_contains( TARGETS * l, TARGET * t ); -static int targets_equal( TARGETS * l1, TARGETS * l2 ); +static int32_t targets_contains( TARGETS * l, TARGET * t ); +static int32_t targets_equal( TARGETS * l1, TARGETS * l2 ); /* Ugly static - it is too hard to carry it through the callbacks. */ static struct { - int failed; - int skipped; - int total; - int made; + int32_t failed; + int32_t skipped; + int32_t total; + int32_t made; } counts[ 1 ]; /* Target state. */ @@ -90,16 +90,16 @@ struct _state state * prev; /* previous state on stack */ TARGET * t; /* current target */ TARGET * parent; /* parent argument necessary for MAKE1A */ - int curstate; /* current state */ + int32_t curstate; /* current state */ }; static void make1a( state * const ); static void make1b( state * const ); static void make1c( state const * const ); -static void make1c_closure( void * const closure, int status, +static void make1c_closure( void * const closure, int32_t status, timing_info const * const, char const * const cmd_stdout, - char const * const cmd_stderr, int const cmd_exit_reason ); + char const * const cmd_stderr, int32_t const cmd_exit_reason ); typedef struct _stack { @@ -111,7 +111,7 @@ static stack state_stack = { NULL }; static state * state_freelist = NULL; /* Currently running command counter. */ -static int cmdsrunning; +static int32_t cmdsrunning; static state * alloc_state() @@ -163,7 +163,7 @@ static void pop_state( stack * const pStack ) static state * push_state( stack * const pStack, TARGET * const t, - TARGET * const parent, int const curstate ) + TARGET * const parent, int32_t const curstate ) { state * const pState = alloc_state(); pState->t = t; @@ -194,13 +194,13 @@ static void push_stack_on_stack( stack * const pDest, stack * const pSrc ) * make1() - execute commands to update a list of targets and all of their dependencies */ -static int intr = 0; -static int quit = 0; +static int32_t intr = 0; +static int32_t quit = 0; -int make1( LIST * targets ) +int32_t make1( LIST * targets ) { state * pState; - int status = 0; + int32_t status = 0; memset( (char *)counts, 0, sizeof( *counts ) ); @@ -512,7 +512,7 @@ static void make1c( state const * const pState ) { TARGET * const t = pState->t; CMD * const cmd = (CMD *)t->cmds; - int exec_flags = 0; + int32_t exec_flags = 0; if ( cmd ) { @@ -786,7 +786,7 @@ static void call_timing_rule( TARGET * target, timing_info const * const time ) static void call_action_rule ( TARGET * target, - int status, + int32_t status, timing_info const * time, char const * executed_command, char const * command_output @@ -869,11 +869,11 @@ static void call_action_rule static void make1c_closure ( void * const closure, - int status_orig, + int32_t status_orig, timing_info const * const time, char const * const cmd_stdout, char const * const cmd_stderr, - int const cmd_exit_reason + int32_t const cmd_exit_reason ) { TARGET * const t = (TARGET *)closure; @@ -984,7 +984,7 @@ static void make1c_closure } /* push the next MAKE1C state after a command is run. */ -static void push_cmds( CMDLIST * cmds, int status ) +static void push_cmds( CMDLIST * cmds, int32_t status ) { CMDLIST * cmd_iter; for( cmd_iter = cmds; cmd_iter; cmd_iter = cmd_iter->next ) @@ -1070,7 +1070,7 @@ static CMD * make1cmds( TARGET * t ) module_t * settings_module = 0; TARGET * settings_target = 0; ACTIONS * a0; - int const running_flag = globs.noexec ? A_RUNNING_NOEXEC : A_RUNNING; + int32_t const running_flag = globs.noexec ? A_RUNNING_NOEXEC : A_RUNNING; /* Step through actions. */ @@ -1168,21 +1168,21 @@ static CMD * make1cmds( TARGET * t ) * Note that we loop through at least once, for sourceless actions. */ { - int const length = list_length( ns ); - int start = 0; - int chunk = length; - int cmd_count = 0; + int32_t const length = list_length( ns ); + int32_t start = 0; + int32_t chunk = length; + int32_t cmd_count = 0; TARGETS * semaphores = NULL; TARGETS * targets_iter; - int unique_targets; + int32_t unique_targets; do { CMD * cmd; - int cmd_check_result; - size_t cmd_error_length; - size_t cmd_error_max_length; - int retry = 0; - int accept_command = 0; + int32_t cmd_check_result; + int32_t cmd_error_length; + int32_t cmd_error_max_length; + int32_t retry = 0; + int32_t accept_command = 0; /* Build cmd: cmd_new() takes ownership of its lists. */ cmd = cmd_new( rule, list_copy( nt ), list_sublist( ns, start, @@ -1219,21 +1219,10 @@ static CMD * make1cmds( TARGET * t ) : "contains a line that is too long"; assert( cmd_check_result == EXEC_CHECK_TOO_LONG || cmd_check_result == EXEC_CHECK_LINE_TOO_LONG ); - if (sizeof(size_t) == (sizeof(long long int))) - out_printf( - "%s action %s (%lld, max %lld):\n", - object_str( rule->name ), error_message, - cmd_error_length, cmd_error_max_length ); - else if (sizeof(size_t) == (sizeof(long int))) - out_printf( - "%s action %s (%ld, max %ld):\n", - object_str( rule->name ), error_message, - cmd_error_length, cmd_error_max_length ); - else - out_printf( - "%s action %s (%d, max %d):\n", - object_str( rule->name ), error_message, - cmd_error_length, cmd_error_max_length ); + out_printf( + "%s action %s (%d, max %d):\n", + object_str( rule->name ), error_message, + cmd_error_length, cmd_error_max_length ); /* Tell the user what did not fit. */ out_puts( cmd->buf->value ); @@ -1326,7 +1315,7 @@ static CMD * make1cmds( TARGET * t ) * make1list() - turn a list of targets into a LIST, for $(<) and $(>) */ -static LIST * make1list( LIST * l, TARGETS * targets, int flags ) +static LIST * make1list( LIST * l, TARGETS * targets, int32_t flags ) { for ( ; targets; targets = targets->next ) { @@ -1429,7 +1418,7 @@ static void make1bind( TARGET * t ) } -static int targets_contains( TARGETS * l, TARGET * t ) +static int32_t targets_contains( TARGETS * l, TARGET * t ) { for ( ; l; l = l->next ) { @@ -1441,7 +1430,7 @@ static int targets_contains( TARGETS * l, TARGET * t ) return 0; } -static int targets_equal( TARGETS * l1, TARGETS * l2 ) +static int32_t targets_equal( TARGETS * l1, TARGETS * l2 ) { for ( ; l1 && l2; l1 = l1->next, l2 = l2->next ) { @@ -1454,7 +1443,7 @@ static int targets_equal( TARGETS * l1, TARGETS * l2 ) #ifdef OPT_SEMAPHORE -static int cmd_sem_lock( TARGET * t ) +static int32_t cmd_sem_lock( TARGET * t ) { CMD * cmd = (CMD *)t->cmds; TARGETS * iter; diff --git a/src/engine/modules/order.cpp b/src/engine/modules/order.cpp index 38209b889d..dcfee4343a 100644 --- a/src/engine/modules/order.cpp +++ b/src/engine/modules/order.cpp @@ -15,7 +15,7 @@ /* Use quite klugy approach: when we add order dependency from 'a' to 'b', just * append 'b' to of value of variable 'a'. */ -LIST * add_pair( FRAME * frame, int flags ) +LIST * add_pair( FRAME * frame, int32_t flags ) { LIST * arg = lol_get( frame->args, 0 ); LISTITER iter = list_begin( arg ); @@ -29,9 +29,9 @@ LIST * add_pair( FRAME * frame, int flags ) /* Given a list and a value, returns position of that value in the list, or -1 * if not found. */ -int list_index( LIST * list, OBJECT * value ) +int32_t list_index( LIST * list, OBJECT * value ) { - int result = 0; + int32_t result = 0; LISTITER iter = list_begin( list ); LISTITER const end = list_end( list ); for ( ; iter != end; iter = list_next( iter ), ++result ) @@ -47,15 +47,15 @@ enum colors { white, gray, black }; * vertices which were not yet visited. After that, 'current_vertex' is added to * '*result_ptr'. */ -void do_ts( int * * graph, int current_vertex, int * colors, int * * result_ptr +void do_ts( int32_t * * graph, int32_t current_vertex, int32_t * colors, int32_t * * result_ptr ) { - int i; + int32_t i; colors[ current_vertex ] = gray; for ( i = 0; graph[ current_vertex ][ i ] != -1; ++i ) { - int adjacent_vertex = graph[ current_vertex ][ i ]; + int32_t adjacent_vertex = graph[ current_vertex ][ i ]; if ( colors[ adjacent_vertex ] == white ) do_ts( graph, adjacent_vertex, colors, result_ptr ); /* The vertex is either black, in which case we do not have to do @@ -70,10 +70,10 @@ void do_ts( int * * graph, int current_vertex, int * colors, int * * result_ptr } -void topological_sort( int * * graph, int num_vertices, int * result ) +static void topological_sort( int32_t * * graph, int32_t num_vertices, int32_t * result ) { - int i; - int * colors = ( int * )BJAM_CALLOC( num_vertices, sizeof( int ) ); + int32_t i; + int32_t * colors = ( int32_t * )BJAM_CALLOC( num_vertices, sizeof( int32_t ) ); for ( i = 0; i < num_vertices; ++i ) colors[ i ] = white; @@ -85,34 +85,34 @@ void topological_sort( int * * graph, int num_vertices, int * result ) } -LIST * order( FRAME * frame, int flags ) +LIST * order( FRAME * frame, int32_t flags ) { LIST * arg = lol_get( frame->args, 0 ); LIST * result = L0; - int src; + int32_t src; LISTITER iter = list_begin( arg ); LISTITER const end = list_end( arg ); /* We need to create a graph of order dependencies between the passed * objects. We assume there are no duplicates passed to 'add_pair'. */ - int length = list_length( arg ); - int * * graph = ( int * * )BJAM_CALLOC( length, sizeof( int * ) ); - int * order = ( int * )BJAM_MALLOC( ( length + 1 ) * sizeof( int ) ); + int32_t length = list_length( arg ); + int32_t * * graph = ( int32_t * * )BJAM_CALLOC( length, sizeof( int32_t * ) ); + int32_t * order = ( int32_t * )BJAM_MALLOC( ( length + 1 ) * sizeof( int32_t ) ); for ( src = 0; iter != end; iter = list_next( iter ), ++src ) { /* For all objects this one depends upon, add elements to 'graph'. */ LIST * dependencies = var_get( frame->module, list_item( iter ) ); - int index = 0; + int32_t index = 0; LISTITER dep_iter = list_begin( dependencies ); LISTITER const dep_end = list_end( dependencies ); - graph[ src ] = ( int * )BJAM_CALLOC( list_length( dependencies ) + 1, - sizeof( int ) ); + graph[ src ] = ( int32_t * )BJAM_CALLOC( list_length( dependencies ) + 1, + sizeof( int32_t ) ); for ( ; dep_iter != dep_end; dep_iter = list_next( dep_iter ) ) { - int const dst = list_index( arg, list_item( dep_iter ) ); + int32_t const dst = list_index( arg, list_item( dep_iter ) ); if ( dst != -1 ) graph[ src ][ index++ ] = dst; } @@ -122,10 +122,10 @@ LIST * order( FRAME * frame, int flags ) topological_sort( graph, length, order ); { - int index = length - 1; + int32_t index = length - 1; for ( ; index >= 0; --index ) { - int i; + int32_t i; LISTITER iter = list_begin( arg ); for ( i = 0; i < order[ index ]; ++i, iter = list_next( iter ) ); result = list_push_back( result, object_copy( list_item( iter ) ) ); @@ -134,7 +134,7 @@ LIST * order( FRAME * frame, int flags ) /* Clean up */ { - int i; + int32_t i; for ( i = 0; i < length; ++i ) BJAM_FREE( graph[ i ] ); BJAM_FREE( graph ); diff --git a/src/engine/modules/property-set.cpp b/src/engine/modules/property-set.cpp index 1f33941075..30236ee3ac 100644 --- a/src/engine/modules/property-set.cpp +++ b/src/engine/modules/property-set.cpp @@ -26,8 +26,8 @@ struct ps_map_entry struct ps_map { struct ps_map_entry * * table; - size_t table_size; - size_t num_elems; + int32_t table_size; + int32_t num_elems; }; static unsigned list_hash(LIST * key) @@ -63,10 +63,10 @@ static int list_equal( LIST * lhs, LIST * rhs ) static void ps_map_init( struct ps_map * map ) { - size_t i; + int32_t i; map->table_size = 2; map->num_elems = 0; - map->table = (struct ps_map_entry * *)BJAM_MALLOC( map->table_size * sizeof( struct ps_map_entry * ) ); + map->table = (struct ps_map_entry * *)BJAM_MALLOC( size_t(map->table_size) * sizeof( struct ps_map_entry * ) ); for ( i = 0; i < map->table_size; ++i ) { map->table[ i ] = NULL; @@ -75,7 +75,7 @@ static void ps_map_init( struct ps_map * map ) static void ps_map_destroy( struct ps_map * map ) { - size_t i; + int32_t i; for ( i = 0; i < map->table_size; ++i ) { struct ps_map_entry * pos; @@ -93,8 +93,8 @@ static void ps_map_destroy( struct ps_map * map ) static void ps_map_rehash( struct ps_map * map ) { struct ps_map old = *map; - size_t i; - map->table = (struct ps_map_entry * *)BJAM_MALLOC( map->table_size * 2 * sizeof( struct ps_map_entry * ) ); + int32_t i; + map->table = (struct ps_map_entry * *)BJAM_MALLOC( size_t(map->table_size) * 2 * sizeof( struct ps_map_entry * ) ); map->table_size *= 2; for ( i = 0; i < map->table_size; ++i ) { diff --git a/src/engine/modules/regex.cpp b/src/engine/modules/regex.cpp index fa53558588..eae846d75e 100644 --- a/src/engine/modules/regex.cpp +++ b/src/engine/modules/regex.cpp @@ -48,7 +48,7 @@ LIST * regex_split( FRAME * frame, int flags ) prev = pos = object_str( s ); while ( regexec( re, pos ) ) { - result = list_push_back( result, object_new_range( prev, re->startp[ 0 ] - prev ) ); + result = list_push_back( result, object_new_range( prev, int32_t(re->startp[ 0 ] - prev) ) ); prev = re->endp[ 0 ]; /* Handle empty matches */ if ( *pos == '\0' ) diff --git a/src/engine/native.cpp b/src/engine/native.cpp index 68828aa315..0f80080f66 100644 --- a/src/engine/native.cpp +++ b/src/engine/native.cpp @@ -12,7 +12,7 @@ void declare_native_rule( char const * module, char const * rule, - char const * * args, LIST * (*f)( FRAME *, int ), int version ) + char const * * args, LIST * (*f)( FRAME *, int32_t ), int32_t version ) { OBJECT * const module_obj = module ? object_new( module ) : 0 ; module_t * m = bindmodule( module_obj ); @@ -23,7 +23,7 @@ void declare_native_rule( char const * module, char const * rule, { OBJECT * const name = object_new( rule ); - int found; + int32_t found; native_rule_t * const np = (native_rule_t *)hash_insert( m->native_rules, name, &found ); np->name = name; diff --git a/src/engine/native.h b/src/engine/native.h index f80b0e0f04..5367552f5c 100644 --- a/src/engine/native.h +++ b/src/engine/native.h @@ -25,11 +25,11 @@ typedef struct native_rule_t * * Versions are numbered from 1. */ - int version; + int32_t version; } native_rule_t; /* MSVC debugger gets confused unless the native_rule_t typedef is provided. */ void declare_native_rule( char const * module, char const * rule, - char const * * args, LIST * (*f)( FRAME *, int ), int version ); + char const * * args, LIST * (*f)( FRAME *, int32_t ), int32_t version ); #endif diff --git a/src/engine/object.cpp b/src/engine/object.cpp index 90af921173..332b457518 100644 --- a/src/engine/object.cpp +++ b/src/engine/object.cpp @@ -55,15 +55,15 @@ struct hash_item typedef struct string_set { - unsigned int num; - unsigned int size; + int32_t num; + int32_t size; struct hash_item * * data; } string_set; static string_set strhash; -static int strtotal = 0; -static int strcount_in = 0; -static int strcount_out = 0; +static int32_t strtotal = 0; +static int32_t strcount_in = 0; +static int32_t strcount_out = 0; /* @@ -89,13 +89,13 @@ static char * storage_finish = 0; * allocate() - Allocate n bytes of immortal string storage. */ -static char * allocate( size_t n ) +static char * allocate( int32_t n ) { #ifdef BJAM_NEWSTR_NO_ALLOCATE return (char *)BJAM_MALLOC( n ); #else /* See if we can grab storage from an existing block. */ - size_t remaining = storage_finish - storage_start; + int32_t remaining = int32_t(storage_finish - storage_start); n = ( ( n + ALLOC_ALIGNMENT - 1 ) / ALLOC_ALIGNMENT ) * ALLOC_ALIGNMENT; if ( remaining >= n ) { @@ -106,13 +106,13 @@ static char * allocate( size_t n ) else /* Must allocate a new block. */ { strblock * new_block; - size_t nalloc = n; + int32_t nalloc = n; if ( nalloc < STRING_BLOCK ) nalloc = STRING_BLOCK; /* Allocate a new block and link into the chain. */ new_block = (strblock *)BJAM_MALLOC( offsetof( strblock, data[ 0 ] ) + - nalloc * sizeof( new_block->data[ 0 ] ) ); + size_t(nalloc) * sizeof( new_block->data[ 0 ] ) ); if ( new_block == 0 ) return 0; new_block->next = strblock_chain; @@ -130,7 +130,7 @@ static char * allocate( size_t n ) } -static unsigned int hash_keyval( char const * key, int const size ) +static unsigned int hash_keyval( char const * key, int32_t size ) { unsigned int const magic = 2147059363; unsigned int hash = 0; @@ -171,14 +171,13 @@ static void string_set_done( string_set * set ) static void string_set_resize( string_set * set ) { - unsigned i; string_set new_set; new_set.num = set->num * 2; new_set.size = set->size; new_set.data = (struct hash_item * *)BJAM_MALLOC( sizeof( struct hash_item * ) * new_set.num ); memset( new_set.data, 0, sizeof( struct hash_item * ) * new_set.num ); - for ( i = 0; i < set->num; ++i ) + for ( int32_t i = 0; i < set->num; ++i ) { while ( set->data[ i ] ) { @@ -195,7 +194,7 @@ static void string_set_resize( string_set * set ) static char const * string_set_insert( string_set * set, char const * string, - int const size ) + int32_t const size ) { unsigned hash = hash_keyval( string, size ); unsigned pos = hash % set->num; @@ -248,7 +247,7 @@ static void object_validate( OBJECT * obj ) * object_new_range() - create an object from a string of given length */ -OBJECT * object_new_range( char const * const string, size_t size ) +OBJECT * object_new_range( char const * const string, int32_t size ) { ++strcount_in; @@ -278,7 +277,7 @@ OBJECT * object_new_range( char const * const string, size_t size ) OBJECT * object_new( char const * const string ) { - return object_new_range( string, strlen( string ) ); + return object_new_range( string, int32_t(strlen( string )) ); } diff --git a/src/engine/object.h b/src/engine/object.h index 89805b158c..555e9851c6 100644 --- a/src/engine/object.h +++ b/src/engine/object.h @@ -18,7 +18,7 @@ typedef struct _object OBJECT; OBJECT * object_new( char const * const ); -OBJECT * object_new_range( char const * const, size_t size ); +OBJECT * object_new_range( char const * const, int32_t size ); void object_done( void ); #if defined(NDEBUG) && !defined(BJAM_NO_MEM_CACHE) diff --git a/src/engine/pathnt.cpp b/src/engine/pathnt.cpp index 51faf3d3d5..5c35c40e46 100644 --- a/src/engine/pathnt.cpp +++ b/src/engine/pathnt.cpp @@ -94,11 +94,11 @@ void path_get_temp_path_( string * buffer ) * - path_key_cache path/key mapping cache object already initialized */ -static int canonicWindowsPath( char const * const path, size_t path_length, +static int canonicWindowsPath( char const * const path, int32_t path_length, string * const out ) { char const * last_element; - size_t saved_size; + int32_t saved_size; char const * p; int missing_parent; @@ -138,7 +138,7 @@ static int canonicWindowsPath( char const * const path, size_t path_length, if ( p >= path ) { char const * const dir = path; - const size_t dir_length = p - path; + const int32_t dir_length = int32_t(p - path); OBJECT * const dir_obj = object_new_range( dir, dir_length ); int found; path_key_entry * const result = (path_key_entry *)hash_insert( @@ -170,7 +170,7 @@ static int canonicWindowsPath( char const * const path, size_t path_length, if ( !missing_parent ) { char const * const n = last_element; - size_t n_length = path + path_length - n; + int32_t n_length = int32_t(path + path_length - n); if ( !( n_length == 1 && n[ 0 ] == '.' ) && !( n_length == 2 && n[ 0 ] == '.' && n[ 1 ] == '.' ) ) { @@ -239,7 +239,7 @@ static path_key_entry * path_key( OBJECT * const path, if ( !found ) { OBJECT * normalized; - size_t normalized_size; + int32_t normalized_size; path_key_entry * nresult; result->path = path; { diff --git a/src/engine/pathsys.cpp b/src/engine/pathsys.cpp index 00687d1590..7e6d57a34f 100644 --- a/src/engine/pathsys.cpp +++ b/src/engine/pathsys.cpp @@ -64,7 +64,7 @@ void path_parse( char const * file, PATHNAME * f ) if ( ( file[ 0 ] == '<' ) && ( p = strchr( file, '>' ) ) ) { f->f_grist.ptr = file; - f->f_grist.len = p - file; + f->f_grist.len = int32_t(p - file); file = p + 1; } @@ -83,7 +83,7 @@ void path_parse( char const * file, PATHNAME * f ) if ( p ) { f->f_dir.ptr = file; - f->f_dir.len = p - file; + f->f_dir.len = int32_t(p - file); /* Special case for / - dirname is /, not "" */ if ( !f->f_dir.len ) @@ -104,7 +104,7 @@ void path_parse( char const * file, PATHNAME * f ) if ( ( p = strchr( file, '(' ) ) && ( end[ -1 ] == ')' ) ) { f->f_member.ptr = p + 1; - f->f_member.len = end - p - 2; + f->f_member.len = int32_t(end - p - 2); end = p; } @@ -115,13 +115,13 @@ void path_parse( char const * file, PATHNAME * f ) if ( p ) { f->f_suffix.ptr = p; - f->f_suffix.len = end - p; + f->f_suffix.len = int32_t(end - p); end = p; } /* Leaves base. */ f->f_base.ptr = file; - f->f_base.len = end - file; + f->f_base.len = int32_t(end - file); } @@ -316,7 +316,7 @@ std::string b2::paths::normalize(const std::string &p) // want this function to obtain a canonic representation. std::replace(result.begin(), result.end(), '\\', '/'); - size_t ellipsis = 0; + int32_t ellipsis = 0; for (auto end_pos = result.length(); end_pos > 0; ) { auto path_pos = result.rfind('/', end_pos-1); diff --git a/src/engine/pathsys.h b/src/engine/pathsys.h index ad27e7d54f..272cae2145 100644 --- a/src/engine/pathsys.h +++ b/src/engine/pathsys.h @@ -38,7 +38,7 @@ Distributed under the Boost Software License, Version 1.0. typedef struct _pathpart { char const * ptr; - size_t len; + int32_t len; } PATHPART; typedef struct _pathname diff --git a/src/engine/regexp.cpp b/src/engine/regexp.cpp index 537bc828dc..dacae62520 100644 --- a/src/engine/regexp.cpp +++ b/src/engine/regexp.cpp @@ -154,9 +154,9 @@ * Utility definitions. */ #ifndef CHARBITS -#define UCHARAT(p) ((int)*(const unsigned char *)(p)) +#define UCHARAT(p) ((int32_t)*(const unsigned char *)(p)) #else -#define UCHARAT(p) ((int)*(p)&CHARBITS) +#define UCHARAT(p) ((int32_t)*(p)&CHARBITS) #endif #define FAIL(m) { regerror(m); return(NULL); } @@ -173,11 +173,11 @@ /* * Global work variables for regcomp(). */ -static char *regparse; /* Input-scan pointer. */ -static int regnpar; /* () count. */ +static char *regparse; /* Input-scan pointer. */ +static int32_t regnpar; /* () count. */ static char regdummy; -static char *regcode; /* Code-emit pointer; ®dummy = don't. */ -static long regsize; /* Code size. */ +static char *regcode; /* Code-emit pointer; ®dummy = don't. */ +static int32_t regsize; /* Code size. */ /* * Forward declarations for regcomp()'s friends. @@ -185,18 +185,18 @@ static long regsize; /* Code size. */ #ifndef STATIC #define STATIC static #endif -STATIC char *reg( int paren, int *flagp ); -STATIC char *regbranch( int *flagp ); -STATIC char *regpiece( int *flagp ); -STATIC char *regatom( int *flagp ); -STATIC char *regnode( int op ); +STATIC char *reg( int32_t paren, int32_t *flagp ); +STATIC char *regbranch( int32_t *flagp ); +STATIC char *regpiece( int32_t *flagp ); +STATIC char *regatom( int32_t *flagp ); +STATIC char *regnode( int32_t op ); STATIC char *regnext( char *p ); -STATIC void regc( int b ); +STATIC void regc( int32_t b ); STATIC void reginsert( char op, char *opnd ); STATIC void regtail( char *p, char *val ); STATIC void regoptail( char *p, char *val ); #ifdef STRCSPN -STATIC int strcspn(); +STATIC int32_t strcspn(); #endif /* @@ -220,8 +220,8 @@ regcomp( const char *exp ) regexp *r; char *scan; char *longest; - unsigned len; - int flags; + int32_t len; + int32_t flags; if (exp == NULL) FAIL("NULL argument"); @@ -232,7 +232,7 @@ regcomp( const char *exp ) #endif regparse = (char *)exp; regnpar = 1; - regsize = 0L; + regsize = 0; regcode = ®dummy; regc(MAGIC); if (reg(0, &flags) == NULL) @@ -243,7 +243,7 @@ regcomp( const char *exp ) FAIL("regexp too big"); /* Allocate space. */ - r = (regexp *)BJAM_MALLOC(sizeof(regexp) + (unsigned)regsize); + r = (regexp *)BJAM_MALLOC(sizeof(regexp) + regsize); if (r == NULL) FAIL("out of space"); @@ -282,9 +282,9 @@ regcomp( const char *exp ) longest = NULL; len = 0; for (; scan != NULL; scan = regnext(scan)) - if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) { + if (OP(scan) == EXACTLY && static_cast(strlen(OPERAND(scan))) >= len) { longest = OPERAND(scan); - len = strlen(OPERAND(scan)); + len = static_cast(strlen(OPERAND(scan))); } r->regmust = longest; r->regmlen = len; @@ -305,14 +305,14 @@ regcomp( const char *exp ) */ static char * reg( - int paren, /* Parenthesized? */ - int *flagp ) + int32_t paren, /* Parenthesized? */ + int32_t *flagp ) { char *ret; char *br; char *ender; - int parno = 0; - int flags; + int32_t parno = 0; + int32_t flags; *flagp = HASWIDTH; /* Tentatively. */ @@ -376,12 +376,12 @@ reg( * Implements the concatenation operator. */ static char * -regbranch( int *flagp ) +regbranch( int32_t *flagp ) { char *ret; char *chain; char *latest; - int flags; + int32_t flags; *flagp = WORST; /* Tentatively. */ @@ -415,12 +415,12 @@ regbranch( int *flagp ) * endmarker role is not redundant. */ static char * -regpiece( int *flagp ) +regpiece( int32_t *flagp ) { char *ret; char op; char *next; - int flags; + int32_t flags; ret = regatom(&flags); if (ret == NULL) @@ -478,10 +478,10 @@ regpiece( int *flagp ) * separate node; the code is simpler that way and it's not worth fixing. */ static char * -regatom( int *flagp ) +regatom( int32_t *flagp ) { char *ret; - int flags; + int32_t flags; *flagp = WORST; /* Tentatively. */ @@ -498,8 +498,8 @@ regatom( int *flagp ) *flagp |= HASWIDTH|SIMPLE; break; case '[': { - int classr; - int classend; + int32_t classr; + int32_t classend; if (*regparse == '^') { /* Complement of range. */ ret = regnode(ANYBUT); @@ -655,7 +655,7 @@ regatom( int *flagp ) - regnode - emit a node */ static char * /* Location. */ -regnode( int op ) +regnode( int32_t op ) { char *ret; char *ptr; @@ -679,7 +679,7 @@ regnode( int op ) - regc - emit (if appropriate) a byte of code */ static void -regc( int b ) +regc( int32_t b ) { if (regcode != ®dummy) *regcode++ = b; @@ -728,7 +728,7 @@ regtail( { char *scan; char *temp; - int offset; + size_t offset; if (p == ®dummy) return; @@ -780,12 +780,12 @@ static const char **regendp; /* Ditto for endp. */ /* * Forwards. */ -STATIC int regtry( regexp *prog, const char *string ); -STATIC int regmatch( char *prog ); -STATIC int regrepeat( char *p ); +STATIC int32_t regtry( regexp *prog, const char *string ); +STATIC int32_t regmatch( char *prog ); +STATIC int32_t regrepeat( char *p ); #ifdef DEBUG -int regnarrate = 0; +int32_t regnarrate = 0; void regdump(); STATIC char *regprop(); #endif @@ -793,7 +793,7 @@ STATIC char *regprop(); /* - regexec - match a regexp against a string */ -int +int32_t regexec( regexp *prog, const char *string ) @@ -858,12 +858,12 @@ regexec( * regtry() - try match at specific point. */ -static int /* 0 failure, 1 success */ +static int32_t /* 0 failure, 1 success */ regtry( regexp *prog, const char *string ) { - int i; + int32_t i; const char * * sp; const char * * ep; @@ -899,7 +899,7 @@ regtry( * whether the rest of the match failed) by a loop instead of by recursion. */ -static int /* 0 failure, 1 success */ +static int32_t /* 0 failure, 1 success */ regmatch( char * prog ) { char * scan; /* Current node. */ @@ -947,7 +947,7 @@ regmatch( char * prog ) reginput++; break; case EXACTLY: { - int len; + size_t len; char *opnd; opnd = OPERAND(scan); @@ -983,7 +983,7 @@ regmatch( char * prog ) case OPEN+7: case OPEN+8: case OPEN+9: { - int no; + int32_t no; const char *save; no = OP(scan) - OPEN; @@ -1011,7 +1011,7 @@ regmatch( char * prog ) case CLOSE+7: case CLOSE+8: case CLOSE+9: { - int no; + int32_t no; const char *save; no = OP(scan) - CLOSE; @@ -1051,9 +1051,9 @@ regmatch( char * prog ) case STAR: case PLUS: { char nextch; - int no; + int32_t no; const char *save; - int min; + int32_t min; /* * Lookahead to avoid useless match attempts @@ -1100,10 +1100,10 @@ regmatch( char * prog ) /* - regrepeat - repeatedly match something simple, report how many */ -static int +static int32_t regrepeat( char *p ) { - int count = 0; + int32_t count = 0; const char *scan; char *opnd; @@ -1111,7 +1111,7 @@ regrepeat( char *p ) opnd = OPERAND(p); switch (OP(p)) { case ANY: - count = strlen(scan); + count = int32_t(strlen(scan)); scan += count; break; case EXACTLY: @@ -1148,7 +1148,7 @@ regrepeat( char *p ) static char * regnext( char *p ) { - int offset; + int32_t offset; if (p == ®dummy) return(NULL); @@ -1309,14 +1309,14 @@ regprop( char *op ) * of characters not from s2 */ -static int +static int32_t strcspn( char *s1, char *s2 ) { char *scan1; char *scan2; - int count; + int32_t count; count = 0; for (scan1 = s1; *scan1 != '\0'; scan1++) { diff --git a/src/engine/regexp.h b/src/engine/regexp.h index 3a52ba3d6b..bbac95eeba 100644 --- a/src/engine/regexp.h +++ b/src/engine/regexp.h @@ -16,13 +16,13 @@ typedef struct regexp { char regstart; /* Internal use only. */ char reganch; /* Internal use only. */ char * regmust; /* Internal use only. */ - int regmlen; /* Internal use only. */ + int32_t regmlen; /* Internal use only. */ char program[ 1 ]; /* Unwarranted chumminess with compiler. */ } regexp; regexp * regcomp( char const * exp ); -int regexec( regexp * prog, char const * string ); +int32_t regexec( regexp * prog, char const * string ); void regerror( char const * s ); diff --git a/src/engine/search.cpp b/src/engine/search.cpp index 7529e02dcb..7bafc2b6c4 100644 --- a/src/engine/search.cpp +++ b/src/engine/search.cpp @@ -98,7 +98,7 @@ void set_explicit_binding( OBJECT * target, OBJECT * locate ) /* Root the target path at the given location. */ f->f_root.ptr = object_str( locate ); - f->f_root.len = strlen( object_str( locate ) ); + f->f_root.len = int32_t(strlen( object_str( locate ) )); path_build( f, buf ); boundname = object_new( buf->value ); @@ -164,7 +164,7 @@ OBJECT * search( OBJECT * target, timestamp * const time, { OBJECT * key; f->f_root.ptr = object_str( list_front( varlist ) ); - f->f_root.len = strlen( object_str( list_front( varlist ) ) ); + f->f_root.len = int32_t(strlen( object_str( list_front( varlist ) ) )); path_build( f, buf ); @@ -189,7 +189,7 @@ OBJECT * search( OBJECT * target, timestamp * const time, OBJECT * test_path; f->f_root.ptr = object_str( list_item( iter ) ); - f->f_root.len = strlen( object_str( list_item( iter ) ) ); + f->f_root.len = int32_t(strlen( object_str( list_item( iter ) ) )); string_truncate( buf, 0 ); path_build( f, buf ); diff --git a/src/engine/sysinfo.cpp b/src/engine/sysinfo.cpp index c3257e71e0..779ce299e0 100644 --- a/src/engine/sysinfo.cpp +++ b/src/engine/sysinfo.cpp @@ -38,7 +38,7 @@ namespace { #if defined(OS_MACOSX) int out_hw_ncpu = 0; - size_t len_hw_ncpu = sizeof(out_hw_ncpu); + int32_t len_hw_ncpu = sizeof(out_hw_ncpu); int result = ::sysctlbyname( "hw.physicalcpu", &out_hw_ncpu, &len_hw_ncpu, nullptr, 0); if (result == 0) return out_hw_ncpu; @@ -50,7 +50,7 @@ namespace { #if defined(OS_MACOSX) int out_hw_ncpu = 0; - size_t len_hw_ncpu = sizeof(out_hw_ncpu); + int32_t len_hw_ncpu = sizeof(out_hw_ncpu); int result = ::sysctlbyname( "hw.logicalcpu", &out_hw_ncpu, &len_hw_ncpu, nullptr, 0); if (result == 0) return out_hw_ncpu; diff --git a/src/engine/variable.cpp b/src/engine/variable.cpp index 574c344ce6..b597c842ce 100644 --- a/src/engine/variable.cpp +++ b/src/engine/variable.cpp @@ -90,7 +90,7 @@ void var_defines( struct module_t * module, const char * const * e, int preproce ) { LIST * l = L0; - size_t const len = strlen( val + 1 ); + int32_t const len = int32_t(strlen( val + 1 )); int const quoted = ( val[ 1 ] == '"' ) && ( val[ len ] == '"' ) && ( len > 1 ); diff --git a/src/engine/w32_getreg.cpp b/src/engine/w32_getreg.cpp index 9c83e212a2..4df13c04fb 100644 --- a/src/engine/w32_getreg.cpp +++ b/src/engine/w32_getreg.cpp @@ -81,14 +81,14 @@ LIST * builtin_system_registry( FRAME * frame, int flags ) case REG_EXPAND_SZ: { - unsigned long len; + DWORD len; string expanded[1]; string_new(expanded); while ( (len = ExpandEnvironmentStringsA( (LPCSTR)data, expanded->value, (DWORD)expanded->capacity)) - > expanded->capacity + > DWORD(expanded->capacity) ) string_reserve(expanded, len); From 84dae08aa072177a2c44488f9ffabbb63845858f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 9 Sep 2020 21:49:17 -0500 Subject: [PATCH 018/126] Fix outstanding 32/64 warnings on Linux gcc+clang. --- appveyor.yml | 2 +- azure-pipelines.yml | 24 +++--------------------- src/engine/debugger.cpp | 5 ++--- src/engine/execcmd.cpp | 4 ++-- src/engine/execcmd.h | 2 +- src/engine/function.cpp | 6 ++++-- src/engine/jam_strings.cpp | 4 ++-- src/engine/lists.cpp | 2 +- src/engine/make1.cpp | 4 ++-- src/engine/object.cpp | 28 ++++++++++++++-------------- 10 files changed, 32 insertions(+), 49 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4e175514b6..4ca454ca97 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,7 +55,7 @@ for: echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> NO WARNINGS" echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - src\engine\b2.exe --debug-configuration b2 warnings-as-errors=on toolset=%TEST_TOOLSET% + src\engine\b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=%TEST_TOOLSET% - cmd: | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BOOTSTRAP" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a520147ef7..0452dda6f9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -164,14 +164,8 @@ stages: set -e CXX_PATH=`which ${CXX}` echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} displayName: "No Warnings" - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} address-model=64 - displayName: "No-Warn 64bit" - bash: | set -e CXX_PATH=`which ${CXX}` @@ -216,14 +210,8 @@ stages: $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH $env:path += ';' + $env:CXX_PATH echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam - ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on toolset=$env:TEST_TOOLSET + ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET displayName: "No Warnings" - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam - ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on toolset=$env:TEST_TOOLSET address-model=64 - displayName: "No-Warn 64bit" - powershell: | $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH $env:path += ';' + $env:CXX_PATH @@ -323,14 +311,8 @@ stages: set -e CXX_PATH=`which ${CXX}` echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model,32,64 toolset=${TEST_TOOLSET} displayName: "No Warnings" - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on toolset=${TEST_TOOLSET} address-model=64 - displayName: "No-Warn 64bit" - bash: | set -e CXX_PATH=`which ${CXX}` diff --git a/src/engine/debugger.cpp b/src/engine/debugger.cpp index 3486c60c03..97eeb6f064 100644 --- a/src/engine/debugger.cpp +++ b/src/engine/debugger.cpp @@ -160,11 +160,10 @@ static LIST * debug_list_read( FILE * in ) { int len; int i; - int ch; LIST * result = L0; fscanf( in, "%d", &len ); - ch = fgetc( in ); - assert( ch == '\n' ); + int ch = fgetc( in ); + if (ch > 0) assert( ch == '\n' ); for ( i = 0; i < len; ++i ) { result = list_push_back( result, debug_object_read( in ) ); diff --git a/src/engine/execcmd.cpp b/src/engine/execcmd.cpp index b6c715171d..dfbd5a7f8a 100644 --- a/src/engine/execcmd.cpp +++ b/src/engine/execcmd.cpp @@ -41,9 +41,9 @@ static int intr; */ void argv_from_shell( char const * * argv, LIST * shell, char const * command, - int const slot ) + int32_t const slot ) { - static char jobno[ 4 ]; + static char jobno[ 12 ]; int i; int gotpercent = 0; diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index 206fb77883..fa24e432dc 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -91,7 +91,7 @@ void exec_wait(); * given shell list. */ void argv_from_shell( char const * * argv, LIST * shell, char const * command, - int const slot ); + int32_t const slot ); /* Interrupt routine bumping the internal interrupt counter. Needs to be * registered by platform specific exec*.c modules. diff --git a/src/engine/function.cpp b/src/engine/function.cpp index d8971471c1..357f331c37 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -3193,7 +3193,7 @@ void argument_list_push( struct arg_list * formal, int32_t formal_count, for ( j = 0; j < formal[ i ].size; ++j ) { struct argument * formal_arg = &formal[ i ].args[ j ]; - LIST * value; + LIST * value = L0; switch ( formal_arg->flags ) { @@ -3871,7 +3871,9 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) LIST * l; LIST * r; LIST * result = L0; +#ifndef NDEBUG void * saved_stack = s->data; +#endif PROFILE_ENTER_LOCAL(function_run); @@ -4250,8 +4252,8 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) backtrace( frame ); assert( saved_stack == s->data ); } -#endif assert( saved_stack == s->data ); +#endif debug_on_exit_function( function->base.rulename ); PROFILE_EXIT_LOCAL(function_run_INSTR_RETURN); PROFILE_EXIT_LOCAL(function_run); diff --git a/src/engine/jam_strings.cpp b/src/engine/jam_strings.cpp index b8511dd898..bee8e0bbf9 100644 --- a/src/engine/jam_strings.cpp +++ b/src/engine/jam_strings.cpp @@ -26,7 +26,7 @@ static void assert_invariants( string * self ) } assert( self->size < self->capacity ); - assert( ( self->capacity <= sizeof( self->opt ) ) == ( self->value == self->opt ) ); + assert( ( self->capacity <= int32_t(sizeof( self->opt )) ) == ( self->value == self->opt ) ); assert( self->value[ self->size ] == 0 ); /* String objects modified manually after construction to contain embedded * '\0' characters are considered structurally valid. @@ -198,7 +198,7 @@ void string_unit_test() for ( i = 0; i < limit; ++i ) { string_push_back( s, (char)( i + 1 ) ); - assert( s->size == i + 1 ); + assert( s->size == int32_t(i + 1) ); } assert( s->size == limit ); assert( s->value != s->opt ); diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index 36b1ca9505..d646c6e22c 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -365,7 +365,7 @@ LIST * list_unique( LIST * sorted_list ) void list_done() { - for ( int32_t i = 0; i < sizeof( freelist ) / sizeof( freelist[ 0 ] ); ++i ) + for ( int32_t i = 0; i < int32_t(sizeof( freelist ) / sizeof( freelist[ 0 ] )); ++i ) { LIST * l = freelist[ i ]; while ( l ) diff --git a/src/engine/make1.cpp b/src/engine/make1.cpp index 1e200d9ede..0e6e49e6d1 100644 --- a/src/engine/make1.cpp +++ b/src/engine/make1.cpp @@ -1065,11 +1065,11 @@ static void swap_settings static CMD * make1cmds( TARGET * t ) { CMD * cmds = 0; - CMD * last_cmd; + CMD * last_cmd = 0; LIST * shell = L0; module_t * settings_module = 0; TARGET * settings_target = 0; - ACTIONS * a0; + ACTIONS * a0 = 0; int32_t const running_flag = globs.noexec ? A_RUNNING_NOEXEC : A_RUNNING; /* Step through actions. diff --git a/src/engine/object.cpp b/src/engine/object.cpp index 332b457518..069bc215ed 100644 --- a/src/engine/object.cpp +++ b/src/engine/object.cpp @@ -229,20 +229,6 @@ static char const * string_set_insert( string_set * set, char const * string, } -static struct hash_item * object_get_item( OBJECT * obj ) -{ - return (struct hash_item *)( (char *)obj - offsetof( struct hash_item, data - ) ); -} - - -static void object_validate( OBJECT * obj ) -{ - assert( obj ); - assert( object_get_item( obj )->header.magic == OBJECT_MAGIC ); -} - - /* * object_new_range() - create an object from a string of given length */ @@ -283,6 +269,20 @@ OBJECT * object_new( char const * const string ) #ifndef object_copy +static struct hash_item * object_get_item( OBJECT * obj ) +{ + return (struct hash_item *)( (char *)obj - offsetof( struct hash_item, data + ) ); +} + + +static void object_validate( OBJECT * obj ) +{ + assert( obj ); + assert( object_get_item( obj )->header.magic == OBJECT_MAGIC ); +} + + /* * object_copy() - return a copy of an object */ From 4096b2d51c3ea6e52e506f8ead3f21a52563f9da Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 9 Sep 2020 22:43:10 -0500 Subject: [PATCH 019/126] Fix ignored return for fscanf. --- src/engine/debugger.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/debugger.cpp b/src/engine/debugger.cpp index 97eeb6f064..51a98ac8f9 100644 --- a/src/engine/debugger.cpp +++ b/src/engine/debugger.cpp @@ -161,12 +161,15 @@ static LIST * debug_list_read( FILE * in ) int len; int i; LIST * result = L0; - fscanf( in, "%d", &len ); - int ch = fgetc( in ); - if (ch > 0) assert( ch == '\n' ); - for ( i = 0; i < len; ++i ) + int ret = fscanf( in, "%d", &len ); + if (ret == 1) { - result = list_push_back( result, debug_object_read( in ) ); + int ch = fgetc( in ); + if (ch > 0) assert( ch == '\n' ); + for ( i = 0; i < len; ++i ) + { + result = list_push_back( result, debug_object_read( in ) ); + } } return result; } From fb078814e857fd8455427120ef68d8b9df49686c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 9 Sep 2020 22:58:32 -0500 Subject: [PATCH 020/126] Fix mac cpu queries. --- src/engine/sysinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/sysinfo.cpp b/src/engine/sysinfo.cpp index 779ce299e0..c3257e71e0 100644 --- a/src/engine/sysinfo.cpp +++ b/src/engine/sysinfo.cpp @@ -38,7 +38,7 @@ namespace { #if defined(OS_MACOSX) int out_hw_ncpu = 0; - int32_t len_hw_ncpu = sizeof(out_hw_ncpu); + size_t len_hw_ncpu = sizeof(out_hw_ncpu); int result = ::sysctlbyname( "hw.physicalcpu", &out_hw_ncpu, &len_hw_ncpu, nullptr, 0); if (result == 0) return out_hw_ncpu; @@ -50,7 +50,7 @@ namespace { #if defined(OS_MACOSX) int out_hw_ncpu = 0; - int32_t len_hw_ncpu = sizeof(out_hw_ncpu); + size_t len_hw_ncpu = sizeof(out_hw_ncpu); int result = ::sysctlbyname( "hw.logicalcpu", &out_hw_ncpu, &len_hw_ncpu, nullptr, 0); if (result == 0) return out_hw_ncpu; From a5a10d570d57844b257074b003c8498697042245 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 9 Sep 2020 23:39:06 -0500 Subject: [PATCH 021/126] Another round of warnings on 32/64+debug/release. --- src/engine/debugger.cpp | 2 +- src/engine/jam_strings.cpp | 4 ++-- src/engine/pathnt.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/debugger.cpp b/src/engine/debugger.cpp index 51a98ac8f9..f3b2f042da 100644 --- a/src/engine/debugger.cpp +++ b/src/engine/debugger.cpp @@ -774,7 +774,7 @@ static int get_module_filename( string * out ) DWORD result; string_reserve( out, 256 + 1 ); string_truncate( out, 256 ); - while( ( result = GetModuleFileNameA( NULL, out->value, DWORD(out->size) ) ) == out->size ) + while( ( result = GetModuleFileNameA( NULL, out->value, DWORD(out->size) ) ) == DWORD(out->size) ) { string_reserve( out, out->size * 2 + 1); string_truncate( out, out->size * 2 ); diff --git a/src/engine/jam_strings.cpp b/src/engine/jam_strings.cpp index bee8e0bbf9..b5aef5f1cd 100644 --- a/src/engine/jam_strings.cpp +++ b/src/engine/jam_strings.cpp @@ -200,7 +200,7 @@ void string_unit_test() string_push_back( s, (char)( i + 1 ) ); assert( s->size == int32_t(i + 1) ); } - assert( s->size == limit ); + assert( s->size == int32_t(limit) ); assert( s->value != s->opt ); for ( i = 0; i < limit; ++i ) assert( s->value[ i ] == (char)( i + 1 ) ); @@ -212,7 +212,7 @@ void string_unit_test() string copy[ 1 ]; string_copy( copy, original ); assert( !strcmp( copy->value, original ) ); - assert( copy->size == strlen( original ) ); + assert( copy->size == int32_t(strlen( original )) ); string_free( copy ); } diff --git a/src/engine/pathnt.cpp b/src/engine/pathnt.cpp index 5c35c40e46..cff639bc9f 100644 --- a/src/engine/pathnt.cpp +++ b/src/engine/pathnt.cpp @@ -394,8 +394,8 @@ OBJECT * path_as_key( OBJECT * path ) static void free_path_key_entry( void * xentry, void * const data ) { path_key_entry * const entry = (path_key_entry *)xentry; - object_free( entry->path ); - object_free( entry->key ); + if (entry->path) object_free( entry->path ); + if (entry->key) object_free( entry->key ); } From fff0aafffb18b09e901679d8ad08999dc26e161a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 9 Sep 2020 23:50:36 -0500 Subject: [PATCH 022/126] Fix bad arg on mac tests. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0452dda6f9..c8cafeacea 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -311,7 +311,7 @@ stages: set -e CXX_PATH=`which ${CXX}` echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model,32,64 toolset=${TEST_TOOLSET} + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} displayName: "No Warnings" - bash: | set -e From b086888dd8356bfec6f88611b2910a4889dc4019 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 10 Sep 2020 22:00:24 -0500 Subject: [PATCH 023/126] Reconcile warning on using BJAM_MALLOC for size_t. --- src/engine/debug.cpp | 2 +- src/engine/debug.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/debug.cpp b/src/engine/debug.cpp index dbdef4ef77..8fcf7e362e 100644 --- a/src/engine/debug.cpp +++ b/src/engine/debug.cpp @@ -73,7 +73,7 @@ void profile_enter( OBJECT * rulename, profile_frame * frame ) } -void profile_memory( int32_t mem ) +void profile_memory( size_t mem ) { if ( DEBUG_PROFILE ) if ( profile_stack && profile_stack->info ) diff --git a/src/engine/debug.h b/src/engine/debug.h index 7d9d10ee8a..20824577e3 100644 --- a/src/engine/debug.h +++ b/src/engine/debug.h @@ -45,7 +45,7 @@ typedef struct profile_frame profile_frame * profile_init( OBJECT * rulename, profile_frame * ); void profile_enter( OBJECT * rulename, profile_frame * ); -void profile_memory( int32_t mem ); +void profile_memory( size_t mem ); void profile_exit( profile_frame * ); void profile_dump(); double profile_clock(); From 088c4bce3d2216302194142b18494c38f3de2b2c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 10 Sep 2020 23:22:35 -0500 Subject: [PATCH 024/126] Provide for compilers with missing int32_t. --- src/engine/jam.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/engine/jam.h b/src/engine/jam.h index 984a4a41bb..f7825b7a80 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -436,6 +436,23 @@ #define OSPLAT "" #endif +/* + * Correct missing types in some earlier compilers. + */ +#include +#ifndef INT32_MIN +// VS 2013 is barely C++11/C99. And opts to not provide specific sized int types. +// Provide a generic implementation of the sizes we use. +#if UINT_MAX == 0xffffffff +typedef int int32_t; +#elif (USHRT_MAX == 0xffffffff) +typedef short int32_t; +#elif ULONG_MAX == 0xffffffff +typedef long int32_t; +# endif + +#endif + /* * Jam implementation misc. From 9188c2da73fb0ee39d91d1d4896a150574ac911c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 10 Sep 2020 23:35:00 -0500 Subject: [PATCH 025/126] Moce int32_t fix to config.h. Not all source include jam.h and hence don't get the int32_t patch. But everythign include config.h. So put the type patch there. --- src/engine/config.h | 17 +++++++++++++++++ src/engine/jam.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/engine/config.h b/src/engine/config.h index 9ff147d8e5..1df3501e5d 100644 --- a/src/engine/config.h +++ b/src/engine/config.h @@ -31,4 +31,21 @@ Distributed under the Boost Software License, Version 1.0. #endif #endif +// Correct missing types in some earlier compilers.. + +#include +#ifndef INT32_MIN + +// VS 2013 is barely C++11/C99. And opts to not provide specific sized int types. +// Provide a generic implementation of the sizes we use. +#if UINT_MAX == 0xffffffff +typedef int int32_t; +#elif (USHRT_MAX == 0xffffffff) +typedef short int32_t; +#elif ULONG_MAX == 0xffffffff +typedef long int32_t; +#endif + +#endif + #endif diff --git a/src/engine/jam.h b/src/engine/jam.h index f7825b7a80..984a4a41bb 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -436,23 +436,6 @@ #define OSPLAT "" #endif -/* - * Correct missing types in some earlier compilers. - */ -#include -#ifndef INT32_MIN -// VS 2013 is barely C++11/C99. And opts to not provide specific sized int types. -// Provide a generic implementation of the sizes we use. -#if UINT_MAX == 0xffffffff -typedef int int32_t; -#elif (USHRT_MAX == 0xffffffff) -typedef short int32_t; -#elif ULONG_MAX == 0xffffffff -typedef long int32_t; -# endif - -#endif - /* * Jam implementation misc. From 7abf398446f1774f30b3c10e5a1e2c656d89de63 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 11 Sep 2020 08:52:05 -0500 Subject: [PATCH 026/126] History note for 32/64 address-model engine build. --- doc/src/history.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/history.adoc b/doc/src/history.adoc index 9b1aa80a3c..f74ecef8de 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -9,6 +9,8 @@ -- _René Ferdinand Rivera Morell_ * Fix building engine with GCC on AIX. -- _René Ferdinand Rivera Morell_ +* Support building engine as either 32 or 64 bit addressing model. + -- _René Ferdinand Rivera Morell_ == Version 4.3.0 From b97746e29cb1f4dc4cfd02bb6191441dbc0d39d8 Mon Sep 17 00:00:00 2001 From: Ivan Melnikov Date: Fri, 11 Sep 2020 17:58:03 +0400 Subject: [PATCH 027/126] Fix detection of MIPS32 (#655) _ABI64 and _ABIO32 are always defined on every Linux MIPS system, at least if it's glibc-based: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/sgidefs.h;h=c9e00c6da53b1a13d83b4056f01ef5c30efe76ab The correct way to use them is to compare them against _MIPS_SIM symbol provided by the compiler. With this change, engine correctly detects 32-bit MIPS systems. Signed-off-by: Ivan A. Melnikov --- src/engine/jam.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/jam.h b/src/engine/jam.h index 984a4a41bb..25e5736fda 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -412,9 +412,9 @@ #endif #ifdef __mips__ - #if defined(_ABI64) + #if _MIPS_SIM == _MIPS_SIM_ABI64 #define OSPLAT "OSPLAT=MIPS64" - #elif defined(_ABIO32) + #elif _MIPS_SIM == _MIPS_SIM_ABI32 #define OSPLAT "OSPLAT=MIPS32" #endif #endif From ec318488307becbe97b16be593e2228f8ae5e21f Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Fri, 11 Sep 2020 22:14:12 +0300 Subject: [PATCH 028/126] Default MSVC to a native platform (#596) This also removes ambiguous implicit address-model ARM/ARM64 values. --- src/tools/msvc.jam | 62 ++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index bf07a93f9d..3b8ef06726 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -1998,27 +1998,47 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .versions = [ new configurations ] ; # Supported CPU architectures. -.cpu-arch-i386 = - / - /32 - x86/ - x86/32 ; - -.cpu-arch-amd64 = - /64 - x86/64 ; - -.cpu-arch-ia64 = - ia64/ - ia64/64 ; - -.cpu-arch-arm = - arm/ - arm/32 ; - -.cpu-arch-arm64 = - arm/ - arm/64 ; +.cpu-arch-info-i386 = x86 32 ; +.cpu-arch-info-amd64 = x86 64 ; +.cpu-arch-info-ia64 = ia64 64 ; +.cpu-arch-info-arm = arm 32 ; +.cpu-arch-info-arm64 = arm 64 ; + +# Fill explicit architecture and address model values +for local cpu in [ MATCH "^\\.cpu-arch-info-(.*)" : [ VARNAMES $(__name__) ] ] +{ + local arch = $(.cpu-arch-info-$(cpu)[1]) ; + .cpus-on-$(arch) += $(cpu) ; + .cpu-arch-$(cpu) = $(arch)/$(.cpu-arch-info-$(cpu)[2]) ; +} + +# Match implicit architecture and address model based on the current platform +.default-cpu-arch = [ os.environ PROCESSOR_ARCHITEW6432 ] ; +.default-cpu-arch ?= [ os.environ PROCESSOR_ARCHITECTURE ] ; +.default-cpu-arch = $(.default-cpu-arch:L) ; +switch $(.default-cpu-arch) +{ + case x86 : .default-cpu-arch = i386 ; + case em64t : .default-cpu-arch = amd64 ; +} + +for local cpu in $(.cpus-on-$(.cpu-arch-info-$(.default-cpu-arch)[1])) +{ + .cpu-arch-$(cpu) += /$(.cpu-arch-info-$(cpu)[2]) ; +} + +.cpu-arch-$(.default-cpu-arch) += $(.cpu-arch-info-$(.default-cpu-arch)[1])/ ; +.cpu-arch-$(.default-cpu-arch) += / ; + +# If there is only one address model for an architecture we allow to ommit it +for local arch in [ MATCH "^\\.cpus-on-(.*)" : [ VARNAMES $(__name__) ] ] +{ + if ! $(.cpus-on-$(arch)[2-]) && $(.cpus-on-$(arch)[1]) != $(.default-cpu-arch) + { + .cpu-arch-$(.cpus-on-$(arch)) += $(arch)/ ; + } +} + # Supported CPU types (only Itanium optimization options are supported from # VC++ 2005 on). See From 30bb04845eaa7e7fbe4f542f00139b980db995d6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 12 Sep 2020 09:13:44 -0500 Subject: [PATCH 029/126] Add missing compileflags feature. fixes #653 --- src/tools/features/compileflags-feature.jam | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/tools/features/compileflags-feature.jam diff --git a/src/tools/features/compileflags-feature.jam b/src/tools/features/compileflags-feature.jam new file mode 100644 index 0000000000..229bed730f --- /dev/null +++ b/src/tools/features/compileflags-feature.jam @@ -0,0 +1,19 @@ +# Copyright 2020 René Ferdinand Rivera Morell +# 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 feature ; + +#| tag::doc[] + +[[bbv2.builtin.features.compileflags]]`cflags`:: +The value of this feature is passed without modification to the corresponding +tools. The values from the `compileflags` is applied to all compilation of any +language for the tools. + +|# # end::doc[] + +feature.feature compileflags + : + : free ; From fdaedb3e38aba6482c393d61459d623aed39a9df Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 12 Sep 2020 22:24:55 -0500 Subject: [PATCH 030/126] Add latest compilers, and Boost versions. --- azure-pipelines.yml | 403 +++++++++----------------------------------- 1 file changed, 75 insertions(+), 328 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c8cafeacea..3a3d171714 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ # subject to 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) # -# Copyright Rene Rivera 2015-2019. +# Copyright Rene Rivera 2015-2020. trigger: branches: @@ -31,107 +31,29 @@ stages: vmImage: 'ubuntu-16.04' strategy: matrix: - GCC 9: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - GCC 8: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-8 - PACKAGES: g++-8 - GCC 7: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-7 - PACKAGES: g++-7 - GCC 6: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-6 - PACKAGES: g++-6 - GCC 5: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-5 - PACKAGES: g++-5 - GCC 4.9: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-4.9 - PACKAGES: g++-4.9 - GCC 4.8: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-4.8 - PACKAGES: g++-4.8 - GCC 4.7: - TOOLSET: gcc - TEST_TOOLSET: gcc - CXX: g++-4.7 - PACKAGES: g++-4.7 - Clang 9: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-9 - PACKAGES: clang-9 - LLVM_REPO: llvm-toolchain-xenial-9 - Clang 8: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-8 - PACKAGES: clang-8 - LLVM_REPO: llvm-toolchain-xenial-8 - Clang 7: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-7 - PACKAGES: clang-7 - LLVM_REPO: llvm-toolchain-xenial-7 - Clang 6: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-6.0 - PACKAGES: clang-6.0 - LLVM_REPO: llvm-toolchain-xenial-6.0 - Clang 5: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-5.0 - PACKAGES: clang-5.0 - LLVM_REPO: llvm-toolchain-xenial-5.0 - Clang 4: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-4.0 - PACKAGES: clang-4.0 - LLVM_REPO: llvm-toolchain-xenial-4.0 - Clang 3.9: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-3.9 - PACKAGES: clang-3.9 - Clang 3.8: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-3.8 - PACKAGES: clang-3.8 - Clang 3.7: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-3.7 - PACKAGES: clang-3.7 - Clang 3.6: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-3.6 - PACKAGES: clang-3.6 - Clang 3.5: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++-3.5 - PACKAGES: clang-3.5 + GCC 10: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10, VM_IMAGE: 'ubuntu-18.04'} + GCC 9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-9, PACKAGES: g++-9, VM_IMAGE: 'ubuntu-18.04'} + GCC 8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-8, PACKAGES: g++-8, VM_IMAGE: 'ubuntu-18.04'} + GCC 7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-7, PACKAGES: g++-7, VM_IMAGE: 'ubuntu-18.04'} + GCC 6: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-6, PACKAGES: g++-6, VM_IMAGE: 'ubuntu-18.04'} + GCC 5: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-5, PACKAGES: g++-5, VM_IMAGE: 'ubuntu-18.04'} + GCC 4.9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.9, PACKAGES: g++-4.9, VM_IMAGE: 'ubuntu-16.04'} + GCC 4.8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.8, PACKAGES: g++-4.8, VM_IMAGE: 'ubuntu-16.04'} + GCC 4.7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.7, PACKAGES: g++-4.7, VM_IMAGE: 'ubuntu-16.04'} + Clang 10: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_REPO: llvm-toolchain-bionic-10, VM_IMAGE: 'ubuntu-18.04'} + Clang 9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-9, PACKAGES: clang-9, LLVM_REPO: llvm-toolchain-bionic-9, VM_IMAGE: 'ubuntu-18.04'} + Clang 8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-8, PACKAGES: clang-8, LLVM_REPO: llvm-toolchain-bionic-8, VM_IMAGE: 'ubuntu-18.04'} + Clang 7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-7, PACKAGES: clang-7, LLVM_REPO: llvm-toolchain-bionic-7, VM_IMAGE: 'ubuntu-18.04'} + Clang 6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-6.0, PACKAGES: clang-6.0, LLVM_REPO: llvm-toolchain-bionic-6.0, VM_IMAGE: 'ubuntu-18.04'} + Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_REPO: llvm-toolchain-bionic-5.0, VM_IMAGE: 'ubuntu-18.04'} + Clang 4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-4.0, PACKAGES: clang-4.0, LLVM_REPO: llvm-toolchain-xenial-4.0, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.9, PACKAGES: clang-3.9, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.8, PACKAGES: clang-3.8, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.7, PACKAGES: clang-3.7, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.6, PACKAGES: clang-3.6, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.5, PACKAGES: clang-3.5, VM_IMAGE: 'ubuntu-16.04'} + pool: + vmImage: $(VM_IMAGE) steps: - bash: | set -e @@ -177,18 +99,9 @@ stages: - job: 'Windows' strategy: matrix: - VS 2019: - TOOLSET: vc142 - TEST_TOOLSET: msvc - VM_IMAGE: 'windows-2019' - VS 2017: - TOOLSET: vc141 - TEST_TOOLSET: msvc - VM_IMAGE: 'vs2017-win2016' - MinGW 8.1.0: - TOOLSET: mingw - TEST_TOOLSET: gcc - VM_IMAGE: 'vs2017-win2016' + VS 2019: {TOOLSET: vc142, TEST_TOOLSET: msvc, VM_IMAGE: 'windows-2019'} + VS 2017: {TOOLSET: vc141, TEST_TOOLSET: msvc, VM_IMAGE: 'vs2017-win2016'} + MinGW 8.1.0: {TOOLSET: mingw, TEST_TOOLSET: gcc, VM_IMAGE: 'vs2017-win2016'} pool: vmImage: $(VM_IMAGE) steps: @@ -223,66 +136,19 @@ stages: - job: 'macOS' strategy: matrix: - Xcode 11.4: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.4_beta.app - VM_IMAGE: 'macOS-10.15' - Xcode 11.3.1: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - VM_IMAGE: 'macOS-10.15' - Xcode 11.3: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.app - VM_IMAGE: 'macOS-10.15' - Xcode 11.2: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.2.app - VM_IMAGE: 'macOS-10.15' - Xcode 11.1: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.1.app - VM_IMAGE: 'macOS-10.15' - Xcode 11.0: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.app - VM_IMAGE: 'macOS-10.15' - Xcode 10.2.1: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_10.2.1.app - VM_IMAGE: 'macOS-10.14' - Xcode 10.2: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_10.2.app - VM_IMAGE: 'macOS-10.14' - Xcode 10.1: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_10.1.app - VM_IMAGE: 'macOS-10.14' - Xcode 10.0: - TOOLSET: clang - TEST_TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_10.app - VM_IMAGE: 'macOS-10.14' + Xcode 11.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.6.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.5.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.4.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.3.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.app, VM_IMAGE: 'macOS-10.15'} + Xcode 10.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.1.app, VM_IMAGE: 'macOS-10.14'} + Xcode 10.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.app, VM_IMAGE: 'macOS-10.14'} + Xcode 10.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.1.app, VM_IMAGE: 'macOS-10.14'} + Xcode 10.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.app, VM_IMAGE: 'macOS-10.14'} pool: vmImage: $(VM_IMAGE) steps: @@ -330,48 +196,15 @@ stages: vmImage: 'ubuntu-latest' strategy: matrix: - 1.72.0 .. GCC 9: - BOOST_VERSION: 1.72.0 - BOOST_VERSION_U: 1_72_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - 1.71.0 .. GCC 9: - BOOST_VERSION: 1.71.0 - BOOST_VERSION_U: 1_71_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - 1.70.0 .. GCC 9: - BOOST_VERSION: 1.70.0 - BOOST_VERSION_U: 1_70_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - 1.69.0 .. GCC 9: - BOOST_VERSION: 1.69.0 - BOOST_VERSION_U: 1_69_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - 1.68.0 .. GCC 9: - BOOST_VERSION: 1.68.0 - BOOST_VERSION_U: 1_68_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - 1.67.0 .. GCC 9: - BOOST_VERSION: 1.67.0 - BOOST_VERSION_U: 1_67_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - 1.66.0 .. GCC 9: - BOOST_VERSION: 1.66.0 - BOOST_VERSION_U: 1_66_0 - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 + 1.74.0 .. GCC 10: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.73.0 .. GCC 10: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.72.0 .. GCC 10: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.71.0 .. GCC 10: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.70.0 .. GCC 10: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.69.0 .. GCC 10: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.68.0 .. GCC 10: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.67.0 .. GCC 10: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.66.0 .. GCC 10: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} steps: - bash: | set -e @@ -407,28 +240,10 @@ stages: vmImage: 'ubuntu-latest' strategy: matrix: - Master .. GCC 9: - BOOST_BRANCH: master - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - Master .. Clang 8: - BOOST_BRANCH: master - TOOLSET: clang - CXX: clang++-8 - PACKAGES: clang-8 - LLVM_REPO: llvm-toolchain-xenial-8 - Develop .. GCC 9: - BOOST_BRANCH: develop - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - Develop .. Clang 8: - BOOST_BRANCH: develop - TOOLSET: clang - CXX: clang++-8 - PACKAGES: clang-8 - LLVM_REPO: llvm-toolchain-xenial-8 + Master .. GCC 10: {BOOST_BRANCH: master, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + Master .. Clang 10: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10 ,LLVM_REPO: llvm-toolchain-bionic-10} + Develop .. GCC 10: {BOOST_BRANCH: develop, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + Develop .. Clang 10: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_REPO: llvm-toolchain-bionic-10} steps: - bash: | set -e @@ -465,48 +280,15 @@ stages: vmImage: 'macOS-latest' strategy: matrix: - 1.72.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.72.0 - BOOST_VERSION_U: 1_72_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - 1.71.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.71.0 - BOOST_VERSION_U: 1_71_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - 1.70.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.70.0 - BOOST_VERSION_U: 1_70_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - 1.69.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.69.0 - BOOST_VERSION_U: 1_69_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - 1.68.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.68.0 - BOOST_VERSION_U: 1_68_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.2.app - 1.67.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.67.0 - BOOST_VERSION_U: 1_67_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - 1.66.0 .. Xcode 11.3.1: - BOOST_VERSION: 1.66.0 - BOOST_VERSION_U: 1_66_0 - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app + 1.74.0 .. Xcode 11.7: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.73.0 .. Xcode 11.7: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.72.0 .. Xcode 11.7: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.71.0 .. Xcode 11.7: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.70.0 .. Xcode 11.7: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.69.0 .. Xcode 11.7: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.68.0 .. Xcode 11.7: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.67.0 .. Xcode 11.7: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.66.0 .. Xcode 11.7: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} steps: - bash: | set -e @@ -537,16 +319,8 @@ stages: vmImage: 'macOS-latest' strategy: matrix: - Master .. Xcode 11.3.1: - BOOST_BRANCH: master - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app - Develop .. Xcode 11.3.1: - BOOST_BRANCH: develop - TOOLSET: clang - CXX: clang++ - XCODE_APP: /Applications/Xcode_11.3.1.app + Master .. Xcode 11.7: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + Develop .. Xcode 11.7: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} steps: - bash: | set -e @@ -578,38 +352,15 @@ stages: vmImage: 'windows-latest' strategy: matrix: - 1.73.0 .. VS 2019: - BOOST_VERSION: 1.73.0 - BOOST_VERSION_U: 1_73_0 - TOOLSET: vc142 - 1.72.0 .. VS 2019: - BOOST_VERSION: 1.72.0 - BOOST_VERSION_U: 1_72_0 - TOOLSET: vc142 - 1.71.0 .. VS 2019: - BOOST_VERSION: 1.71.0 - BOOST_VERSION_U: 1_71_0 - TOOLSET: vc142 - 1.70.0 .. VS 2019: - BOOST_VERSION: 1.70.0 - BOOST_VERSION_U: 1_70_0 - TOOLSET: vc142 - 1.69.0 .. VS 2019: - BOOST_VERSION: 1.69.0 - BOOST_VERSION_U: 1_69_0 - TOOLSET: vc142 - 1.68.0 .. VS 2019: - BOOST_VERSION: 1.68.0 - BOOST_VERSION_U: 1_68_0 - TOOLSET: vc142 - 1.67.0 .. VS 2019: - BOOST_VERSION: 1.67.0 - BOOST_VERSION_U: 1_67_0 - TOOLSET: vc142 - 1.66.0 .. VS 2019: - BOOST_VERSION: 1.66.0 - BOOST_VERSION_U: 1_66_0 - TOOLSET: vc142 + 1.74.0 .. VS 2019: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: vc142} + 1.73.0 .. VS 2019: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: vc142} + 1.72.0 .. VS 2019: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: vc142} + 1.71.0 .. VS 2019: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: vc142} + 1.70.0 .. VS 2019: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: vc142} + 1.69.0 .. VS 2019: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: vc142} + 1.68.0 .. VS 2019: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: vc142} + 1.67.0 .. VS 2019: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: vc142} + 1.66.0 .. VS 2019: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: vc142} steps: - powershell: | cd src/engine @@ -633,12 +384,8 @@ stages: vmImage: 'windows-latest' strategy: matrix: - Master .. VS 2019: - BOOST_BRANCH: master - TOOLSET: vc142 - Develop .. VS 2019: - BOOST_BRANCH: develop - TOOLSET: vc142 + Master .. VS 2019: {BOOST_BRANCH: master, TOOLSET: vc142} + Develop .. VS 2019: {BOOST_BRANCH: develop, TOOLSET: vc142} steps: - powershell: | cd src/engine From e3f2caf4b66eef6c9df0dec3d89e291b418020fb Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 12 Sep 2020 22:29:12 -0500 Subject: [PATCH 031/126] Fix duplicate yaml key. --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3a3d171714..dbd90bb74e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,8 +27,6 @@ stages: jobs: - job: 'Linux' - pool: - vmImage: 'ubuntu-16.04' strategy: matrix: GCC 10: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10, VM_IMAGE: 'ubuntu-18.04'} From 88a097097eded056d5ecba5bf8057c3596ca48d3 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 12 Sep 2020 23:32:28 -0500 Subject: [PATCH 032/126] Use CI Playground linux install script. --- .ci/linux-cxx-install.sh | 30 ++++++++++++++++++++++++++++++ azure-pipelines.yml | 14 +++++++------- 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100755 .ci/linux-cxx-install.sh diff --git a/.ci/linux-cxx-install.sh b/.ci/linux-cxx-install.sh new file mode 100755 index 0000000000..c92a333882 --- /dev/null +++ b/.ci/linux-cxx-install.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Usage: +# LLVM_OS: LLVM OS release to obtain clang binaries. Only needed for clang install. +# LLVM_VER: The LLVM toolset version to point the repo at. +# PACKAGES: Compiler packages to install. + +set -e +echo ">>>>>" +echo ">>>>> APT: REPO.." +echo ">>>>>" +sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" +if test -n "${LLVM_OS}" ; then + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main" +fi +echo ">>>>>" +echo ">>>>> APT: UPDATE.." +echo ">>>>>" +sudo -E apt-get -o Acquire::Retries=3 update +echo ">>>>>" +echo ">>>>> APT: INSTALL ${PACKAGES}.." +echo ">>>>>" +sudo -E apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} + +# Use, modification, and distribution are +# subject to the Boost Software License, Version 1.0. (See accompanying +# file LICENSE.txt) +# +# Copyright Rene Rivera 2020. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dbd90bb74e..baebc1cd81 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,13 +38,13 @@ stages: GCC 4.9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.9, PACKAGES: g++-4.9, VM_IMAGE: 'ubuntu-16.04'} GCC 4.8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.8, PACKAGES: g++-4.8, VM_IMAGE: 'ubuntu-16.04'} GCC 4.7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.7, PACKAGES: g++-4.7, VM_IMAGE: 'ubuntu-16.04'} - Clang 10: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_REPO: llvm-toolchain-bionic-10, VM_IMAGE: 'ubuntu-18.04'} - Clang 9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-9, PACKAGES: clang-9, LLVM_REPO: llvm-toolchain-bionic-9, VM_IMAGE: 'ubuntu-18.04'} - Clang 8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-8, PACKAGES: clang-8, LLVM_REPO: llvm-toolchain-bionic-8, VM_IMAGE: 'ubuntu-18.04'} - Clang 7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-7, PACKAGES: clang-7, LLVM_REPO: llvm-toolchain-bionic-7, VM_IMAGE: 'ubuntu-18.04'} - Clang 6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-6.0, PACKAGES: clang-6.0, LLVM_REPO: llvm-toolchain-bionic-6.0, VM_IMAGE: 'ubuntu-18.04'} - Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_REPO: llvm-toolchain-bionic-5.0, VM_IMAGE: 'ubuntu-18.04'} - Clang 4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-4.0, PACKAGES: clang-4.0, LLVM_REPO: llvm-toolchain-xenial-4.0, VM_IMAGE: 'ubuntu-16.04'} + Clang 10: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} + Clang 9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-9, PACKAGES: clang-9, LLVM_OS: bionic, LLVM_VER: 9, VM_IMAGE: 'ubuntu-18.04'} + Clang 8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-8, PACKAGES: clang-8, LLVM_OS: bionic, LLVM_VER: 8, VM_IMAGE: 'ubuntu-18.04'} + Clang 7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-7, PACKAGES: clang-7, LLVM_OS: bionic, LLVM_VER: 7, VM_IMAGE: 'ubuntu-18.04'} + Clang 6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-6.0, PACKAGES: clang-6.0, LLVM_OS: bionic, LLVM_VER: 6.0, VM_IMAGE: 'ubuntu-18.04'} + Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_OS: bionic, LLVM_VER: 5.0: 'ubuntu-18.04'} + Clang 4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-4.0, PACKAGES: clang-4.0, LLVM_OS: xenial, LLVM_VER: 4.0, VM_IMAGE: 'ubuntu-16.04'} Clang 3.9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.9, PACKAGES: clang-3.9, VM_IMAGE: 'ubuntu-16.04'} Clang 3.8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.8, PACKAGES: clang-3.8, VM_IMAGE: 'ubuntu-16.04'} Clang 3.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.7, PACKAGES: clang-3.7, VM_IMAGE: 'ubuntu-16.04'} From c31c3e2f3415d79235860cdac3d76dcb3f20bc44 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 12 Sep 2020 23:34:40 -0500 Subject: [PATCH 033/126] Fix accidental removal of yaml key. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index baebc1cd81..b4a8baa4be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,7 +43,7 @@ stages: Clang 8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-8, PACKAGES: clang-8, LLVM_OS: bionic, LLVM_VER: 8, VM_IMAGE: 'ubuntu-18.04'} Clang 7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-7, PACKAGES: clang-7, LLVM_OS: bionic, LLVM_VER: 7, VM_IMAGE: 'ubuntu-18.04'} Clang 6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-6.0, PACKAGES: clang-6.0, LLVM_OS: bionic, LLVM_VER: 6.0, VM_IMAGE: 'ubuntu-18.04'} - Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_OS: bionic, LLVM_VER: 5.0: 'ubuntu-18.04'} + Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_OS: bionic, LLVM_VER: 5.0, VM_IMAGE: 'ubuntu-18.04'} Clang 4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-4.0, PACKAGES: clang-4.0, LLVM_OS: xenial, LLVM_VER: 4.0, VM_IMAGE: 'ubuntu-16.04'} Clang 3.9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.9, PACKAGES: clang-3.9, VM_IMAGE: 'ubuntu-16.04'} Clang 3.8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.8, PACKAGES: clang-3.8, VM_IMAGE: 'ubuntu-16.04'} From 9140ce3c9a7244d231f3773942218c9f815c69ad Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Sep 2020 00:39:45 -0500 Subject: [PATCH 034/126] Really use ci playground script. --- azure-pipelines.yml | 152 +++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 85 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b4a8baa4be..8a48110e28 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,44 +54,38 @@ stages: vmImage: $(VM_IMAGE) steps: - bash: | - set -e - uname -a - sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - if test -n "${LLVM_REPO}" ; then - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo -E apt-add-repository "deb http://apt.llvm.org/xenial/ ${LLVM_REPO} main" - fi - sudo -E apt-get -o Acquire::Retries=3 update - sudo -E apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} + set -e + uname -a + ./.ci/linux-cxx-install.sh displayName: Install - bash: | - set -e - cd src/engine - set PATH=${PATH};${CXX_PATH} - ./build.sh ${TOOLSET} - ./b2 -v - cd ../.. + set -e + cd src/engine + set PATH=${PATH};${CXX_PATH} + ./build.sh ${TOOLSET} + ./b2 -v + cd ../.. displayName: Build - bash: | - set -e - CXX_PATH=`which ${CXX}` - cd test - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - python test_all.py ${TEST_TOOLSET} - cd .. + set -e + CXX_PATH=`which ${CXX}` + cd test + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + python test_all.py ${TEST_TOOLSET} + cd .. displayName: Test - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} displayName: "No Warnings" - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=./.b2 install ${TEST_TOOLSET} + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./bootstrap.sh ${TOOLSET} + ./b2 --prefix=./.b2 install ${TEST_TOOLSET} displayName: Bootstrap - job: 'Windows' @@ -104,31 +98,31 @@ stages: vmImage: $(VM_IMAGE) steps: - powershell: | - cd src/engine - $env:path += ';' + $env:CXX_PATH - cmd /c build.bat $env:TOOLSET - ./b2.exe -v - cd ../.. + cd src/engine + $env:path += ';' + $env:CXX_PATH + cmd /c build.bat $env:TOOLSET + ./b2.exe -v + cd ../.. displayName: Build - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - cd test - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam - python test_all.py $env:TEST_TOOLSET - cd .. + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + cd test + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + python test_all.py $env:TEST_TOOLSET + cd .. displayName: Test - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam - ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET displayName: "No Warnings" - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam - ./bootstrap.bat $env:TOOLSET - ./b2.exe --debug-configuration --prefix=./.b2 install toolset=$env:TEST_TOOLSET + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + ./bootstrap.bat $env:TOOLSET + ./b2.exe --debug-configuration --prefix=./.b2 install toolset=$env:TEST_TOOLSET displayName: Bootstrap - job: 'macOS' @@ -205,31 +199,25 @@ stages: 1.66.0 .. GCC 10: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} steps: - bash: | - set -e - uname -a - sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - if test -n "${LLVM_REPO}" ; then - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo -E apt-add-repository "deb http://apt.llvm.org/xenial/ ${LLVM_REPO} main" - fi - sudo -E apt-get -o Acquire::Retries=3 update - sudo -E apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} + set -e + uname -a + ./.ci/linux-cxx-install.sh displayName: Install - bash: | - set -e - cd src/engine - ./build.sh ${TOOLSET} - ./b2 -v + set -e + cd src/engine + ./build.sh ${TOOLSET} + ./b2 -v displayName: Build - bash: | - set -e - pushd ${HOME} - git clone -b boost-${BOOST_VERSION} --single-branch --recurse-submodules https://github.com/boostorg/boost.git boost_${BOOST_VERSION_U} - cd boost_${BOOST_VERSION_U} - CXX_PATH=`which ${CXX}` - echo "using ${TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - "${BUILD_SOURCESDIRECTORY}/src/engine/b2" "--boost-build=${BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=${TOOLSET} install - popd + set -e + pushd ${HOME} + git clone -b boost-${BOOST_VERSION} --single-branch --recurse-submodules https://github.com/boostorg/boost.git boost_${BOOST_VERSION_U} + cd boost_${BOOST_VERSION_U} + CXX_PATH=`which ${CXX}` + echo "using ${TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + "${BUILD_SOURCESDIRECTORY}/src/engine/b2" "--boost-build=${BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=${TOOLSET} install + popd displayName: Test - job: 'Dev_Linux' @@ -239,26 +227,20 @@ stages: strategy: matrix: Master .. GCC 10: {BOOST_BRANCH: master, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - Master .. Clang 10: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10 ,LLVM_REPO: llvm-toolchain-bionic-10} + Master .. Clang 10: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10} Develop .. GCC 10: {BOOST_BRANCH: develop, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - Develop .. Clang 10: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_REPO: llvm-toolchain-bionic-10} + Develop .. Clang 10: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10} steps: - bash: | - set -e - uname -a - sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - if test -n "${LLVM_REPO}" ; then - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo -E apt-add-repository "deb http://apt.llvm.org/xenial/ ${LLVM_REPO} main" - fi - sudo -E apt-get -o Acquire::Retries=3 update - sudo -E apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} + set -e + uname -a + ./.ci/linux-cxx-install.sh displayName: Install - bash: | - set -e - cd src/engine - ./build.sh ${TOOLSET} - ./b2 -v + set -e + cd src/engine + ./build.sh ${TOOLSET} + ./b2 -v displayName: Build - bash: | set -e From 2a7844ee3587fc6d55e09383bd93ccfd2e23a9b2 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Sep 2020 09:17:07 -0500 Subject: [PATCH 035/126] As we are using std lib we need exception handling in msvc. fixes #654 --- src/engine/config_toolset.bat | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/engine/config_toolset.bat b/src/engine/config_toolset.bat index 0a0a9b1097..00f5dbbe6e 100644 --- a/src/engine/config_toolset.bat +++ b/src/engine/config_toolset.bat @@ -34,7 +34,7 @@ call :Call_If_Exists "%B2_TOOLSET_ROOT%bin\VCVARS32.BAT" if not "_%B2_TOOLSET_ROOT%_" == "__" ( set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" ) -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof @@ -49,7 +49,7 @@ if NOT "_%B2_TOOLSET_ROOT%_" == "__" ( if "_%VCINSTALLDIR%_" == "__" ( set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" ) ) -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof @@ -68,7 +68,7 @@ if NOT "_%B2_TOOLSET_ROOT%_" == "__" ( if "_%VCINSTALLDIR%_" == "__" ( set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" ) ) -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof @@ -88,7 +88,7 @@ if NOT "_%B2_TOOLSET_ROOT%_" == "__" ( if "_%VCINSTALLDIR%_" == "__" ( set "PATH=%B2_TOOLSET_ROOT%bin;%PATH%" ) ) -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof @@ -110,7 +110,7 @@ REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\So pushd %CD% if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS% popd -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof @@ -132,7 +132,7 @@ REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\So pushd %CD% if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS% popd -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof @@ -154,7 +154,7 @@ REM return to current directory as vsdevcmd_end.bat switches to %USERPROFILE%\So pushd %CD% if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%B2_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %B2_BUILD_ARGS% popd -set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL" +set "B2_CXX=%CXX% /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc" set "B2_CXX_LINK=/link kernel32.lib advapi32.lib user32.lib" set "_known_=1" goto :eof From 37832aa3ebba6061d275c4afe746b7ad8f0313f5 Mon Sep 17 00:00:00 2001 From: EGuesnet <51407514+EGuesnet@users.noreply.github.com> Date: Thu, 17 Sep 2020 03:04:33 +0200 Subject: [PATCH 036/126] Erase -brtl for AIX (#628) --- src/tools/gcc.jam | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 1fb10e01ab..3d65128e5d 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -916,12 +916,6 @@ toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib # On AIX we *have* to use the native linker. # - # Using -brtl, the AIX linker will look for libraries with both the .a - # and .so extensions, such as libfoo.a and libfoo.so. Without -brtl, the - # AIX linker looks only for libfoo.a. Note that libfoo.a is an archived - # file that may contain shared objects and is different from static libs - # as on Linux. - # # The -bnoipath strips the prepending (relative) path of libraries from # the loader section in the target library or executable. Hence, during # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded @@ -939,7 +933,7 @@ toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib # AIX 4.x and AIX 6.x. For details about the AIX linker see: # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf # - toolset.flags gcc.link OPTIONS aix : -Wl,-brtl -Wl,-bnoipath -Wl,-bbigtoc ; + toolset.flags gcc.link OPTIONS aix : -Wl,-bnoipath -Wl,-bbigtoc ; # See note [1] toolset.flags gcc.link OPTIONS aix/static : -static ; From 602669783714e08ce2025ac10b1de35df7e18274 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 16 Sep 2020 22:28:46 -0500 Subject: [PATCH 037/126] Add Cirrus CI testing for FreeBSD. --- .cirrus.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 1 + 2 files changed, 45 insertions(+) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000000..d90f76c488 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,44 @@ +# Use, modification, and distribution are +# subject to the Boost Software License, Version 1.0. (See accompanying +# file LICENSE.txt) +# +# Copyright René Ferdinand Rivera Morell 2020. + +freebsd_task: + # All the GCC's and Clang's currently supported by FreeBSD ports. + matrix: + - { name: 'FreeBSD, GCC 11', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++11', PACKAGE: 'gcc11-devel' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, GCC 10', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++10', PACKAGE: 'gcc10-devel' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, GCC 9', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++9', PACKAGE: 'gcc9-devel' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, GCC 8', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++8', PACKAGE: 'gcc8-devel' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, GCC 7', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++7', PACKAGE: 'gcc7' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, Clang 10', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++10', PACKAGE: 'llvm10' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, Clang 9', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++90', PACKAGE: 'llvm90' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, Clang 8', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++80', PACKAGE: 'llvm80' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, Clang 7', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++70', PACKAGE: 'llvm70' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + - { name: 'FreeBSD, Clang 6', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++60', PACKAGE: 'llvm60' }, freebsd_instance: { image_family: 'freebsd-13-0-snap' } } + # To install with ports we need to initialize the package manager. To avoid + # confirmation prompts we need to set an env var. + install_script: [ + "uname -a", + "env ASSUME_ALWAYS_YES=YES pkg bootstrap", + "env ASSUME_ALWAYS_YES=YES pkg install ${PACKAGE}" + ] + # Build the engine. + build_script: [ + "set -e", + "cd src/engine", + "set PATH=${PATH};${CXX_PATH}", + "./build.sh ${TOOLSET}", + "./b2 -v", + "cd ../.." + ] + # Run the core tests. + test_script: [ + "set -e", + "CXX_PATH=`which ${CXX}`", + "cd test", + "echo \"using ${TEST_TOOLSET} : : ${CXX_PATH} ;\" > ${HOME}/user-config.jam", + "python2 test_all.py ${TEST_TOOLSET}", + "cd ..", + ] diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8a48110e28..e10e8ce88e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,6 +13,7 @@ trigger: paths: exclude: - appveyor.yml + - .cirrus.yml pr: branches: include: From add4dfcd4f79efb5d5b3039871f078c43a0ca2ad Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 17 Sep 2020 09:22:25 -0500 Subject: [PATCH 038/126] Fix for engine compile on FreeBSD. --- src/engine/jam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/jam.cpp b/src/engine/jam.cpp index 0af7c3d0ff..c419f1fa1e 100644 --- a/src/engine/jam.cpp +++ b/src/engine/jam.cpp @@ -743,7 +743,7 @@ char * executable_path( char const * argv0 ) { int mib[ 4 ] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; char buf[ 1024 ]; - int32_t size = sizeof( buf ); + size_t size = sizeof( buf ); sysctl( mib, 4, buf, &size, NULL, 0 ); return ( !size || size == sizeof( buf ) ) ? NULL : strndup( buf, size ); } From b762e4f74c40f95e3b5e4506a8c2134dd5919a2d Mon Sep 17 00:00:00 2001 From: "Michael G. Kazakov" Date: Thu, 24 Sep 2020 14:16:17 +0100 Subject: [PATCH 039/126] Added ASAN support on MSVC This change passes -fsanitize=address to the compiler and ensures synchronous pdb's generation. The linker is provided with corresponding libraries and is prohibited from incremental linking. Usage of address-sanitizer=on also assumes that debug-symbols=on and debug-store=database. --- src/tools/msvc.jam | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 3b8ef06726..260024d10d 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -227,6 +227,7 @@ import property-set ; import rc ; import sequence ; import set ; +import testing ; import toolset ; import type ; import virtual-target ; @@ -1880,6 +1881,10 @@ local rule register-toolset-really ( ) toolset.flags msvc.compile INCLUDES ; toolset.flags msvc.compile FORCE_INCLUDES ; + # Declare flags for the address sanitizer. + toolset.flags msvc.compile.c OPTIONS on : -fsanitize=address /FS ; + toolset.flags msvc.compile.c++ OPTIONS on : -fsanitize=address /FS ; + # Declare flags for the assembler. toolset.flags msvc.compile.asm USER_ASMFLAGS ; @@ -1918,6 +1923,20 @@ local rule register-toolset-really ( ) toolset.flags msvc.link LIBRARIES_MENTIONED_BY_FILE : ; toolset.flags msvc.link.dll LINKFLAGS true : /NOENTRY ; + + # Declare flags for the address sanitizer. + toolset.flags msvc.link OPTIONS on/64/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/64/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/32/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags msvc.link OPTIONS on/32/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; + toolset.flags msvc.link OPTIONS on/64/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/64/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/32/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags msvc.link OPTIONS on/32/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; + toolset.flags msvc.link.dll OPTIONS on/64/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags msvc.link.dll OPTIONS on/64/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-x86_64.lib" ; + toolset.flags msvc.link.dll OPTIONS on/32/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags msvc.link.dll OPTIONS on/32/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-i386.lib" ; } toolset.flags msvc.archive AROPTIONS ; From c6b74d0683c7209fb7cf6f18130b4371672ce21d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Sep 2020 09:01:23 -0500 Subject: [PATCH 040/126] Add missing BOOST_ROOT to boot strap search. When the Jambase got ported we lost also searching BOOST_ROOT for the bootstrap file. This is strictly a backward compatibility fix for Boost. fixes #622 --- src/engine/startup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/startup.cpp b/src/engine/startup.cpp index f58625408c..e7ab9438db 100644 --- a/src/engine/startup.cpp +++ b/src/engine/startup.cpp @@ -200,10 +200,12 @@ bool b2::startup::bootstrap(FRAME *frame) b2_file_path = path; } - // Check the BOOST_BUILD_PATH paths. + // Check the BOOST_BUILD_PATH (and BOOST_ROOT) paths. if (b2_file_path.empty()) { b2::jam::list BOOST_BUILD_PATH = b2::jam::variable{"BOOST_BUILD_PATH"}; + // For back-compat with Boost we also search in the BOOST_ROOT location. + BOOST_BUILD_PATH.append(b2::jam::list(b2::jam::variable{"BOOST_ROOT"})); for (auto search_path: BOOST_BUILD_PATH) { std::string path = b2::jam::object{search_path}; From 57f2b8602cf8f88b78c0036a792b2c506ff6eea1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Sep 2020 15:10:10 -0500 Subject: [PATCH 041/126] Extend tests to check bootstrap install. --- azure-pipelines.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e10e8ce88e..6bb008ec63 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -86,7 +86,11 @@ stages: CXX_PATH=`which ${CXX}` echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=./.b2 install ${TEST_TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + rm ./b2 + export PATH=$HOME/temp/.b2/bin:$PATH + b2 -b + b2 --help displayName: Bootstrap - job: 'Windows' @@ -123,7 +127,11 @@ stages: $env:path += ';' + $env:CXX_PATH echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam ./bootstrap.bat $env:TOOLSET - ./b2.exe --debug-configuration --prefix=./.b2 install toolset=$env:TEST_TOOLSET + ./b2.exe --debug-configuration --prefix=$env:HOME/temp/.b2 install toolset=$env:TEST_TOOLSET + Remove-Item ./b2.exe + $env:path += $env:HOME/temp/.b2/bin ';' + $env:PATH + b2 -v + b2 --help displayName: Bootstrap - job: 'macOS' @@ -177,7 +185,11 @@ stages: CXX_PATH=`which ${CXX}` echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=./.b2 install ${TEST_TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + rm ./b2 + export PATH=$HOME/temp/.b2/bin:$PATH + b2 -b + b2 --help displayName: Bootstrap - stage: Boost From f3e0a4d14af6d2ad8d404c4852528ade1ad32e81 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Sep 2020 15:36:18 -0500 Subject: [PATCH 042/126] Fix some (power)shell syntax. --- azure-pipelines.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6bb008ec63..bdda3deb25 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -89,8 +89,8 @@ stages: ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH - b2 -b - b2 --help + b2 -v + b2 -n --debug-configuration displayName: Bootstrap - job: 'Windows' @@ -112,26 +112,26 @@ stages: - powershell: | $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH cd test - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam python test_all.py $env:TEST_TOOLSET cd .. displayName: Test - powershell: | $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET displayName: "No Warnings" - powershell: | $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > $env:HOME/user-config.jam + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam ./bootstrap.bat $env:TOOLSET - ./b2.exe --debug-configuration --prefix=$env:HOME/temp/.b2 install toolset=$env:TEST_TOOLSET + ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET Remove-Item ./b2.exe - $env:path += $env:HOME/temp/.b2/bin ';' + $env:PATH + $env:path += ${env:HOME}/temp/.b2/bin ';' + $env:PATH b2 -v - b2 --help + b2 -n --debug-configuration displayName: Bootstrap - job: 'macOS' @@ -188,8 +188,8 @@ stages: ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH - b2 -b - b2 --help + b2 -v + b2 -n --debug-configuration displayName: Bootstrap - stage: Boost From 1f352e0d14ee0561bde1f8ed3eaa8519ee758d98 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Sep 2020 16:36:26 -0500 Subject: [PATCH 043/126] Another powershell syntax issue fixed. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bdda3deb25..63a4998429 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -129,7 +129,7 @@ stages: ./bootstrap.bat $env:TOOLSET ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET Remove-Item ./b2.exe - $env:path += ${env:HOME}/temp/.b2/bin ';' + $env:PATH + $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH b2 -v b2 -n --debug-configuration displayName: Bootstrap From b29603fa88a614835359168e70b5a44eae8e642c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Sep 2020 18:02:59 -0500 Subject: [PATCH 044/126] Fix path to bootstrap for back compat. fixes #650 --- azure-pipelines.yml | 3 +++ src/engine/startup.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 63a4998429..f7719d8bb9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -89,6 +89,7 @@ stages: ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH + cd $HOME b2 -v b2 -n --debug-configuration displayName: Bootstrap @@ -130,6 +131,7 @@ stages: ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET Remove-Item ./b2.exe $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH + cd $env:HOME b2 -v b2 -n --debug-configuration displayName: Bootstrap @@ -188,6 +190,7 @@ stages: ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH + cd $HOME b2 -v b2 -n --debug-configuration displayName: Bootstrap diff --git a/src/engine/startup.cpp b/src/engine/startup.cpp index e7ab9438db..d21f27af6a 100644 --- a/src/engine/startup.cpp +++ b/src/engine/startup.cpp @@ -195,7 +195,7 @@ bool b2::startup::bootstrap(FRAME *frame) { const std::string path{ b2::paths::normalize( - b2_exe_path + "/../../share/boost-build/" + boost_build_jam)}; + b2_exe_path + "/../../share/boost-build/src/kernel/" + boost_build_jam)}; if (b2::filesys::is_file(path)) b2_file_path = path; } From 2f7f2922e372e7a172275be593e370c5ce087919 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 27 Sep 2020 12:24:37 -0500 Subject: [PATCH 045/126] Create empty build file to check if install works. --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f7719d8bb9..560d376b4b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,6 +90,7 @@ stages: rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH cd $HOME + touch build.jam b2 -v b2 -n --debug-configuration displayName: Bootstrap @@ -132,6 +133,7 @@ stages: Remove-Item ./b2.exe $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH cd $env:HOME + echo $null >> build.jam b2 -v b2 -n --debug-configuration displayName: Bootstrap @@ -191,6 +193,7 @@ stages: rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH cd $HOME + touch build.jam b2 -v b2 -n --debug-configuration displayName: Bootstrap From 0b06096db752367ec30fd4d7f5f6df71561b13cc Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Sun, 11 Oct 2020 18:15:36 +0200 Subject: [PATCH 046/126] Fix encoding in copyright headers. (#662) --- src/tools/quickbook.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/quickbook.jam b/src/tools/quickbook.jam index 9870e9e41d..72c8e609aa 100644 --- a/src/tools/quickbook.jam +++ b/src/tools/quickbook.jam @@ -1,5 +1,5 @@ # -# Copyright (c) 2005 João Abecasis +# Copyright (c) 2005 João Abecasis # Copyright (c) 2005 Vladimir Prus # Copyright (c) 2006 Rene Rivera # From 482c25f3a26171073c7e6c59f0427f2259a63fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Thu, 22 Oct 2020 21:04:49 -0500 Subject: [PATCH 047/126] Minor fix for py3 compat. --- test/TestCmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TestCmd.py b/test/TestCmd.py index 7b53e9f403..1a9907a7f9 100644 --- a/test/TestCmd.py +++ b/test/TestCmd.py @@ -362,7 +362,7 @@ def preserve(self, *conditions): directories to be preserved for all conditions. """ - if conditions is (): + if conditions == (): conditions = ('pass_test', 'fail_test', 'no_result') for cond in conditions: self._preserve[cond] = 1 From aea65c9c7a2303cbb40906e1d093728e52506a0d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 14 Nov 2020 17:12:53 -0600 Subject: [PATCH 048/126] Update xcode test versions on AZP. --- azure-pipelines.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 560d376b4b..be9086f384 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -147,9 +147,7 @@ stages: Xcode 11.4.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} Xcode 11.3.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} Xcode 11.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.1.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'} Xcode 10.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.1.app, VM_IMAGE: 'macOS-10.14'} Xcode 10.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.app, VM_IMAGE: 'macOS-10.14'} Xcode 10.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.1.app, VM_IMAGE: 'macOS-10.14'} From 550f99c84634539243e70931fb41a59b38743992 Mon Sep 17 00:00:00 2001 From: Miroslaw Stein Date: Sun, 15 Nov 2020 04:22:19 +0100 Subject: [PATCH 049/126] Fix memory leak in startup::bootstrap (boostorg#668) (#669) The executable_path allocates a string (strdup) which was never released Tested with ASAN and valgrind Co-authored-by: Miroslaw Stein --- src/engine/startup.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/startup.cpp b/src/engine/startup.cpp index d21f27af6a..64738a13c5 100644 --- a/src/engine/startup.cpp +++ b/src/engine/startup.cpp @@ -155,7 +155,12 @@ bool b2::startup::bootstrap(FRAME *frame) } } - const std::string b2_exe_path{executable_path(saved_argv0)}; + char *b2_exe_path_pchar = executable_path(saved_argv0); + const std::string b2_exe_path{b2_exe_path_pchar}; + if (b2_exe_path_pchar) + { + free(b2_exe_path_pchar); + } const std::string boost_build_jam{"boost-build.jam"}; std::string b2_file_path; From d001c81fee5167340bfc7e46ca5701626bd2786e Mon Sep 17 00:00:00 2001 From: "Michael G. Kazakov" Date: Tue, 17 Nov 2020 11:51:34 +0000 Subject: [PATCH 050/126] moved ASAN-related definitions under a version check --- src/tools/msvc.jam | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 260024d10d..21011952c3 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -485,6 +485,29 @@ rule configure-version-specific ( toolset : version : conditions ) toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:throwingNew" ; } + # 14.27 (VS2019 Version 16.7) introduced support for ASAN on x86 and x64 CPUs + # This check however now only tests for 14.2 (which is 16.0) as msvc.jam doesn't distinguish between minor versions (e.g. 14.21..14.28 etc) + if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 2 ] + { + # Declare flags for the address sanitizer. + toolset.flags msvc.compile.c OPTIONS on : /fsanitize=address /FS ; + toolset.flags msvc.compile.c++ OPTIONS on : /fsanitize=address /FS ; + + # Declare flags for the address sanitizer. + toolset.flags msvc.link OPTIONS on/64/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/64/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/32/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags msvc.link OPTIONS on/32/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; + toolset.flags msvc.link OPTIONS on/64/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/64/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; + toolset.flags msvc.link OPTIONS on/32/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags msvc.link OPTIONS on/32/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; + toolset.flags msvc.link.dll OPTIONS on/64/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags msvc.link.dll OPTIONS on/64/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-x86_64.lib" ; + toolset.flags msvc.link.dll OPTIONS on/32/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags msvc.link.dll OPTIONS on/32/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-i386.lib" ; + } + # # Processor-specific optimization. # @@ -1881,10 +1904,6 @@ local rule register-toolset-really ( ) toolset.flags msvc.compile INCLUDES ; toolset.flags msvc.compile FORCE_INCLUDES ; - # Declare flags for the address sanitizer. - toolset.flags msvc.compile.c OPTIONS on : -fsanitize=address /FS ; - toolset.flags msvc.compile.c++ OPTIONS on : -fsanitize=address /FS ; - # Declare flags for the assembler. toolset.flags msvc.compile.asm USER_ASMFLAGS ; @@ -1923,20 +1942,6 @@ local rule register-toolset-really ( ) toolset.flags msvc.link LIBRARIES_MENTIONED_BY_FILE : ; toolset.flags msvc.link.dll LINKFLAGS true : /NOENTRY ; - - # Declare flags for the address sanitizer. - toolset.flags msvc.link OPTIONS on/64/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/64/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/32/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; - toolset.flags msvc.link OPTIONS on/32/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; - toolset.flags msvc.link OPTIONS on/64/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/64/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/32/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; - toolset.flags msvc.link OPTIONS on/32/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; - toolset.flags msvc.link.dll OPTIONS on/64/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; - toolset.flags msvc.link.dll OPTIONS on/64/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-x86_64.lib" ; - toolset.flags msvc.link.dll OPTIONS on/32/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; - toolset.flags msvc.link.dll OPTIONS on/32/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-i386.lib" ; } toolset.flags msvc.archive AROPTIONS ; From 5a7c36c8b5b08ca459ab8078eba1ece0b02f1715 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 22 Nov 2020 17:49:19 +0300 Subject: [PATCH 051/126] Added missing include stdlib.h. (#672) The header is needed for free(). Fixes https://github.com/boostorg/build/issues/671. --- src/engine/builtins.cpp | 1 + src/engine/startup.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/engine/builtins.cpp b/src/engine/builtins.cpp index 2f6ff22176..86706a65b1 100644 --- a/src/engine/builtins.cpp +++ b/src/engine/builtins.cpp @@ -30,6 +30,7 @@ #include "output.h" #include +#include #ifdef OS_NT #include diff --git a/src/engine/startup.cpp b/src/engine/startup.cpp index 64738a13c5..de0a4fec60 100644 --- a/src/engine/startup.cpp +++ b/src/engine/startup.cpp @@ -14,6 +14,7 @@ Distributed under the Boost Software License, Version 1.0. #include "output.h" #include "variable.h" +#include #include #include From 003a3c29c12427c5a424f2332aa4ba00a8554a88 Mon Sep 17 00:00:00 2001 From: Basil Fierz Date: Wed, 25 Nov 2020 00:04:10 +0100 Subject: [PATCH 052/126] Adapt for Emscripten 2.0 change of default behaviour for archives (#674) When building archives Emscripten 2.0 requires the usage of the `-r` in order to create an archive and not link an executable. --- src/tools/emscripten.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/emscripten.jam b/src/tools/emscripten.jam index a125760706..0a765765bb 100644 --- a/src/tools/emscripten.jam +++ b/src/tools/emscripten.jam @@ -94,7 +94,7 @@ actions compile.c++ actions archive { - "$(CONFIG_COMMAND)" $(AROPTIONS) -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" $(AROPTIONS) -r -o "$(<)" "$(>)" } toolset.flags emscripten.link USER_OPTIONS ; From 495b7ee9970787319dad6c70707ee8f4f18363e8 Mon Sep 17 00:00:00 2001 From: Tanzinul Islam <11808226+tanzislam@users.noreply.github.com> Date: Wed, 2 Dec 2020 15:44:47 +0000 Subject: [PATCH 053/126] Ensure Embarcadero toolset name is only "embtc" (#675) * Ensure Embarcadero toolset name is only "bcb" This brings uniformity with the `borland` toolset. There is no danger of mixing object files compiled with both the classic and Clang-based compilers, as the linker now [warns about it][1]. This change, along with boostorg/config#346, fixes the expected library names in a versioned-layout build. [1]: https://blogs.embarcadero.com/issues-mixing-classic-and-clang-objects-linker-warnings-improving-app-stability/ * Change toolset name to embtc --- src/tools/common.jam | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tools/common.jam b/src/tools/common.jam index d5b17f816c..28c768d562 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -929,6 +929,7 @@ local rule toolset-tag ( name : type ? : property-set ) case cw : tag += cw ; case darwin* : tag += xgcc ; case edg* : tag += edg ; + case embarcadero* : tag += embtc ; case gcc* : { switch [ $(property-set).get ] @@ -999,6 +1000,13 @@ local rule toolset-tag ( name : type ? : property-set ) version = ; } + # Use un-versioned toolset name for Embarcadero, to avoid having to update + # the auto-linking logic on every release. + if $(tag) = embtc + { + version = ; + } + tag += $(version) ; return $(tag:J=) ; From e206f0d6026ced853e90ab645b807c8d3ed3dfb8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Dec 2020 21:30:03 -0600 Subject: [PATCH 054/126] Initial implementation of dynamic response files. This implements the ability for response file "@()" substitution to dynamically adjust to either expand the content or create the response file depending on the possible command line length. This should reduce the create of such response temp files improving build performance. --- src/engine/constants.cpp | 7 + src/engine/constants.h | 2 + src/engine/execcmd.h | 4 + src/engine/execnt.cpp | 7 +- src/engine/execunix.cpp | 7 +- src/engine/execvms.cpp | 7 +- src/engine/function.cpp | 563 ++++++++++------ src/engine/jamgram.cpp | 667 +++++++------------ src/engine/jamgram.hpp | 2 +- src/tools/clang-linux.jam | 88 +-- src/tools/features/response-file-feature.jam | 26 + src/tools/gcc.jam | 8 +- test/core_at_file.py | 16 +- test/toolset-mock/src/MockProgram.py | 12 + test/toolset-mock/src/ar.py | 2 + test/toolset-mock/src/clang-linux-3.9.0.py | 72 +- test/toolset-mock/src/ranlib.py | 2 + test/toolset_clang_linux.py | 9 + 18 files changed, 784 insertions(+), 717 deletions(-) create mode 100644 src/tools/features/response-file-feature.jam diff --git a/src/engine/constants.cpp b/src/engine/constants.cpp index ce4e3d7e47..c64ea3b634 100644 --- a/src/engine/constants.cpp +++ b/src/engine/constants.cpp @@ -1,5 +1,6 @@ /* * Copyright 2011 Steven Watanabe + * Copyright 2020 René Ferdinand Rivera Morell * * This file is part of Jam - see jam.c for Copyright information. */ @@ -74,6 +75,8 @@ void constants_init( void ) constant_MAIN_PYTHON = object_new( "MAIN_PYTHON" ); constant_BUILTIN_GLOB_ARCHIVE_BACK= object_new( "BUILTIN_GLOB_ARCHIVE_BACK" ); constant_FILE_ARCHIVESCAN = object_new( "FILE_ARCHIVESCAN" ); + + constant_RESPONSE_FILE_SUB = object_new( "RESPONSE_FILE_SUB" ); } void constants_done( void ) @@ -133,6 +136,8 @@ void constants_done( void ) object_free( constant_MAIN_PYTHON ); object_free( constant_FILE_ARCHIVESCAN ); object_free( constant_BUILTIN_GLOB_ARCHIVE_BACK ); + + object_free( constant_RESPONSE_FILE_SUB ); } OBJECT * constant_empty; @@ -190,3 +195,5 @@ OBJECT * constant_extra_pythonpath; OBJECT * constant_MAIN_PYTHON; OBJECT * constant_FILE_ARCHIVESCAN; OBJECT * constant_BUILTIN_GLOB_ARCHIVE_BACK; + +OBJECT * constant_RESPONSE_FILE_SUB; diff --git a/src/engine/constants.h b/src/engine/constants.h index ec112080d6..675b665791 100644 --- a/src/engine/constants.h +++ b/src/engine/constants.h @@ -73,4 +73,6 @@ extern OBJECT * constant_MAIN_PYTHON; /* "MAIN_PYTHON" */ extern OBJECT * constant_FILE_ARCHIVESCAN; /* "FILE_ARCHIVESCAN" */ extern OBJECT * constant_BUILTIN_GLOB_ARCHIVE_BACK; /* "BUILTIN_GLOB_ARCHIVE_BACK" */ +extern OBJECT * constant_RESPONSE_FILE_SUB; // "RESPONSE_FILE_SUB" + #endif diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index fa24e432dc..293822b308 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -112,4 +112,8 @@ int is_raw_command_request( LIST * shell ); int check_cmd_for_too_long_lines( char const * command, int32_t max, int32_t * const error_length, int32_t * const error_max_length ); +/* Maximum shell command line length. + */ +int32_t shell_maxline(); + #endif diff --git a/src/engine/execnt.cpp b/src/engine/execnt.cpp index be0a57a9b9..e365d73965 100644 --- a/src/engine/execnt.cpp +++ b/src/engine/execnt.cpp @@ -318,7 +318,7 @@ int32_t exec_check */ /* Check for too long command lines. */ - return check_cmd_for_too_long_lines( command->value, maxline(), + return check_cmd_for_too_long_lines( command->value, shell_maxline(), error_length, error_max_length ); } @@ -1376,5 +1376,10 @@ static void reportWindowsError( char const * const apiName, int32_t slot ) string_renew( cmdtab[ slot ].buffer_err ); } +int32_t shell_maxline() +{ + return maxline(); +} + #endif /* USE_EXECNT */ diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index 9b6ee0fc9e..5cd5139ff1 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -154,7 +154,7 @@ int exec_check return is_raw_cmd ? EXEC_CHECK_OK - : check_cmd_for_too_long_lines( command->value, MAXLINE, error_length, + : check_cmd_for_too_long_lines( command->value, shell_maxline(), error_length, error_max_length ); } @@ -603,4 +603,9 @@ static int get_free_cmdtab_slot() exit( EXITBAD ); } +int32_t shell_maxline() +{ + return MAXLINE; +} + # endif /* USE_EXECUNIX */ diff --git a/src/engine/execvms.cpp b/src/engine/execvms.cpp index e5a12bc62a..2c516326c2 100644 --- a/src/engine/execvms.cpp +++ b/src/engine/execvms.cpp @@ -89,7 +89,7 @@ int exec_check return is_raw_cmd ? EXEC_CHECK_OK - : check_cmd_for_too_long_lines( command->value, MAXLINE, error_length, + : check_cmd_for_too_long_lines( command->value, shell_maxline(), error_length, error_max_length ); } @@ -415,6 +415,11 @@ clock_t get_cpu_time() return result; } +int32_t shell_maxline() +{ + return MAXLINE; +} + # endif /* VMS */ diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 357f331c37..101fd1a139 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -13,6 +13,7 @@ #include "compile.h" #include "constants.h" #include "debugger.h" +#include "execcmd.h" #include "filesys.h" #include "frames.h" #include "lists.h" @@ -29,6 +30,8 @@ #include #include +#include + /* #define FUNCTION_DEBUG_PROFILE */ @@ -628,9 +631,17 @@ typedef struct char to_windows; /* :W -- convert cygwin to native paths */ PATHPART empty; /* :E -- default for empties */ PATHPART join; /* :J -- join list with char */ + PATHPART prefix; /* :< */ + PATHPART postfix; /* :> */ } VAR_EDITS; -static LIST * apply_modifiers_impl( LIST * result, string * buf, +struct VAR_EXPANDED +{ + LIST * value = L0; + LIST * inner = L0; +}; + +static VAR_EXPANDED apply_modifiers_impl( LIST * result, string * buf, VAR_EDITS * edits, int32_t n, LISTITER iter, LISTITER end ); static void get_iters( subscript_t const subscript, LISTITER * const first, LISTITER * const last, int32_t const length ); @@ -693,6 +704,8 @@ static int32_t var_edit_parse( char const * mods, VAR_EDITS * edits, int32_t hav case 'M': fp = &edits->f.f_member; goto fileval; case 'T': edits->to_slashes = 1; continue; case 'W': edits->to_windows = 1; continue; + case '<': fp = &edits->prefix; goto strval; + case '>': fp = &edits->postfix; goto strval; default: continue; /* Should complain, but so what... */ } @@ -873,19 +886,37 @@ static int32_t expand_modifiers( STACK * s, int32_t n ) return total; } -static LIST * apply_modifiers( STACK * s, int32_t n ) +static VAR_EXPANDED apply_modifiers( STACK * s, int32_t n ) { LIST * value = stack_top( s ); - LIST * result = L0; + VAR_EXPANDED result; VAR_EDITS * const edits = (VAR_EDITS *)( (LIST * *)stack_get( s ) + 1 ); string buf[ 1 ]; string_new( buf ); - result = apply_modifiers_impl( result, buf, edits, n, list_begin( value ), + result = apply_modifiers_impl( L0, buf, edits, n, list_begin( value ), list_end( value ) ); string_free( buf ); return result; } +// STACK: LIST * modifiers[modifier_count] +static VAR_EXPANDED eval_modifiers( STACK * s, LIST * value, int32_t modifier_count ) +{ + // Convert modifiers to value edits. + int32_t edits = expand_modifiers( s, modifier_count ); + // Edit the value on the stack. + stack_push( s, value ); + VAR_EXPANDED result = apply_modifiers( s, edits ); + list_free( stack_pop( s ) ); + // Clean up the value edits on the stack. + stack_deallocate( s, edits * sizeof( VAR_EDITS ) ); + // Clean up the filename modifiers. + for ( int32_t i = 0; i < modifier_count; ++i ) + list_free( stack_pop( s ) ); + // Done. + return result; +} + /* * Parse a string of the form "1-2", "-2--1", "2-" and return the two @@ -1027,6 +1058,32 @@ static void get_iters( subscript_t const subscript, LISTITER * const first, *last = end; } +static LIST * apply_modifiers_prepost( LIST * result, string * buf, + VAR_EDITS * edits, int32_t n, LISTITER begin, LISTITER end ) +{ + for ( LISTITER iter = begin; iter != end; iter = list_next( iter ) ) + { + for ( int32_t i = 0; i < n; ++i ) + { + if ( edits[ i ].prefix.ptr ) + { + string_append( buf, edits[ i ].prefix.ptr ); + } + } + string_append( buf, object_str( list_item( iter ) ) ); + for ( int32_t i = 0; i < n; ++i ) + { + if ( edits[ i ].postfix.ptr ) + { + string_append( buf, edits[ i ].postfix.ptr ); + } + } + result = list_push_back( result, object_new( buf->value ) ); + string_truncate( buf, 0 ); + } + return result; +} + static LIST * apply_modifiers_empty( LIST * result, string * buf, VAR_EDITS * edits, int32_t n ) { @@ -1083,12 +1140,17 @@ static LIST * apply_modifiers_non_empty( LIST * result, string * buf, return result; } -static LIST * apply_modifiers_impl( LIST * result, string * buf, +static VAR_EXPANDED apply_modifiers_impl( LIST * result, string * buf, VAR_EDITS * edits, int32_t n, LISTITER iter, LISTITER end ) { - return iter == end + LIST * modified = iter == end ? apply_modifiers_empty( result, buf, edits, n ) : apply_modifiers_non_empty( result, buf, edits, n, iter, end ); + VAR_EXPANDED expanded; + expanded.value = apply_modifiers_prepost( + L0, buf, edits, n, list_begin( modified ), list_end( modified ) ); + expanded.inner = modified; + return expanded; } static LIST * apply_subscript_and_modifiers( STACK * s, int32_t n ) @@ -1110,7 +1172,10 @@ static LIST * apply_subscript_and_modifiers( STACK * s, int32_t n ) subscript_t const sub = parse_subscript( object_str( list_item( indices_iter ) ) ); get_iters( sub, &iter, &end, length ); - result = apply_modifiers_impl( result, buf, edits, n, iter, end ); + VAR_EXPANDED modified + = apply_modifiers_impl( result, buf, edits, n, iter, end ); + result = modified.value; + list_free( modified.inner ); } string_free( buf ); return result; @@ -1256,6 +1321,7 @@ struct dynamic_array { int32_t size; int32_t capacity; + int32_t unit_size; void * data; }; @@ -1263,6 +1329,7 @@ static void dynamic_array_init( struct dynamic_array * array ) { array->size = 0; array->capacity = 0; + array->unit_size = 0; array->data = 0; } @@ -1274,6 +1341,14 @@ static void dynamic_array_free( struct dynamic_array * array ) static void dynamic_array_push_impl( struct dynamic_array * const array, void const * const value, int32_t const unit_size ) { + if ( array->unit_size == 0 ) + { + array->unit_size = unit_size; + } + else + { + assert( array->unit_size == unit_size ); + } if ( array->capacity == 0 ) { array->capacity = 2; @@ -1293,7 +1368,7 @@ static void dynamic_array_push_impl( struct dynamic_array * const array, } #define dynamic_array_push( array, value ) (dynamic_array_push_impl(array, &value, sizeof(value))) -#define dynamic_array_at( type, array, idx ) (((type *)(array)->data)[idx]) +#define dynamic_array_at( type, array, idx ) ( (assert( array->unit_size == sizeof(type) )) , (((type *)(array)->data)[idx]) ) #define dynamic_array_pop( array ) (--(array)->size) /* @@ -1611,14 +1686,50 @@ typedef struct OBJECT * s; } VAR_PARSE_STRING; -typedef struct +static void var_parse_free( VAR_PARSE * ); + +static std::string var_parse_to_string( VAR_PARSE_STRING * string, bool debug = false ); +static std::string var_parse_to_string( VAR_PARSE_GROUP * group, bool debug = false ); +static std::string var_parse_to_string( VAR_PARSE_VAR const * parse, bool debug = false ); + +static std::string var_parse_to_string( VAR_PARSE_STRING * string, bool debug ) { - VAR_PARSE base; - struct dynamic_array filename[ 1 ]; - struct dynamic_array contents[ 1 ]; -} VAR_PARSE_FILE; + std::string result; + if ( debug ) result += "'"; + result += object_str( string->s ) ? object_str( string->s ) : ""; + if ( debug ) result += "'"; + return result; +} +static std::string var_parse_to_string( VAR_PARSE_GROUP * group, bool debug ) +{ + std::string result; + if ( debug ) result += "["; + for ( int32_t i = 0; i < group->elems->size; ++i ) + { + switch ( dynamic_array_at( VAR_PARSE *, group->elems, i )->type ) + { + case VAR_PARSE_TYPE_VAR: + result += var_parse_to_string( dynamic_array_at( VAR_PARSE_VAR *, group->elems, i ), debug ); + break; -static void var_parse_free( VAR_PARSE * ); + case VAR_PARSE_TYPE_STRING: + result += var_parse_to_string( dynamic_array_at( VAR_PARSE_STRING *, group->elems, i ), debug ); + break; + } + } + if ( debug ) result += "["; + return result; +} +static std::string var_parse_to_string( VAR_PARSE_VAR const * parse, bool debug ) +{ + std::string result = "$("; + result += var_parse_to_string( parse->name, debug ); + for ( int32_t i = 0; i < parse->modifiers->size; ++i ) + { + result += ":" + var_parse_to_string( dynamic_array_at( VAR_PARSE_GROUP *, parse->modifiers, i ), debug ); + } + return result + ")"; +} /* @@ -1732,6 +1843,21 @@ static VAR_PARSE_GROUP * var_parse_var_new_modifier( VAR_PARSE_VAR * var ) return result; } +static int32_t var_parse_var_mod_index( VAR_PARSE_VAR const * var , char m) +{ + for ( int32_t i = 0; i < var->modifiers->size; ++i ) + { + VAR_PARSE_GROUP * mod = dynamic_array_at( VAR_PARSE_GROUP *, var->modifiers, i ); + VAR_PARSE_STRING * mod_val = dynamic_array_at( VAR_PARSE_STRING *, mod->elems, 0 ); + const char * mod_str = object_str(mod_val->s); + if (mod_str && mod_str[0] == m) + { + return i; + } + } + return -1; +} + /* * VAR_PARSE_STRING @@ -1744,35 +1870,6 @@ static void var_parse_string_free( VAR_PARSE_STRING * string ) } -/* - * VAR_PARSE_FILE - */ - -static VAR_PARSE_FILE * var_parse_file_new( void ) -{ - VAR_PARSE_FILE * const result = (VAR_PARSE_FILE *)BJAM_MALLOC( sizeof( - VAR_PARSE_FILE ) ); - result->base.type = VAR_PARSE_TYPE_FILE; - dynamic_array_init( result->filename ); - dynamic_array_init( result->contents ); - return result; -} - -static void var_parse_file_free( VAR_PARSE_FILE * file ) -{ - int32_t i; - for ( i = 0; i < file->filename->size; ++i ) - var_parse_group_free( dynamic_array_at( VAR_PARSE_GROUP *, - file->filename, i ) ); - dynamic_array_free( file->filename ); - for ( i = 0; i < file->contents->size; ++i ) - var_parse_group_free( dynamic_array_at( VAR_PARSE_GROUP *, - file->contents, i ) ); - dynamic_array_free( file->contents ); - BJAM_FREE( file ); -} - - /* * VAR_PARSE */ @@ -1782,6 +1879,7 @@ static void var_parse_free( VAR_PARSE * parse ) switch ( parse->type ) { case VAR_PARSE_TYPE_VAR: + case VAR_PARSE_TYPE_FILE: var_parse_var_free( (VAR_PARSE_VAR *)parse ); break; @@ -1789,10 +1887,6 @@ static void var_parse_free( VAR_PARSE * parse ) var_parse_string_free( (VAR_PARSE_STRING *)parse ); break; - case VAR_PARSE_TYPE_FILE: - var_parse_file_free( (VAR_PARSE_FILE *)parse ); - break; - default: assert( !"Invalid type" ); } @@ -1898,17 +1992,53 @@ static void var_parse_string_compile( VAR_PARSE_STRING const * parse, ); } -static void var_parse_file_compile( VAR_PARSE_FILE const * parse, compiler * c ) +static void parse_var_string( char const * first, char const * last, + struct dynamic_array * out ); + +static void var_parse_file_compile( VAR_PARSE_VAR const * parse, compiler * c ) { - int32_t i; - for ( i = 0; i < parse->filename->size; ++i ) - var_parse_group_compile( dynamic_array_at( VAR_PARSE_GROUP *, - parse->filename, parse->filename->size - i - 1 ), c ); - compile_emit( c, INSTR_APPEND_STRINGS, parse->filename->size ); - for ( i = 0; i < parse->contents->size; ++i ) - var_parse_group_compile( dynamic_array_at( VAR_PARSE_GROUP *, - parse->contents, parse->contents->size - i - 1 ), c ); - compile_emit( c, INSTR_WRITE_FILE, parse->contents->size ); + std::string var = var_parse_to_string( parse, true ); + int32_t empty_mod_index = var_parse_var_mod_index( parse, 'E' ); + int32_t grist_mod_index = var_parse_var_mod_index( parse, 'G' ); + int32_t modifier_count = 0; + // Push the contents, aka the edit modifier value. + { + assert( empty_mod_index >= 0 ); + // We reparse the edit modifier as we do teh expansion differently than + // regular var expansion. + std::string contents_val = var_parse_to_string( + dynamic_array_at( + VAR_PARSE_GROUP *, parse->modifiers, empty_mod_index ), false ); + dynamic_array contents_dyn_array; + dynamic_array_init( &contents_dyn_array ); + parse_var_string( + contents_val.c_str() + 2, contents_val.c_str() + contents_val.size(), + &contents_dyn_array ); + for ( int32_t i = contents_dyn_array.size - 1; i >= 0; --i ) + { + var_parse_group_compile( dynamic_array_at( + VAR_PARSE_GROUP *, ( &contents_dyn_array ), i ), c ); + } + dynamic_array_free( &contents_dyn_array ); + compile_emit( c, INSTR_APPEND_STRINGS, contents_dyn_array.size ); + } + // If there are modifiers, emit them in reverse order. + if ( parse->modifiers->size > 0 ) + { + for ( int32_t i = parse->modifiers->size - 1; i >= 0; --i ) + { + // Skip special modifiers. + if ( i == empty_mod_index || i == grist_mod_index ) continue; + modifier_count += 1; + var_parse_group_compile( + dynamic_array_at( VAR_PARSE_GROUP *, parse->modifiers, i ), c ); + } + } + // Push the filename, aka var name. + var_parse_group_compile( parse->name, c ); + // This instruction applies the modifiers and writes out the file and fills + // in the file name. + compile_emit( c, INSTR_WRITE_FILE, modifier_count ); } static void var_parse_compile( VAR_PARSE const * parse, compiler * c ) @@ -1924,7 +2054,7 @@ static void var_parse_compile( VAR_PARSE const * parse, compiler * c ) break; case VAR_PARSE_TYPE_FILE: - var_parse_file_compile( (VAR_PARSE_FILE const *)parse, c ); + var_parse_file_compile( (VAR_PARSE_VAR const *)parse, c ); break; default: @@ -1964,8 +2094,6 @@ static void var_parse_actions_compile( VAR_PARSE_ACTIONS const * actions, * Parse VAR_PARSE_VAR */ -static VAR_PARSE * parse_at_file( char const * start, char const * mid, - char const * end ); static VAR_PARSE * parse_variable( char const * * string ); static int32_t try_parse_variable( char const * * s_, char const * * string, VAR_PARSE_GROUP * out ); @@ -2026,36 +2154,18 @@ static int32_t try_parse_variable( char const * * s_, char const * * string, } if ( s[ 0 ] == '@' && s[ 1 ] == '(' ) { - int32_t depth = 1; - char const * ine; - char const * split = 0; var_parse_group_maybe_add_constant( out, *string, s ); s += 2; - ine = s; - - /* Scan the content of the response file @() section. */ - while ( *ine && ( depth > 0 ) ) + VAR_PARSE_VAR *vp = (VAR_PARSE_VAR*)parse_variable( &s ); + /* We at least need the empty (:E) modifier. */ + if (var_parse_var_mod_index(vp, 'E') >= 0) { - switch ( *ine ) - { - case '(': ++depth; break; - case ')': --depth; break; - case ':': - if ( ( depth == 1 ) && ( ine[ 1 ] == 'E' ) && ( ine[ 2 ] == '=' - ) ) - split = ine; - break; - } - ++ine; + vp->base.type = VAR_PARSE_TYPE_FILE; + var_parse_group_add( out, (VAR_PARSE*)vp ); + *string = s; + *s_ = s; + return 1; } - - if ( !split || depth ) - return 0; - - var_parse_group_add( out, parse_at_file( s, split, ine - 1 ) ); - *string = ine; - *s_ = ine; - return 1; } return 0; } @@ -2221,20 +2331,6 @@ static void parse_var_string( char const * first, char const * last, } } -/* - * start should point to the character immediately following the opening "@(", - * mid should point to the ":E=", and end should point to the closing ")". - */ - -static VAR_PARSE * parse_at_file( char const * start, char const * mid, - char const * end ) -{ - VAR_PARSE_FILE * result = var_parse_file_new(); - parse_var_string( start, mid, result->filename ); - parse_var_string( mid + 3, end, result->contents ); - return (VAR_PARSE *)result; -} - /* * Given that *s_ points to the character after a "(", parses up to the matching * ")". *string should point to the first unemitted character before *s_. @@ -3859,6 +3955,146 @@ void function_run_actions( FUNCTION * function, FRAME * frame, STACK * s, stack_deallocate( s, sizeof( string * ) ); } +// Result is either the filename or contents depending on: +// 1. If the RESPONSE_FILE_SUB == f or not set (it's filename) +// 2. If the RESPONSE_FILE_SUB == c (it's contents) +// 3. If the RESPONSE_FILE_SUB == a (depends on the length of contents) +// Note, returns a *copy* of the filename or contents. +LIST * function_execute_write_file( + JAM_FUNCTION * function, FRAME * frame, STACK * s, + VAR_EXPANDED filename, LIST * contents ) +{ + LIST * filename_or_contents_result = nullptr; + + LIST * response_file_sub = function_get_named_variable( + function, frame, constant_RESPONSE_FILE_SUB ); + char response_file_sub_c + = response_file_sub && list_front( response_file_sub ) + ? object_str( list_front( response_file_sub ) )[0] + : 'f'; + list_free( response_file_sub ); + const char * contents_str = object_str( list_front( contents ) ); + if ( response_file_sub_c == 'a' ) + { + if ( int32_t( strlen( contents_str ) + 256 ) > shell_maxline() ) + response_file_sub_c = 'f'; + else + response_file_sub_c = 'c'; + } + if ( response_file_sub_c == 'c' ) + { + filename_or_contents_result = list_copy( contents ); + } + else + { + char const * out = object_str( list_front( filename.inner ) ); + OBJECT * tmp_filename = nullptr; + FILE * out_file = nullptr; + bool out_debug = DEBUG_EXEC; + + /* For stdout/stderr we will create a temp file and generate a + * command that outputs the content as needed. + */ + if ( ( strcmp( "STDOUT", out ) == 0 ) || + ( strcmp( "STDERR", out ) == 0 ) ) + { + int32_t err_redir = strcmp( "STDERR", out ) == 0; + string result[ 1 ]; + + tmp_filename = path_tmpfile(); + + /* Construct os-specific cat command. */ + { + const char * command = "cat"; + const char * quote = "\""; + const char * redirect = "1>&2"; + + #ifdef OS_NT + command = "type"; + quote = "\""; + #elif defined( OS_VMS ) + command = "pipe type"; + quote = ""; + + /* Get tmp file name in os-format. */ + { + string os_filename[ 1 ]; + + string_new( os_filename ); + path_translate_to_os( object_str( tmp_filename ), os_filename ); + object_free( tmp_filename ); + tmp_filename = object_new( os_filename->value ); + string_free( os_filename ); + } + #endif + + string_new( result ); + string_append( result, command ); + string_append( result, " " ); + string_append( result, quote ); + string_append( result, object_str( tmp_filename ) ); + string_append( result, quote ); + if ( err_redir ) + { + string_append( result, " " ); + string_append( result, redirect ); + } + } + + /* Replace STDXXX with the temporary file. */ + filename_or_contents_result = list_new( object_new( result->value ) ); + out = object_str( tmp_filename ); + + string_free( result ); + + /* Make sure temp files created by this get nuked eventually. */ + file_remove_atexit( tmp_filename ); + } + else + { + filename_or_contents_result = list_copy( filename.value ); + } + + if ( !globs.noexec ) + { + string out_name[ 1 ]; + /* Handle "path to file" filenames. */ + if ( ( out[ 0 ] == '"' ) && ( out[ strlen( out ) - 1 ] == '"' ) + ) + { + string_copy( out_name, out + 1 ); + string_truncate( out_name, out_name->size - 1 ); + } + else + string_copy( out_name, out ); + out_file = fopen( out_name->value, "w" ); + + if ( !out_file ) + { + err_printf( "[errno %d] failed to write output file '%s': %s", + errno, out_name->value, strerror(errno) ); + exit( EXITBAD ); + } + string_free( out_name ); + } + + if ( out_debug ) out_printf( "\nfile %s\n", out ); + if ( out_file ) fputs( object_str( list_front( contents ) ), out_file ); + if ( out_debug ) out_puts( object_str( list_front( contents ) ) ); + if ( out_file ) + { + fflush( out_file ); + fclose( out_file ); + } + if ( tmp_filename ) + object_free( tmp_filename ); + + if ( out_debug ) out_putc( '\n' ); + } + + return filename_or_contents_result; +} + /* * WARNING: The instruction set is tuned for Jam and is not really generic. Be * especially careful about stack push/pop. @@ -4660,7 +4896,9 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) l = stack_pop( s ); n = expand_modifiers( s, code->arg ); stack_push( s, l ); - l = apply_modifiers( s, n ); + VAR_EXPANDED m = apply_modifiers( s, n ); + l = m.value; + list_free( m.inner ); list_free( stack_pop( s ) ); stack_deallocate( s, n * sizeof( VAR_EDITS ) ); for ( i = 0; i < code->arg; ++i ) @@ -4715,7 +4953,9 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) { stack_push( s, function_get_named_variable( function, frame, list_item( iter ) ) ); - result = list_append( result, apply_modifiers( s, n ) ); + VAR_EXPANDED m = apply_modifiers( s, n ); + result = m.value; + list_free( m.inner ); list_free( stack_pop( s ) ); } list_free( vars ); @@ -4932,114 +5172,27 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) break; } + // WRITE_FILE( LIST*1 filename, LIST*1 modifiers[N], LIST*1 contents ) case INSTR_WRITE_FILE: { PROFILE_ENTER_LOCAL(function_run_INSTR_WRITE_FILE); - string buf[ 1 ]; - char const * out; - OBJECT * tmp_filename = 0; - int32_t out_debug = DEBUG_EXEC ? 1 : 0; - FILE * out_file = 0; - string_new( buf ); - combine_strings( s, code->arg, buf ); - out = object_str( list_front( stack_top( s ) ) ); - - /* For stdout/stderr we will create a temp file and generate a - * command that outputs the content as needed. - */ - if ( ( strcmp( "STDOUT", out ) == 0 ) || - ( strcmp( "STDERR", out ) == 0 ) ) + // Get expanded filename. + LIST * filename = nullptr; { - int32_t err_redir = strcmp( "STDERR", out ) == 0; - string result[ 1 ]; - - tmp_filename = path_tmpfile(); - - /* Construct os-specific cat command. */ - { - const char * command = "cat"; - const char * quote = "\""; - const char * redirect = "1>&2"; - - #ifdef OS_NT - command = "type"; - quote = "\""; - #elif defined( OS_VMS ) - command = "pipe type"; - quote = ""; - - /* Get tmp file name is os-format. */ - { - string os_filename[ 1 ]; - - string_new( os_filename ); - path_translate_to_os( object_str( tmp_filename ), os_filename ); - object_free( tmp_filename ); - tmp_filename = object_new( os_filename->value ); - string_free( os_filename ); - } - #endif - - string_new( result ); - string_append( result, command ); - string_append( result, " " ); - string_append( result, quote ); - string_append( result, object_str( tmp_filename ) ); - string_append( result, quote ); - if ( err_redir ) - { - string_append( result, " " ); - string_append( result, redirect ); - } - } - - /* Replace STDXXX with the temporary file. */ - list_free( stack_pop( s ) ); - stack_push( s, list_new( object_new( result->value ) ) ); - out = object_str( tmp_filename ); - - string_free( result ); - - /* Make sure temp files created by this get nuked eventually. */ - file_remove_atexit( tmp_filename ); + expansion_item ei = { stack_pop( s ) }; + filename = expand( &ei, 1 ); } - - if ( !globs.noexec ) - { - string out_name[ 1 ]; - /* Handle "path to file" filenames. */ - if ( ( out[ 0 ] == '"' ) && ( out[ strlen( out ) - 1 ] == '"' ) - ) - { - string_copy( out_name, out + 1 ); - string_truncate( out_name, out_name->size - 1 ); - } - else - string_copy( out_name, out ); - out_file = fopen( out_name->value, "w" ); - - if ( !out_file ) - { - err_printf( "[errno %d] failed to write output file '%s': %s", - errno, out_name->value, strerror(errno) ); - exit( EXITBAD ); - } - string_free( out_name ); - } - - if ( out_debug ) out_printf( "\nfile %s\n", out ); - if ( out_file ) fputs( buf->value, out_file ); - if ( out_debug ) out_puts( buf->value ); - if ( out_file ) - { - fflush( out_file ); - fclose( out_file ); - } - string_free( buf ); - if ( tmp_filename ) - object_free( tmp_filename ); - - if ( out_debug ) out_putc( '\n' ); + // Apply modifiers to "raw" filename. + VAR_EXPANDED filename_mod = eval_modifiers( s, filename, code->arg ); + // Get contents. + LIST * contents = stack_pop( s ); + // Write out the contents file, or expand the contents, as needed. + LIST * filename_or_contents = function_execute_write_file( function, frame, s, filename_mod, contents ); + // The result that gets replaced into the @() space. + stack_push( s, filename_or_contents ); + list_free( filename_mod.value ); + list_free( filename_mod.inner ); + list_free( contents ); PROFILE_EXIT_LOCAL(function_run_INSTR_WRITE_FILE); break; } diff --git a/src/engine/jamgram.cpp b/src/engine/jamgram.cpp index 2f7382dfae..4f3de0615f 100644 --- a/src/engine/jamgram.cpp +++ b/src/engine/jamgram.cpp @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.6.4. */ +/* A Bison parser, made by GNU Bison 3.7.2. */ /* Bison implementation for Yacc-like parsers in C @@ -49,7 +49,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.6.4" +#define YYBISON_VERSION "3.7.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -135,144 +135,7 @@ # endif # endif -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_YY_SRC_ENGINE_JAMGRAM_HPP_INCLUDED -# define YY_YY_SRC_ENGINE_JAMGRAM_HPP_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - _BANG_t = 258, /* _BANG_t */ - _BANG_EQUALS_t = 259, /* _BANG_EQUALS_t */ - _AMPER_t = 260, /* _AMPER_t */ - _AMPERAMPER_t = 261, /* _AMPERAMPER_t */ - _LPAREN_t = 262, /* _LPAREN_t */ - _RPAREN_t = 263, /* _RPAREN_t */ - _PLUS_EQUALS_t = 264, /* _PLUS_EQUALS_t */ - _COLON_t = 265, /* _COLON_t */ - _SEMIC_t = 266, /* _SEMIC_t */ - _LANGLE_t = 267, /* _LANGLE_t */ - _LANGLE_EQUALS_t = 268, /* _LANGLE_EQUALS_t */ - _EQUALS_t = 269, /* _EQUALS_t */ - _RANGLE_t = 270, /* _RANGLE_t */ - _RANGLE_EQUALS_t = 271, /* _RANGLE_EQUALS_t */ - _QUESTION_EQUALS_t = 272, /* _QUESTION_EQUALS_t */ - _LBRACKET_t = 273, /* _LBRACKET_t */ - _RBRACKET_t = 274, /* _RBRACKET_t */ - ACTIONS_t = 275, /* ACTIONS_t */ - BIND_t = 276, /* BIND_t */ - BREAK_t = 277, /* BREAK_t */ - CASE_t = 278, /* CASE_t */ - CLASS_t = 279, /* CLASS_t */ - CONTINUE_t = 280, /* CONTINUE_t */ - DEFAULT_t = 281, /* DEFAULT_t */ - ELSE_t = 282, /* ELSE_t */ - EXISTING_t = 283, /* EXISTING_t */ - FOR_t = 284, /* FOR_t */ - IF_t = 285, /* IF_t */ - IGNORE_t = 286, /* IGNORE_t */ - IN_t = 287, /* IN_t */ - INCLUDE_t = 288, /* INCLUDE_t */ - LOCAL_t = 289, /* LOCAL_t */ - MODULE_t = 290, /* MODULE_t */ - ON_t = 291, /* ON_t */ - PIECEMEAL_t = 292, /* PIECEMEAL_t */ - QUIETLY_t = 293, /* QUIETLY_t */ - RETURN_t = 294, /* RETURN_t */ - RULE_t = 295, /* RULE_t */ - SWITCH_t = 296, /* SWITCH_t */ - TOGETHER_t = 297, /* TOGETHER_t */ - UPDATED_t = 298, /* UPDATED_t */ - WHILE_t = 299, /* WHILE_t */ - _LBRACE_t = 300, /* _LBRACE_t */ - _BAR_t = 301, /* _BAR_t */ - _BARBAR_t = 302, /* _BARBAR_t */ - _RBRACE_t = 303, /* _RBRACE_t */ - ARG = 304, /* ARG */ - STRING = 305 /* STRING */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif -/* Token kinds. */ -#define YYEOF 0 -#define YYerror 256 -#define YYUNDEF 257 -#define _BANG_t 258 -#define _BANG_EQUALS_t 259 -#define _AMPER_t 260 -#define _AMPERAMPER_t 261 -#define _LPAREN_t 262 -#define _RPAREN_t 263 -#define _PLUS_EQUALS_t 264 -#define _COLON_t 265 -#define _SEMIC_t 266 -#define _LANGLE_t 267 -#define _LANGLE_EQUALS_t 268 -#define _EQUALS_t 269 -#define _RANGLE_t 270 -#define _RANGLE_EQUALS_t 271 -#define _QUESTION_EQUALS_t 272 -#define _LBRACKET_t 273 -#define _RBRACKET_t 274 -#define ACTIONS_t 275 -#define BIND_t 276 -#define BREAK_t 277 -#define CASE_t 278 -#define CLASS_t 279 -#define CONTINUE_t 280 -#define DEFAULT_t 281 -#define ELSE_t 282 -#define EXISTING_t 283 -#define FOR_t 284 -#define IF_t 285 -#define IGNORE_t 286 -#define IN_t 287 -#define INCLUDE_t 288 -#define LOCAL_t 289 -#define MODULE_t 290 -#define ON_t 291 -#define PIECEMEAL_t 292 -#define QUIETLY_t 293 -#define RETURN_t 294 -#define RULE_t 295 -#define SWITCH_t 296 -#define TOGETHER_t 297 -#define UPDATED_t 298 -#define WHILE_t 299 -#define _LBRACE_t 300 -#define _BAR_t 301 -#define _BARBAR_t 302 -#define _RBRACE_t 303 -#define ARG 304 -#define STRING 305 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_SRC_ENGINE_JAMGRAM_HPP_INCLUDED */ +#include "jamgram.hpp" /* Symbol kind. */ enum yysymbol_kind_t { @@ -716,6 +579,7 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 207 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 305 @@ -1258,7 +1122,7 @@ yydestruct (const char *yymsg, } -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1276,34 +1140,30 @@ int yynerrs; int yyparse (void) { - yy_state_fast_t yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + int yyerrstatus = 0; - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ - YYPTRDIFF_T yystacksize; + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The state stack. */ + /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ + /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ @@ -1317,15 +1177,6 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yynerrs = 0; - yystate = 0; - yyerrstatus = 0; - - yystacksize = YYINITDEPTH; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - - YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ @@ -1526,722 +1377,722 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 3: + case 3: /* run: rules */ #line 148 "src/engine/jamgram.y" { parse_save( yyvsp[0].parse ); } -#line 1533 "src/engine/jamgram.cpp" +#line 1384 "src/engine/jamgram.cpp" break; - case 4: + case 4: /* block: null */ #line 159 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1539 "src/engine/jamgram.cpp" +#line 1390 "src/engine/jamgram.cpp" break; - case 5: + case 5: /* block: rules */ #line 161 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1545 "src/engine/jamgram.cpp" +#line 1396 "src/engine/jamgram.cpp" break; - case 6: + case 6: /* rules: rule */ #line 165 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1551 "src/engine/jamgram.cpp" +#line 1402 "src/engine/jamgram.cpp" break; - case 7: + case 7: /* rules: rule rules */ #line 167 "src/engine/jamgram.y" { yyval.parse = prules( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 1557 "src/engine/jamgram.cpp" +#line 1408 "src/engine/jamgram.cpp" break; - case 8: + case 8: /* $@1: %empty */ #line 168 "src/engine/jamgram.y" { yymode( SCAN_ASSIGN ); } -#line 1563 "src/engine/jamgram.cpp" +#line 1414 "src/engine/jamgram.cpp" break; - case 9: + case 9: /* $@2: %empty */ #line 168 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1569 "src/engine/jamgram.cpp" +#line 1420 "src/engine/jamgram.cpp" break; - case 10: + case 10: /* rules: LOCAL_t $@1 list assign_list_opt _SEMIC_t $@2 block */ #line 169 "src/engine/jamgram.y" { yyval.parse = plocal( yyvsp[-4].parse, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1575 "src/engine/jamgram.cpp" +#line 1426 "src/engine/jamgram.cpp" break; - case 11: + case 11: /* null: %empty */ #line 173 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 1581 "src/engine/jamgram.cpp" +#line 1432 "src/engine/jamgram.cpp" break; - case 12: + case 12: /* $@3: %empty */ #line 176 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1587 "src/engine/jamgram.cpp" +#line 1438 "src/engine/jamgram.cpp" break; - case 13: + case 13: /* assign_list_opt: _EQUALS_t $@3 list */ #line 177 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; yyval.number = ASSIGN_SET; } -#line 1593 "src/engine/jamgram.cpp" +#line 1444 "src/engine/jamgram.cpp" break; - case 14: + case 14: /* assign_list_opt: null */ #line 179 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; yyval.number = ASSIGN_APPEND; } -#line 1599 "src/engine/jamgram.cpp" +#line 1450 "src/engine/jamgram.cpp" break; - case 15: + case 15: /* arglist_opt: _LPAREN_t lol _RPAREN_t */ #line 183 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; } -#line 1605 "src/engine/jamgram.cpp" +#line 1456 "src/engine/jamgram.cpp" break; - case 16: + case 16: /* arglist_opt: %empty */ #line 185 "src/engine/jamgram.y" { yyval.parse = P0; } -#line 1611 "src/engine/jamgram.cpp" +#line 1462 "src/engine/jamgram.cpp" break; - case 17: + case 17: /* local_opt: LOCAL_t */ #line 189 "src/engine/jamgram.y" { yyval.number = 1; } -#line 1617 "src/engine/jamgram.cpp" +#line 1468 "src/engine/jamgram.cpp" break; - case 18: + case 18: /* local_opt: %empty */ #line 191 "src/engine/jamgram.y" { yyval.number = 0; } -#line 1623 "src/engine/jamgram.cpp" +#line 1474 "src/engine/jamgram.cpp" break; - case 19: + case 19: /* else_opt: ELSE_t rule */ #line 195 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1629 "src/engine/jamgram.cpp" +#line 1480 "src/engine/jamgram.cpp" break; - case 20: + case 20: /* else_opt: %empty */ #line 197 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 1635 "src/engine/jamgram.cpp" +#line 1486 "src/engine/jamgram.cpp" break; - case 21: + case 21: /* rule: _LBRACE_t block _RBRACE_t */ #line 200 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; } -#line 1641 "src/engine/jamgram.cpp" +#line 1492 "src/engine/jamgram.cpp" break; - case 22: + case 22: /* $@4: %empty */ #line 201 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1647 "src/engine/jamgram.cpp" +#line 1498 "src/engine/jamgram.cpp" break; - case 23: + case 23: /* rule: INCLUDE_t $@4 list _SEMIC_t */ #line 202 "src/engine/jamgram.y" { yyval.parse = pincl( yyvsp[-1].parse ); yymode( SCAN_NORMAL ); } -#line 1653 "src/engine/jamgram.cpp" +#line 1504 "src/engine/jamgram.cpp" break; - case 24: + case 24: /* $@5: %empty */ #line 203 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1659 "src/engine/jamgram.cpp" +#line 1510 "src/engine/jamgram.cpp" break; - case 25: + case 25: /* rule: ARG $@5 lol _SEMIC_t */ #line 204 "src/engine/jamgram.y" { yyval.parse = prule( yyvsp[-3].string, yyvsp[-1].parse ); yymode( SCAN_NORMAL ); } -#line 1665 "src/engine/jamgram.cpp" +#line 1516 "src/engine/jamgram.cpp" break; - case 26: + case 26: /* $@6: %empty */ #line 205 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1671 "src/engine/jamgram.cpp" +#line 1522 "src/engine/jamgram.cpp" break; - case 27: + case 27: /* rule: arg assign $@6 list _SEMIC_t */ #line 206 "src/engine/jamgram.y" { yyval.parse = pset( yyvsp[-4].parse, yyvsp[-1].parse, yyvsp[-3].number ); yymode( SCAN_NORMAL ); } -#line 1677 "src/engine/jamgram.cpp" +#line 1528 "src/engine/jamgram.cpp" break; - case 28: + case 28: /* $@7: %empty */ #line 207 "src/engine/jamgram.y" { yymode( SCAN_ASSIGN ); } -#line 1683 "src/engine/jamgram.cpp" +#line 1534 "src/engine/jamgram.cpp" break; - case 29: + case 29: /* $@8: %empty */ #line 207 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1689 "src/engine/jamgram.cpp" +#line 1540 "src/engine/jamgram.cpp" break; - case 30: + case 30: /* rule: arg ON_t $@7 list assign $@8 list _SEMIC_t */ #line 208 "src/engine/jamgram.y" { yyval.parse = pset1( yyvsp[-7].parse, yyvsp[-4].parse, yyvsp[-1].parse, yyvsp[-3].number ); yymode( SCAN_NORMAL ); } -#line 1695 "src/engine/jamgram.cpp" +#line 1546 "src/engine/jamgram.cpp" break; - case 31: + case 31: /* $@9: %empty */ #line 209 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1701 "src/engine/jamgram.cpp" +#line 1552 "src/engine/jamgram.cpp" break; - case 32: + case 32: /* rule: RETURN_t $@9 list _SEMIC_t */ #line 210 "src/engine/jamgram.y" { yyval.parse = preturn( yyvsp[-1].parse ); yymode( SCAN_NORMAL ); } -#line 1707 "src/engine/jamgram.cpp" +#line 1558 "src/engine/jamgram.cpp" break; - case 33: + case 33: /* rule: BREAK_t _SEMIC_t */ #line 212 "src/engine/jamgram.y" { yyval.parse = pbreak(); } -#line 1713 "src/engine/jamgram.cpp" +#line 1564 "src/engine/jamgram.cpp" break; - case 34: + case 34: /* rule: CONTINUE_t _SEMIC_t */ #line 214 "src/engine/jamgram.y" { yyval.parse = pcontinue(); } -#line 1719 "src/engine/jamgram.cpp" +#line 1570 "src/engine/jamgram.cpp" break; - case 35: + case 35: /* $@10: %empty */ #line 215 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1725 "src/engine/jamgram.cpp" +#line 1576 "src/engine/jamgram.cpp" break; - case 36: + case 36: /* $@11: %empty */ #line 215 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1731 "src/engine/jamgram.cpp" +#line 1582 "src/engine/jamgram.cpp" break; - case 37: + case 37: /* rule: FOR_t local_opt ARG IN_t $@10 list _LBRACE_t $@11 block _RBRACE_t */ #line 216 "src/engine/jamgram.y" { yyval.parse = pfor( yyvsp[-7].string, yyvsp[-4].parse, yyvsp[-1].parse, yyvsp[-8].number ); } -#line 1737 "src/engine/jamgram.cpp" +#line 1588 "src/engine/jamgram.cpp" break; - case 38: + case 38: /* $@12: %empty */ #line 217 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1743 "src/engine/jamgram.cpp" +#line 1594 "src/engine/jamgram.cpp" break; - case 39: + case 39: /* $@13: %empty */ #line 217 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1749 "src/engine/jamgram.cpp" +#line 1600 "src/engine/jamgram.cpp" break; - case 40: + case 40: /* rule: SWITCH_t $@12 list _LBRACE_t $@13 cases _RBRACE_t */ #line 218 "src/engine/jamgram.y" { yyval.parse = pswitch( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1755 "src/engine/jamgram.cpp" +#line 1606 "src/engine/jamgram.cpp" break; - case 41: + case 41: /* $@14: %empty */ #line 219 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1761 "src/engine/jamgram.cpp" +#line 1612 "src/engine/jamgram.cpp" break; - case 42: + case 42: /* $@15: %empty */ #line 219 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1767 "src/engine/jamgram.cpp" +#line 1618 "src/engine/jamgram.cpp" break; - case 43: + case 43: /* rule: IF_t $@14 expr _LBRACE_t $@15 block _RBRACE_t else_opt */ #line 220 "src/engine/jamgram.y" { yyval.parse = pif( yyvsp[-5].parse, yyvsp[-2].parse, yyvsp[0].parse ); } -#line 1773 "src/engine/jamgram.cpp" +#line 1624 "src/engine/jamgram.cpp" break; - case 44: + case 44: /* $@16: %empty */ #line 221 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1779 "src/engine/jamgram.cpp" +#line 1630 "src/engine/jamgram.cpp" break; - case 45: + case 45: /* $@17: %empty */ #line 221 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1785 "src/engine/jamgram.cpp" +#line 1636 "src/engine/jamgram.cpp" break; - case 46: + case 46: /* rule: MODULE_t $@16 list _LBRACE_t $@17 block _RBRACE_t */ #line 222 "src/engine/jamgram.y" { yyval.parse = pmodule( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1791 "src/engine/jamgram.cpp" +#line 1642 "src/engine/jamgram.cpp" break; - case 47: + case 47: /* $@18: %empty */ #line 223 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1797 "src/engine/jamgram.cpp" +#line 1648 "src/engine/jamgram.cpp" break; - case 48: + case 48: /* $@19: %empty */ #line 223 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1803 "src/engine/jamgram.cpp" +#line 1654 "src/engine/jamgram.cpp" break; - case 49: + case 49: /* rule: CLASS_t $@18 lol _LBRACE_t $@19 block _RBRACE_t */ #line 224 "src/engine/jamgram.y" { yyval.parse = pclass( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1809 "src/engine/jamgram.cpp" +#line 1660 "src/engine/jamgram.cpp" break; - case 50: + case 50: /* $@20: %empty */ #line 225 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1815 "src/engine/jamgram.cpp" +#line 1666 "src/engine/jamgram.cpp" break; - case 51: + case 51: /* $@21: %empty */ #line 225 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1821 "src/engine/jamgram.cpp" +#line 1672 "src/engine/jamgram.cpp" break; - case 52: + case 52: /* rule: WHILE_t $@20 expr $@21 _LBRACE_t block _RBRACE_t */ #line 226 "src/engine/jamgram.y" { yyval.parse = pwhile( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1827 "src/engine/jamgram.cpp" +#line 1678 "src/engine/jamgram.cpp" break; - case 53: + case 53: /* $@22: %empty */ #line 227 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1833 "src/engine/jamgram.cpp" +#line 1684 "src/engine/jamgram.cpp" break; - case 54: + case 54: /* $@23: %empty */ #line 227 "src/engine/jamgram.y" { yymode( SCAN_PARAMS ); } -#line 1839 "src/engine/jamgram.cpp" +#line 1690 "src/engine/jamgram.cpp" break; - case 55: + case 55: /* $@24: %empty */ #line 227 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1845 "src/engine/jamgram.cpp" +#line 1696 "src/engine/jamgram.cpp" break; - case 56: + case 56: /* rule: local_opt RULE_t $@22 ARG $@23 arglist_opt $@24 rule */ #line 228 "src/engine/jamgram.y" { yyval.parse = psetc( yyvsp[-4].string, yyvsp[0].parse, yyvsp[-2].parse, yyvsp[-7].number ); } -#line 1851 "src/engine/jamgram.cpp" +#line 1702 "src/engine/jamgram.cpp" break; - case 57: + case 57: /* rule: ON_t arg rule */ #line 230 "src/engine/jamgram.y" { yyval.parse = pon( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 1857 "src/engine/jamgram.cpp" +#line 1708 "src/engine/jamgram.cpp" break; - case 58: + case 58: /* $@25: %empty */ #line 232 "src/engine/jamgram.y" { yymode( SCAN_STRING ); } -#line 1863 "src/engine/jamgram.cpp" +#line 1714 "src/engine/jamgram.cpp" break; - case 59: + case 59: /* $@26: %empty */ #line 234 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1869 "src/engine/jamgram.cpp" +#line 1720 "src/engine/jamgram.cpp" break; - case 60: + case 60: /* rule: ACTIONS_t eflags ARG bindlist _LBRACE_t $@25 STRING $@26 _RBRACE_t */ #line 236 "src/engine/jamgram.y" { yyval.parse = psete( yyvsp[-6].string,yyvsp[-5].parse,yyvsp[-2].string,yyvsp[-7].number ); } -#line 1875 "src/engine/jamgram.cpp" +#line 1726 "src/engine/jamgram.cpp" break; - case 61: + case 61: /* assign: _EQUALS_t */ #line 244 "src/engine/jamgram.y" { yyval.number = ASSIGN_SET; } -#line 1881 "src/engine/jamgram.cpp" +#line 1732 "src/engine/jamgram.cpp" break; - case 62: + case 62: /* assign: _PLUS_EQUALS_t */ #line 246 "src/engine/jamgram.y" { yyval.number = ASSIGN_APPEND; } -#line 1887 "src/engine/jamgram.cpp" +#line 1738 "src/engine/jamgram.cpp" break; - case 63: + case 63: /* assign: _QUESTION_EQUALS_t */ #line 248 "src/engine/jamgram.y" { yyval.number = ASSIGN_DEFAULT; } -#line 1893 "src/engine/jamgram.cpp" +#line 1744 "src/engine/jamgram.cpp" break; - case 64: + case 64: /* assign: DEFAULT_t _EQUALS_t */ #line 250 "src/engine/jamgram.y" { yyval.number = ASSIGN_DEFAULT; } -#line 1899 "src/engine/jamgram.cpp" +#line 1750 "src/engine/jamgram.cpp" break; - case 65: + case 65: /* expr: arg */ #line 257 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_EXISTS, yyvsp[0].parse, pnull() ); yymode( SCAN_COND ); } -#line 1905 "src/engine/jamgram.cpp" +#line 1756 "src/engine/jamgram.cpp" break; - case 66: + case 66: /* $@27: %empty */ #line 258 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1911 "src/engine/jamgram.cpp" +#line 1762 "src/engine/jamgram.cpp" break; - case 67: + case 67: /* expr: expr _EQUALS_t $@27 expr */ #line 259 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_EQUALS, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1917 "src/engine/jamgram.cpp" +#line 1768 "src/engine/jamgram.cpp" break; - case 68: + case 68: /* $@28: %empty */ #line 260 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1923 "src/engine/jamgram.cpp" +#line 1774 "src/engine/jamgram.cpp" break; - case 69: + case 69: /* expr: expr _BANG_EQUALS_t $@28 expr */ #line 261 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_NOTEQ, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1929 "src/engine/jamgram.cpp" +#line 1780 "src/engine/jamgram.cpp" break; - case 70: + case 70: /* $@29: %empty */ #line 262 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1935 "src/engine/jamgram.cpp" +#line 1786 "src/engine/jamgram.cpp" break; - case 71: + case 71: /* expr: expr _LANGLE_t $@29 expr */ #line 263 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_LESS, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1941 "src/engine/jamgram.cpp" +#line 1792 "src/engine/jamgram.cpp" break; - case 72: + case 72: /* $@30: %empty */ #line 264 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1947 "src/engine/jamgram.cpp" +#line 1798 "src/engine/jamgram.cpp" break; - case 73: + case 73: /* expr: expr _LANGLE_EQUALS_t $@30 expr */ #line 265 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_LESSEQ, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1953 "src/engine/jamgram.cpp" +#line 1804 "src/engine/jamgram.cpp" break; - case 74: + case 74: /* $@31: %empty */ #line 266 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1959 "src/engine/jamgram.cpp" +#line 1810 "src/engine/jamgram.cpp" break; - case 75: + case 75: /* expr: expr _RANGLE_t $@31 expr */ #line 267 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_MORE, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1965 "src/engine/jamgram.cpp" +#line 1816 "src/engine/jamgram.cpp" break; - case 76: + case 76: /* $@32: %empty */ #line 268 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1971 "src/engine/jamgram.cpp" +#line 1822 "src/engine/jamgram.cpp" break; - case 77: + case 77: /* expr: expr _RANGLE_EQUALS_t $@32 expr */ #line 269 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_MOREEQ, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1977 "src/engine/jamgram.cpp" +#line 1828 "src/engine/jamgram.cpp" break; - case 78: + case 78: /* $@33: %empty */ #line 270 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1983 "src/engine/jamgram.cpp" +#line 1834 "src/engine/jamgram.cpp" break; - case 79: + case 79: /* expr: expr _AMPER_t $@33 expr */ #line 271 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_AND, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1989 "src/engine/jamgram.cpp" +#line 1840 "src/engine/jamgram.cpp" break; - case 80: + case 80: /* $@34: %empty */ #line 272 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1995 "src/engine/jamgram.cpp" +#line 1846 "src/engine/jamgram.cpp" break; - case 81: + case 81: /* expr: expr _AMPERAMPER_t $@34 expr */ #line 273 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_AND, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2001 "src/engine/jamgram.cpp" +#line 1852 "src/engine/jamgram.cpp" break; - case 82: + case 82: /* $@35: %empty */ #line 274 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2007 "src/engine/jamgram.cpp" +#line 1858 "src/engine/jamgram.cpp" break; - case 83: + case 83: /* expr: expr _BAR_t $@35 expr */ #line 275 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_OR, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2013 "src/engine/jamgram.cpp" +#line 1864 "src/engine/jamgram.cpp" break; - case 84: + case 84: /* $@36: %empty */ #line 276 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2019 "src/engine/jamgram.cpp" +#line 1870 "src/engine/jamgram.cpp" break; - case 85: + case 85: /* expr: expr _BARBAR_t $@36 expr */ #line 277 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_OR, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2025 "src/engine/jamgram.cpp" +#line 1876 "src/engine/jamgram.cpp" break; - case 86: + case 86: /* $@37: %empty */ #line 278 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2031 "src/engine/jamgram.cpp" +#line 1882 "src/engine/jamgram.cpp" break; - case 87: + case 87: /* expr: arg IN_t $@37 list */ #line 279 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_IN, yyvsp[-3].parse, yyvsp[0].parse ); yymode( SCAN_COND ); } -#line 2037 "src/engine/jamgram.cpp" +#line 1888 "src/engine/jamgram.cpp" break; - case 88: + case 88: /* $@38: %empty */ #line 280 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2043 "src/engine/jamgram.cpp" +#line 1894 "src/engine/jamgram.cpp" break; - case 89: + case 89: /* expr: _BANG_t $@38 expr */ #line 281 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_NOT, yyvsp[0].parse, pnull() ); } -#line 2049 "src/engine/jamgram.cpp" +#line 1900 "src/engine/jamgram.cpp" break; - case 90: + case 90: /* $@39: %empty */ #line 282 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2055 "src/engine/jamgram.cpp" +#line 1906 "src/engine/jamgram.cpp" break; - case 91: + case 91: /* expr: _LPAREN_t $@39 expr _RPAREN_t */ #line 283 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; } -#line 2061 "src/engine/jamgram.cpp" +#line 1912 "src/engine/jamgram.cpp" break; - case 92: + case 92: /* cases: %empty */ #line 294 "src/engine/jamgram.y" { yyval.parse = P0; } -#line 2067 "src/engine/jamgram.cpp" +#line 1918 "src/engine/jamgram.cpp" break; - case 93: + case 93: /* cases: case cases */ #line 296 "src/engine/jamgram.y" { yyval.parse = pnode( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 2073 "src/engine/jamgram.cpp" +#line 1924 "src/engine/jamgram.cpp" break; - case 94: + case 94: /* $@40: %empty */ #line 299 "src/engine/jamgram.y" { yymode( SCAN_CASE ); } -#line 2079 "src/engine/jamgram.cpp" +#line 1930 "src/engine/jamgram.cpp" break; - case 95: + case 95: /* $@41: %empty */ #line 299 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 2085 "src/engine/jamgram.cpp" +#line 1936 "src/engine/jamgram.cpp" break; - case 96: + case 96: /* case: CASE_t $@40 ARG _COLON_t $@41 block */ #line 300 "src/engine/jamgram.y" { yyval.parse = psnode( yyvsp[-3].string, yyvsp[0].parse ); } -#line 2091 "src/engine/jamgram.cpp" +#line 1942 "src/engine/jamgram.cpp" break; - case 97: + case 97: /* lol: list */ #line 309 "src/engine/jamgram.y" { yyval.parse = pnode( P0, yyvsp[0].parse ); } -#line 2097 "src/engine/jamgram.cpp" +#line 1948 "src/engine/jamgram.cpp" break; - case 98: + case 98: /* lol: list _COLON_t lol */ #line 311 "src/engine/jamgram.y" { yyval.parse = pnode( yyvsp[0].parse, yyvsp[-2].parse ); } -#line 2103 "src/engine/jamgram.cpp" +#line 1954 "src/engine/jamgram.cpp" break; - case 99: + case 99: /* list: listp */ #line 321 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 2109 "src/engine/jamgram.cpp" +#line 1960 "src/engine/jamgram.cpp" break; - case 100: + case 100: /* listp: %empty */ #line 325 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 2115 "src/engine/jamgram.cpp" +#line 1966 "src/engine/jamgram.cpp" break; - case 101: + case 101: /* listp: listp arg */ #line 327 "src/engine/jamgram.y" { yyval.parse = pappend( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 2121 "src/engine/jamgram.cpp" +#line 1972 "src/engine/jamgram.cpp" break; - case 102: + case 102: /* arg: ARG */ #line 331 "src/engine/jamgram.y" { yyval.parse = plist( yyvsp[0].string ); } -#line 2127 "src/engine/jamgram.cpp" +#line 1978 "src/engine/jamgram.cpp" break; - case 103: + case 103: /* @42: %empty */ #line 332 "src/engine/jamgram.y" { yyval.number = yymode( SCAN_CALL ); } -#line 2133 "src/engine/jamgram.cpp" +#line 1984 "src/engine/jamgram.cpp" break; - case 104: + case 104: /* arg: _LBRACKET_t @42 func _RBRACKET_t */ #line 333 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; yymode( yyvsp[-2].number ); } -#line 2139 "src/engine/jamgram.cpp" +#line 1990 "src/engine/jamgram.cpp" break; - case 105: + case 105: /* $@43: %empty */ #line 341 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2145 "src/engine/jamgram.cpp" +#line 1996 "src/engine/jamgram.cpp" break; - case 106: + case 106: /* func: ARG $@43 lol */ #line 342 "src/engine/jamgram.y" { yyval.parse = prule( yyvsp[-2].string, yyvsp[0].parse ); } -#line 2151 "src/engine/jamgram.cpp" +#line 2002 "src/engine/jamgram.cpp" break; - case 107: + case 107: /* $@44: %empty */ #line 343 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2157 "src/engine/jamgram.cpp" +#line 2008 "src/engine/jamgram.cpp" break; - case 108: + case 108: /* func: ON_t arg ARG $@44 lol */ #line 344 "src/engine/jamgram.y" { yyval.parse = pon( yyvsp[-3].parse, prule( yyvsp[-2].string, yyvsp[0].parse ) ); } -#line 2163 "src/engine/jamgram.cpp" +#line 2014 "src/engine/jamgram.cpp" break; - case 109: + case 109: /* $@45: %empty */ #line 345 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2169 "src/engine/jamgram.cpp" +#line 2020 "src/engine/jamgram.cpp" break; - case 110: + case 110: /* func: ON_t arg RETURN_t $@45 list */ #line 346 "src/engine/jamgram.y" { yyval.parse = pon( yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2175 "src/engine/jamgram.cpp" +#line 2026 "src/engine/jamgram.cpp" break; - case 111: + case 111: /* eflags: %empty */ #line 356 "src/engine/jamgram.y" { yyval.number = 0; } -#line 2181 "src/engine/jamgram.cpp" +#line 2032 "src/engine/jamgram.cpp" break; - case 112: + case 112: /* eflags: eflags eflag */ #line 358 "src/engine/jamgram.y" { yyval.number = yyvsp[-1].number | yyvsp[0].number; } -#line 2187 "src/engine/jamgram.cpp" +#line 2038 "src/engine/jamgram.cpp" break; - case 113: + case 113: /* eflag: UPDATED_t */ #line 362 "src/engine/jamgram.y" { yyval.number = EXEC_UPDATED; } -#line 2193 "src/engine/jamgram.cpp" +#line 2044 "src/engine/jamgram.cpp" break; - case 114: + case 114: /* eflag: TOGETHER_t */ #line 364 "src/engine/jamgram.y" { yyval.number = EXEC_TOGETHER; } -#line 2199 "src/engine/jamgram.cpp" +#line 2050 "src/engine/jamgram.cpp" break; - case 115: + case 115: /* eflag: IGNORE_t */ #line 366 "src/engine/jamgram.y" { yyval.number = EXEC_IGNORE; } -#line 2205 "src/engine/jamgram.cpp" +#line 2056 "src/engine/jamgram.cpp" break; - case 116: + case 116: /* eflag: QUIETLY_t */ #line 368 "src/engine/jamgram.y" { yyval.number = EXEC_QUIETLY; } -#line 2211 "src/engine/jamgram.cpp" +#line 2062 "src/engine/jamgram.cpp" break; - case 117: + case 117: /* eflag: PIECEMEAL_t */ #line 370 "src/engine/jamgram.y" { yyval.number = EXEC_PIECEMEAL; } -#line 2217 "src/engine/jamgram.cpp" +#line 2068 "src/engine/jamgram.cpp" break; - case 118: + case 118: /* eflag: EXISTING_t */ #line 372 "src/engine/jamgram.y" { yyval.number = EXEC_EXISTING; } -#line 2223 "src/engine/jamgram.cpp" +#line 2074 "src/engine/jamgram.cpp" break; - case 119: + case 119: /* bindlist: %empty */ #line 381 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 2229 "src/engine/jamgram.cpp" +#line 2080 "src/engine/jamgram.cpp" break; - case 120: + case 120: /* $@46: %empty */ #line 382 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2235 "src/engine/jamgram.cpp" +#line 2086 "src/engine/jamgram.cpp" break; - case 121: + case 121: /* bindlist: BIND_t $@46 list */ #line 383 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 2241 "src/engine/jamgram.cpp" +#line 2092 "src/engine/jamgram.cpp" break; -#line 2245 "src/engine/jamgram.cpp" +#line 2096 "src/engine/jamgram.cpp" default: break; } @@ -2401,13 +2252,13 @@ yyparse (void) yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ + goto yyreturn; #endif -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ +/*-------------------------------------------------------. +| yyreturn -- parsing is finished, clean up and return. | +`-------------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { diff --git a/src/engine/jamgram.hpp b/src/engine/jamgram.hpp index 325bbe1419..48e84c194f 100644 --- a/src/engine/jamgram.hpp +++ b/src/engine/jamgram.hpp @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.6.4. */ +/* A Bison parser, made by GNU Bison 3.7.2. */ /* Bison interface for Yacc-like parsers in C diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index 28ddcde7ba..aaeb2dc710 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -20,6 +20,7 @@ import type ; import numbers ; import os ; import property ; +import set ; feature.extend-subfeature toolset clang : platform : linux ; @@ -112,6 +113,8 @@ rule init ( version ? : command * : options * ) { ############################################################################### # Flags +local all-os = [ feature.values ] ; + # note: clang silently ignores some of these inlining options # For clang, 'on' and 'full' are identical. toolset.flags clang-linux.compile OPTIONS full : -Wno-inline ; @@ -133,6 +136,11 @@ toolset.flags clang-linux.link OPTIONS gnu gnu11 : -stdlib=libst toolset.flags clang-linux.compile OPTIONS libc++ : -stdlib=libc++ ; toolset.flags clang-linux.link OPTIONS libc++ : -stdlib=libc++ ; +# Enable response file control +toolset.flags clang-linux RESPONSE_FILE_SUB auto : a ; +toolset.flags clang-linux RESPONSE_FILE_SUB file : f ; +toolset.flags clang-linux RESPONSE_FILE_SUB contents : c ; + ############################################################################### # C and C++ compilation @@ -203,85 +211,21 @@ actions compile.c.pch ############################################################################### # Linking -SPACE = " " ; +local soname-os = [ set.difference $(all-os) : windows ] ; +toolset.flags clang-linux.link SONAME_OPT $(soname-os) : "-Wl,-soname -Wl," ; rule link ( targets * : sources * : properties * ) { - SPACE on $(targets) = " " ; - - 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) ; - } + _ on $(targets) = " " ; } rule link.dll ( targets * : sources * : properties * ) { - SPACE on $(targets) = " " ; - - 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) ; - } -} - -# Target OS is not Windows, needs the RPATH stuff -actions link-o bind LIBRARIES { - "$(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)" -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) + _ on $(targets) = " " ; } -# 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 bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:<=@":>=":E=-Wl,-R$(_)-Wl,"$(RPATH)" -Wl,-rpath-link$(_)-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 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) - +actions link.dll bind LIBRARIES { + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:<=@":>=":E=-Wl,-R$(_)-Wl,"$(RPATH)" $(SONAME_OPT)$(<[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) } diff --git a/src/tools/features/response-file-feature.jam b/src/tools/features/response-file-feature.jam new file mode 100644 index 0000000000..de910d55bb --- /dev/null +++ b/src/tools/features/response-file-feature.jam @@ -0,0 +1,26 @@ +# Copyright 2020 René Ferdinand Rivera Morell +# 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 feature ; + +#| tag::doc[] + +[[bbv2.builtin.features.response-file]]`response-file`:: +*Allowed values:* `file`, `contents`, `auto`. ++ +Controls whether a response file is used, or not, during the build of the +applicable target. For `file` a response file is created and the filename +replaced in the action. For `contents` the contents (`:E=`) is replaced +in the action and no response file is created. For `auto` either a response +file is created, or the contents replaced, based on the length of the +contents such that if the contents fits within the limits of the command +execution line length limits the contents is replaced. Otherwise a +response file is created and the filename is replaced in the actions. + +|# # end::doc[] + +feature.feature response-file + : auto file contents + : incidental ; diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 3d65128e5d..6f298e7551 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -968,13 +968,15 @@ toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib # support -s. toolset.flags gcc.link OPTIONS $(generic-os)/on : -Wl,--strip-all ; - toolset.flags gcc.link RPATH $(generic-os) : ; - toolset.flags gcc.link RPATH_OPTION $(generic-os) : -rpath ; - toolset.flags gcc.link RPATH_LINK $(generic-os) : ; toolset.flags gcc.link START-GROUP $(generic-os) : -Wl,--start-group ; toolset.flags gcc.link END-GROUP $(generic-os) : -Wl,--end-group ; + local rpath-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux windows ] ; + toolset.flags gcc.link RPATH $(rpath-os) : ; + toolset.flags gcc.link RPATH_OPTION $(rpath-os) : -rpath ; + toolset.flags gcc.link RPATH_LINK $(rpath-os) : ; + # gnu ld has the ability to change the search behaviour for libraries # referenced by the -l switch. These modifiers are -Bstatic and # -Bdynamic and change search for -l switches that follow them. The diff --git a/test/core_at_file.py b/test/core_at_file.py index 50fa51220f..0a321f4c97 100755 --- a/test/core_at_file.py +++ b/test/core_at_file.py @@ -13,27 +13,27 @@ t.write("file.jam", """\ name = n1 n2 ; contents = M1 M2 ; -EXIT "file:" "@(o$(name) .txt:E= test -D$(contents))" : 0 ; +EXIT "file:" "@(o$(name:J=) .txt:E= test -D$(contents))" : 0 ; """) t.run_build_system() -t.expect_output_lines("file: on1 on2 .txt"); -t.expect_addition("on1 on2 .txt") -t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True) +t.expect_output_lines("file: on1n2 .txt"); +t.expect_addition("on1n2 .txt") +t.expect_content("on1n2 .txt", " test -DM1 -DM2", True) t.rm(".") t.write("file.jam", """\ name = n1 n2 ; contents = M1 M2 ; -actions run { echo file: "@(o$(name) .txt:E= test -D$(contents))" } +actions run { echo file: "@(o$(name:J=) .txt:E= test -D$(contents))" } run all ; """) t.run_build_system(["-d2"]) -t.expect_output_lines(' echo file: "on1 on2 .txt" '); -t.expect_addition("on1 on2 .txt") -t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True) +t.expect_output_lines(' echo file: "on1n2 .txt" '); +t.expect_addition("on1n2 .txt") +t.expect_content("on1n2 .txt", " test -DM1 -DM2", True) t.rm(".") diff --git a/test/toolset-mock/src/MockProgram.py b/test/toolset-mock/src/MockProgram.py index 795b8676d5..e6f46af942 100644 --- a/test/toolset-mock/src/MockProgram.py +++ b/test/toolset-mock/src/MockProgram.py @@ -1,4 +1,5 @@ # Copyright 2017 Steven Watanabe +# Copyright 2020 René Ferdinand Rivera Morell # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at @@ -120,6 +121,17 @@ def match(self, command_line, pos, outputs): if s.startswith(self.prefix) and try_match([s[len(self.prefix):]], 0, self.a, outputs) == 1: return pos + 1 +# +class opt(object): + def __init__(self, *args): + self.args = args + def match(self, command_line, pos, outputs): + for p in self.args: + res = try_match_one(command_line, pos, p, outputs) + if res is not None: + pos = res + return pos + # Given a file id, returns a string that will be # written to the file to allow it to be recognized. def make_file_contents(id): diff --git a/test/toolset-mock/src/ar.py b/test/toolset-mock/src/ar.py index 853fe1dd8b..9fb681eef2 100644 --- a/test/toolset-mock/src/ar.py +++ b/test/toolset-mock/src/ar.py @@ -1,6 +1,7 @@ #!/usr/bin/python # # Copyright 2017-2018 Steven Watanabe +# Copyright 2020 René Ferdinand Rivera Morell # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at @@ -20,5 +21,6 @@ command('ar', 'rc', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/libl1.a'), input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o')) command('ar', 'rcu', output_file('bin/clang-vxworks-4.0.1/debug/link-static/libl1.a'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/lib.o')) command('ar', 'rcu', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/libl1.a'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/lib.o')) +command('ar', 'rc', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib'), input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/lib.obj')) main() 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 02d28db541..0194818c8b 100644 --- a/test/toolset-mock/src/clang-linux-3.9.0.py +++ b/test/toolset-mock/src/clang-linux-3.9.0.py @@ -1,7 +1,7 @@ #!/usr/bin/python # # Copyright 2017 Steven Watanabe -# Copyright 2020 Rene Rivera +# Copyright 2020 René Ferdinand Rivera Morell # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at @@ -12,38 +12,76 @@ command('clang++', '-print-prog-name=ar', stdout=script('ar.py')) command('clang++', '-print-prog-name=ranlib', stdout=script('ranlib.py')) -if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): +# target-os=linux .. + +if allow_properties('target-os=linux', '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'), '-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++', 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'), '-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')), '-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')) -if allow_properties('variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): +if allow_properties('target-os=linux', '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/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++', 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'), '-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')), '-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')) -if allow_properties('variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): +if allow_properties('target-os=linux', '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'), '-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++', 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'), '-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')), '-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')) -if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): +if allow_properties('target-os=linux', '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'), '-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') -if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): +if allow_properties('target-os=linux', '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'), '-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')) -if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): +if allow_properties('target-os=linux', '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'), '-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++', 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'), '-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')), '-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')) + +# target-os=windows .. + +if allow_properties('target-os=windows', 'variant=debug', 'link=shared', '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/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g')) + command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/target-os-windows/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g')) + +if allow_properties('target-os=windows', 'variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): + command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/target-os-windows/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-Wl,--strip-all')) + command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-Wl,--strip-all')) + +if allow_properties('target-os=windows', 'variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): + command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/lib.obj'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-pthread')) + command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/main.obj'), input_file(source='main.cpp')) + command('clang++', '-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/target-os-windows/threading-multi/main.obj'), input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-pthread')) + +if allow_properties('target-os=windows', '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/target-os-windows/lib.obj'), 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/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-g') + +if allow_properties('target-os=windows', '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/target-os-windows/lib.obj'), 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/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib'), '-Wl,--end-group', unordered('-g', '-static')) + +if allow_properties('target-os=windows', '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', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-m32')) + command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-m32')) main() diff --git a/test/toolset-mock/src/ranlib.py b/test/toolset-mock/src/ranlib.py index 4abe21ed0f..6a3e9b63ca 100644 --- a/test/toolset-mock/src/ranlib.py +++ b/test/toolset-mock/src/ranlib.py @@ -1,6 +1,7 @@ #!/usr/bin/python # # Copyright 2017 Steven Watanabe +# Copyright 2020 René Ferdinand Rivera Morell # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at @@ -18,5 +19,6 @@ command('ranlib', '-cs', input_file('bin/intel-darwin-10.2/debug/link-static/runtime-link-static/target-os-darwin/libl1.a')) command('ranlib', input_file('bin/clang-linux-3.9.0/debug/link-static/libl1.a')) command('ranlib', input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/libl1.a')) +command('ranlib', input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib')) main() diff --git a/test/toolset_clang_linux.py b/test/toolset_clang_linux.py index 2fbf84b6d0..b4fe0d5a11 100644 --- a/test/toolset_clang_linux.py +++ b/test/toolset_clang_linux.py @@ -1,6 +1,7 @@ #!/usr/bin/python # # Copyright 2017 Steven Watanabe +# Copyright 2020 René Ferdinand Rivera Morell # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at @@ -17,3 +18,11 @@ ["target-os=linux", "link=static"], ["target-os=linux", "link=static", "runtime-link=static"], ["target-os=linux", "architecture=x86", "address-model=32"]]) + +test_toolset("clang-linux", "3.9.0", [ + ["target-os=windows"], + ["target-os=windows", "release", "strip=on"], + ["target-os=windows", "threading=multi"], + ["target-os=windows", "link=static"], + ["target-os=windows", "architecture=x86", "address-model=32"] + ]) From 03ef46ec4d8d5ca6fa7e89551577963d830b0e32 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Dec 2020 21:52:12 -0600 Subject: [PATCH 055/126] Add python coding hint as py is too dumb to figure it out by itself. --- test/toolset-mock/src/MockProgram.py | 1 + test/toolset-mock/src/ar.py | 1 + test/toolset-mock/src/clang-linux-3.9.0.py | 1 + test/toolset-mock/src/ranlib.py | 1 + test/toolset_clang_linux.py | 1 + 5 files changed, 5 insertions(+) diff --git a/test/toolset-mock/src/MockProgram.py b/test/toolset-mock/src/MockProgram.py index e6f46af942..886197ac57 100644 --- a/test/toolset-mock/src/MockProgram.py +++ b/test/toolset-mock/src/MockProgram.py @@ -1,3 +1,4 @@ +# coding: utf-8 # Copyright 2017 Steven Watanabe # Copyright 2020 René Ferdinand Rivera Morell # diff --git a/test/toolset-mock/src/ar.py b/test/toolset-mock/src/ar.py index 9fb681eef2..dec40bd074 100644 --- a/test/toolset-mock/src/ar.py +++ b/test/toolset-mock/src/ar.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# coding: utf-8 # # Copyright 2017-2018 Steven Watanabe # Copyright 2020 René Ferdinand Rivera Morell 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 0194818c8b..424acb02ac 100644 --- a/test/toolset-mock/src/clang-linux-3.9.0.py +++ b/test/toolset-mock/src/clang-linux-3.9.0.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# coding: utf-8 # # Copyright 2017 Steven Watanabe # Copyright 2020 René Ferdinand Rivera Morell diff --git a/test/toolset-mock/src/ranlib.py b/test/toolset-mock/src/ranlib.py index 6a3e9b63ca..42d8ee343a 100644 --- a/test/toolset-mock/src/ranlib.py +++ b/test/toolset-mock/src/ranlib.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# coding: utf-8 # # Copyright 2017 Steven Watanabe # Copyright 2020 René Ferdinand Rivera Morell diff --git a/test/toolset_clang_linux.py b/test/toolset_clang_linux.py index b4fe0d5a11..5bc287378b 100644 --- a/test/toolset_clang_linux.py +++ b/test/toolset_clang_linux.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# coding: utf-8 # # Copyright 2017 Steven Watanabe # Copyright 2020 René Ferdinand Rivera Morell From 1e658bae2b515df58122071ce52049b1a8ef34dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Mon, 14 Dec 2020 08:19:59 -0600 Subject: [PATCH 056/126] Fix missing subscript operator on new @() evals. --- src/engine/function.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 101fd1a139..5219254a9a 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -1724,6 +1724,10 @@ static std::string var_parse_to_string( VAR_PARSE_VAR const * parse, bool debug { std::string result = "$("; result += var_parse_to_string( parse->name, debug ); + if ( parse->subscript ) + { + result += "[" + var_parse_to_string( parse->subscript, debug ) + "]"; + } for ( int32_t i = 0; i < parse->modifiers->size; ++i ) { result += ":" + var_parse_to_string( dynamic_array_at( VAR_PARSE_GROUP *, parse->modifiers, i ), debug ); From b2043d7c7a13bb54fd909a186624feaf06f32969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Mon, 14 Dec 2020 09:15:10 -0600 Subject: [PATCH 057/126] Support dynamic response files for msvc. --- src/tools/msvc.jam | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 3b8ef06726..8c1f92316a 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -587,7 +587,7 @@ if [ os.name ] in NT actions archive { if exist "$(<[1])" DEL "$(<[1])" - $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")" + $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } } else @@ -595,7 +595,7 @@ else actions archive { $(.RM) "$(<[1])" - $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")" + $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } } @@ -668,12 +668,12 @@ toolset.flags msvc YLOPTION : "-Yl" ; # actions compile-c-c++ bind PDB_NAME { - $(.SETUP) $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE)) $(.CC.FILTER) } actions preprocess-c-c++ bind PDB_NAME { - $(.SETUP) $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -E $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" >"$(<[1]:W)" + $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[1]:W)" -E $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" >"$(<[1]:W)" } rule compile-c-c++ ( targets + : sources * ) @@ -700,7 +700,7 @@ rule preprocess-c-c++ ( targets + : sources * ) # syntax highlighting in the messy N-quoted code below. actions compile-c-c++-pch { - $(.SETUP) $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote)$(.nl))" $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) @($(<[1]:W).cpp:<=":>=":E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote)$(.nl)) $(.CC.FILTER) } @@ -709,7 +709,7 @@ actions compile-c-c++-pch # given as one of the source parameters. actions compile-c-c++-pch-s { - $(.SETUP) $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) $(.CC.FILTER) } @@ -754,7 +754,7 @@ rule compile.idl ( targets + : sources * : properties * ) # actions compile.idl { - $(.SETUP) $(.IDL) /nologo @"@($(<[1]:W).rsp:E=$(.nl)"$(>:W)" $(.nl)-D$(DEFINES) $(.nl)"-I$(INCLUDES:W)" $(.nl)-U$(UNDEFS) $(.nl)$(MIDLFLAGS) $(.nl)/tlb "$(<[1]:W)" $(.nl)/h "$(<[2]:W)" $(.nl)/iid "$(<[3]:W)" $(.nl)/proxy "$(<[4]:W)" $(.nl)/dlldata "$(<[5]:W)")" + $(.SETUP) $(.IDL) /nologo @($(<[1]:W).rsp:<=@":>=":E="$(>:W)" -D$(DEFINES) "-I$(INCLUDES:W)" -U$(UNDEFS) $(MIDLFLAGS) /tlb "$(<[1]:W)" /h "$(<[2]:W)" /iid "$(<[3]:W)" /proxy "$(<[4]:W)" /dlldata "$(<[5]:W)") $(.TOUCH_FILE) "$(<[4]:W)" $(.TOUCH_FILE) "$(<[5]:W)" } @@ -846,7 +846,7 @@ rule link.dll ( targets + : sources * : properties * ) { actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)$(LIBRARIES) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")" + $(.SETUP) $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } actions manifest @@ -861,7 +861,7 @@ rule link.dll ( targets + : sources * : properties * ) actions link.dll bind IMPORT_LIB DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(IMPORT_LIB:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)$(LIBRARIES) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")" + $(.SETUP) $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(IMPORT_LIB:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } actions manifest.dll @@ -1694,8 +1694,8 @@ local rule default-path ( version ) rule get-rspline ( target : lang-opt ) { CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS) - $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(.nl)-D$(DEFINES) - $(.nl)\"-I$(INCLUDES:W)\" $(.nl)\"-FI$(FORCE_INCLUDES:W)\" ] ; + $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c -D$(DEFINES) + \"-I$(INCLUDES:W)\" \"-FI$(FORCE_INCLUDES:W)\" ] ; } class msvc-linking-generator : linking-generator @@ -1922,6 +1922,11 @@ local rule register-toolset-really ( ) toolset.flags msvc.archive AROPTIONS ; + # Enable response file control + toolset.flags msvc RESPONSE_FILE_SUB auto : a ; + toolset.flags msvc RESPONSE_FILE_SUB file : f ; + toolset.flags msvc RESPONSE_FILE_SUB contents : c ; + # Create a project to allow building the setup scripts project.initialize $(__name__) ; .project = [ project.current ] ; @@ -1990,6 +1995,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .RM = [ common.rm-command ] ; .nl = " " ; +_ = " " ; .ProgramFiles = [ path.make [ common.get-program-files-dir ] ] ; .escaped-double-quote = "\"" ; .TOUCH_FILE = [ common.file-touch-command ] ; From 4e26e133fab943a641c28921ad984ad074a2ee5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Mon, 14 Dec 2020 09:55:44 -0600 Subject: [PATCH 058/126] Fix coercion warning. --- src/engine/function.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 5219254a9a..8e5422ec0b 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -3994,7 +3994,7 @@ LIST * function_execute_write_file( char const * out = object_str( list_front( filename.inner ) ); OBJECT * tmp_filename = nullptr; FILE * out_file = nullptr; - bool out_debug = DEBUG_EXEC; + bool out_debug = DEBUG_EXEC != 0; /* For stdout/stderr we will create a temp file and generate a * command that outputs the content as needed. From c7016328c3af454925242f8b98da3918d1ea0815 Mon Sep 17 00:00:00 2001 From: Tanzinul Islam <11808226+tanzislam@users.noreply.github.com> Date: Mon, 14 Dec 2020 17:36:54 +0000 Subject: [PATCH 059/126] Update "borland" toolset to bcc32c for building B2 (#680) For bootstrapping `b2` itself, the current `borland` toolset is broken now as `bcc32.exe` doesn't support C++11. Update that toolset to use the Clang-based `bcc32c.exe`, which has largely the same cmdline args. --- src/engine/config_toolset.bat | 6 +++--- src/engine/guess_toolset.bat | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/engine/config_toolset.bat b/src/engine/config_toolset.bat index 00f5dbbe6e..f717e7800f 100644 --- a/src/engine/config_toolset.bat +++ b/src/engine/config_toolset.bat @@ -160,9 +160,9 @@ set "_known_=1" goto :eof :Config_BORLAND -if not defined CXX ( set "CXX=bcc32" ) +if not defined CXX ( set "CXX=bcc32c" ) if "_%B2_TOOLSET_ROOT%_" == "__" ( - call guess_toolset.bat test_path bcc32.exe ) + call guess_toolset.bat test_path bcc32c.exe ) if "_%B2_TOOLSET_ROOT%_" == "__" ( if not errorlevel 1 ( set "B2_TOOLSET_ROOT=%FOUND_PATH%..\" @@ -170,7 +170,7 @@ if "_%B2_TOOLSET_ROOT%_" == "__" ( if not "_%B2_TOOLSET_ROOT%_" == "__" ( set "PATH=%B2_TOOLSET_ROOT%Bin;%PATH%" ) -set "B2_CXX=%CXX% -tC -P -O2 -w- -I"%B2_TOOLSET_ROOT%Include" -L"%B2_TOOLSET_ROOT%Lib" -Nd -eb2" +set "B2_CXX=%CXX% -tC -P -O2 -w- -I"%B2_TOOLSET_ROOT%Include" -L"%B2_TOOLSET_ROOT%Lib" -eb2" set "_known_=1" goto :eof diff --git a/src/engine/guess_toolset.bat b/src/engine/guess_toolset.bat index 422e43d32e..7093327116 100644 --- a/src/engine/guess_toolset.bat +++ b/src/engine/guess_toolset.bat @@ -85,11 +85,7 @@ if not errorlevel 1 ( call "%FOUND_PATH%VCVARS32.BAT" set "B2_TOOLSET_ROOT=%MSVCDir%\" exit /b 0) -if EXIST "C:\Borland\BCC55\Bin\bcc32.exe" ( - set "B2_TOOLSET=borland" - set "B2_TOOLSET_ROOT=C:\Borland\BCC55\" - exit /b 0) -call :Test_Path bcc32.exe +call :Test_Path bcc32c.exe if not errorlevel 1 ( set "B2_TOOLSET=borland" set "B2_TOOLSET_ROOT=%FOUND_PATH%..\" From 25879fc24d96c89e817e7950ec92d6e2cb41e1b3 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 14 Dec 2020 20:37:32 +0100 Subject: [PATCH 060/126] Basic changes for GNU/Hurd (#676) * Define OSMINOR & OS_HURD on GNU/Hurd Add a way to identify GNU/Hurd with b2, and also in the Python support. * Use /proc/self/exe for executable_path on Hurd Use the Linux compatibility procfs translator to get the full path of the current executable. * Define _GNU_SOURCE on any GNU libc-based OS Make sure to enable GNU features when building on any OS that uses GNU libc. --- src/engine/jam.cpp | 2 +- src/engine/jam.h | 4 ++++ src/engine/sysinfo.cpp | 2 +- src/tools/builtin.py | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/engine/jam.cpp b/src/engine/jam.cpp index c419f1fa1e..76acdb6f79 100644 --- a/src/engine/jam.cpp +++ b/src/engine/jam.cpp @@ -747,7 +747,7 @@ char * executable_path( char const * argv0 ) sysctl( mib, 4, buf, &size, NULL, 0 ); return ( !size || size == sizeof( buf ) ) ? NULL : strndup( buf, size ); } -#elif defined(__linux__) || defined(__CYGWIN__) +#elif defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) # include char * executable_path( char const * argv0 ) { diff --git a/src/engine/jam.h b/src/engine/jam.h index 25e5736fda..f9f139582e 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -189,6 +189,10 @@ #define OSMINOR "OS=DGUX" #define OS_DGUX #endif +#ifdef __GNU__ + #define OSMINOR "OS=HURD" + #define OS_HURD +#endif #ifdef __hpux #define OSMINOR "OS=HPUX" #define OS_HPUX diff --git a/src/engine/sysinfo.cpp b/src/engine/sysinfo.cpp index c3257e71e0..fa2e3c1630 100644 --- a/src/engine/sysinfo.cpp +++ b/src/engine/sysinfo.cpp @@ -18,7 +18,7 @@ #include #endif -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(__GLIBC__) // Need to define this in case it's not as that's the only way to get the // sched_* APIs. #ifndef _GNU_SOURCE diff --git a/src/tools/builtin.py b/src/tools/builtin.py index 9eeaaf6976..ecec2c9e33 100644 --- a/src/tools/builtin.py +++ b/src/tools/builtin.py @@ -82,9 +82,9 @@ def variant (name, parents_or_properties, explicit_properties = []): feature.compose ("" + name, explicit_properties.all()) __os_names = """ - amiga aix appletv bsd cygwin darwin dos emx freebsd hpux iphone linux netbsd - openbsd osf qnx qnxnto sgi solaris sun sunos svr4 sysv ultrix unix unixware - vms windows + amiga aix appletv bsd cygwin darwin dos emx freebsd hpux hurd iphone linux + netbsd openbsd osf qnx qnxnto sgi solaris sun sunos svr4 sysv ultrix unix + unixware vms windows """.split() # Translates from bjam current OS to the os tags used in host-os and target-os, From f62f474ed336e1279505371946ae90e83b5252d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Thu, 17 Dec 2020 08:41:47 -0600 Subject: [PATCH 061/126] Fix use of mutiple conflicting @() in one action. In the case where multiple @() substitutions happen in one action the dynamic choice of file vs content would apply to all. This would cause problems as some of them might not be command options. This change adds an ":O=" options specifier to variables that can control what type of @() substitution can happen for each expansion. By specifying "O:=FC" one can select to allow either file or content expansion making that @() instance dynamic. When not specified the default is as if "O:=F". --- src/engine/function.cpp | 99 +++++++++++++++++++++++++++------------ src/tools/clang-linux.jam | 4 +- src/tools/msvc.jam | 19 ++++---- 3 files changed, 80 insertions(+), 42 deletions(-) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 8e5422ec0b..434b6ba8d0 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -622,23 +622,27 @@ typedef struct typedef struct { - PATHNAME f; /* :GDBSMR -- pieces */ - char parent; /* :P -- go to parent directory */ - char filemods; /* one of the above applied */ - char downshift; /* :L -- downshift result */ - char upshift; /* :U -- upshift result */ - char to_slashes; /* :T -- convert "\" to "/" */ - char to_windows; /* :W -- convert cygwin to native paths */ - PATHPART empty; /* :E -- default for empties */ - PATHPART join; /* :J -- join list with char */ - PATHPART prefix; /* :< */ - PATHPART postfix; /* :> */ + PATHNAME f; /* :GDBSMR -- pieces */ + PATHPART empty; /* :E -- default for empties */ + PATHPART join; /* :J -- join list with char */ + PATHPART prefix; /* :< */ + PATHPART postfix; /* :> */ + bool parent:1; /* :P -- go to parent directory */ + bool filemods:1; /* one of the above applied */ + bool downshift:1; /* :L -- downshift result */ + bool upshift:1; /* :U -- upshift result */ + bool to_slashes:1; /* :T -- convert "\" to "/" */ + bool to_windows:1; /* :W -- convert cygwin to native paths */ + bool opt_file:1; /* :O=F -- replace @() with the file part */ + bool opt_content:1; /* :O=C -- repalce @() with the content (E) part */ } VAR_EDITS; struct VAR_EXPANDED { LIST * value = L0; LIST * inner = L0; + bool opt_file:1; + bool opt_content:1; }; static VAR_EXPANDED apply_modifiers_impl( LIST * result, string * buf, @@ -688,6 +692,7 @@ static int32_t var_edit_parse( char const * mods, VAR_EDITS * edits, int32_t hav while ( *mods ) { PATHPART * fp; + bool opt = false; switch ( *mods++ ) { @@ -706,6 +711,7 @@ static int32_t var_edit_parse( char const * mods, VAR_EDITS * edits, int32_t hav case 'W': edits->to_windows = 1; continue; case '<': fp = &edits->prefix; goto strval; case '>': fp = &edits->postfix; goto strval; + case 'O': opt = true; goto strval; default: continue; /* Should complain, but so what... */ } @@ -735,17 +741,35 @@ static int32_t var_edit_parse( char const * mods, VAR_EDITS * edits, int32_t hav } strval: - /* Handle :X=value, or :X */ - if ( *mods != '=' ) + /* Handle :O=??? */ + if ( opt ) { - fp->ptr = ""; - fp->len = 0; + if ( *mods == '=' ) + { + for (++mods; *mods; ++mods) + { + switch ( *mods ) + { + case 'F': edits->opt_file = true; break; + case 'C': edits->opt_content = true; break; + } + } + } } else { - fp->ptr = ++mods; - fp->len = int32_t(strlen( mods )); - mods += fp->len; + /* Handle :X=value, or :X */ + if ( *mods != '=' ) + { + fp->ptr = ""; + fp->len = 0; + } + else + { + fp->ptr = ++mods; + fp->len = int32_t(strlen( mods )); + mods += fp->len; + } } } @@ -1150,6 +1174,13 @@ static VAR_EXPANDED apply_modifiers_impl( LIST * result, string * buf, expanded.value = apply_modifiers_prepost( L0, buf, edits, n, list_begin( modified ), list_end( modified ) ); expanded.inner = modified; + expanded.opt_file = false; + expanded.opt_content = false; + for ( int32_t i = 0; i < n; ++i ) + { + expanded.opt_file |= edits[i].opt_file; + expanded.opt_content |= edits[i].opt_content; + } return expanded; } @@ -3970,21 +4001,27 @@ LIST * function_execute_write_file( { LIST * filename_or_contents_result = nullptr; - LIST * response_file_sub = function_get_named_variable( - function, frame, constant_RESPONSE_FILE_SUB ); - char response_file_sub_c - = response_file_sub && list_front( response_file_sub ) - ? object_str( list_front( response_file_sub ) )[0] - : 'f'; - list_free( response_file_sub ); - const char * contents_str = object_str( list_front( contents ) ); - if ( response_file_sub_c == 'a' ) + char response_file_sub_c = 'f'; + if ( filename.opt_file && filename.opt_content ) { - if ( int32_t( strlen( contents_str ) + 256 ) > shell_maxline() ) - response_file_sub_c = 'f'; - else - response_file_sub_c = 'c'; + LIST * response_file_sub = function_get_named_variable( + function, frame, constant_RESPONSE_FILE_SUB ); + if ( response_file_sub && list_front( response_file_sub ) ) + response_file_sub_c = object_str( list_front( response_file_sub ) )[0]; + list_free( response_file_sub ); + const char * contents_str = object_str( list_front( contents ) ); + if ( response_file_sub_c == 'a' ) + { + if ( int32_t( strlen( contents_str ) + 256 ) > shell_maxline() ) + response_file_sub_c = 'f'; + else + response_file_sub_c = 'c'; + } } + else if ( filename.opt_file ) + response_file_sub_c = 'f'; + else if ( filename.opt_content ) + response_file_sub_c = 'c'; if ( response_file_sub_c == 'c' ) { filename_or_contents_result = list_copy( contents ); diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index aaeb2dc710..ca3bbcfd30 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -223,9 +223,9 @@ rule link.dll ( targets * : sources * : properties * ) { } actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:<=@":>=":E=-Wl,-R$(_)-Wl,"$(RPATH)" -Wl,-rpath-link$(_)-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) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:O=FC:<=@":>=":E=-Wl,-R$(_)-Wl,"$(RPATH)" -Wl,-rpath-link$(_)-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) } actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:<=@":>=":E=-Wl,-R$(_)-Wl,"$(RPATH)" $(SONAME_OPT)$(<[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) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:O=FC:<=@":>=":E=-Wl,-R$(_)-Wl,"$(RPATH)" $(SONAME_OPT)$(<[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) } diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 8c1f92316a..6f47851b61 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -587,7 +587,7 @@ if [ os.name ] in NT actions archive { if exist "$(<[1])" DEL "$(<[1])" - $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") + $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } } else @@ -595,7 +595,7 @@ else actions archive { $(.RM) "$(<[1])" - $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") + $(.SETUP) $(.LD) $(AROPTIONS) /out:"$(<[1])" @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } } @@ -668,12 +668,12 @@ toolset.flags msvc YLOPTION : "-Yl" ; # actions compile-c-c++ bind PDB_NAME { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE)) $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE)) $(.CC.FILTER) } actions preprocess-c-c++ bind PDB_NAME { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[1]:W)" -E $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" >"$(<[1]:W)" + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[1]:W)" -E $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" >"$(<[1]:W)" } rule compile-c-c++ ( targets + : sources * ) @@ -700,7 +700,7 @@ rule preprocess-c-c++ ( targets + : sources * ) # syntax highlighting in the messy N-quoted code below. actions compile-c-c++-pch { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) @($(<[1]:W).cpp:<=":>=":E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote)$(.nl)) $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) @($(<[1]:W).cpp:<=":>=":E=$(.hash)include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote)$(.nl)) $(.CC.FILTER) } @@ -709,7 +709,7 @@ actions compile-c-c++-pch # given as one of the source parameters. actions compile-c-c++-pch-s { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:<=@":>=":E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) $(.CC.FILTER) } @@ -754,7 +754,7 @@ rule compile.idl ( targets + : sources * : properties * ) # actions compile.idl { - $(.SETUP) $(.IDL) /nologo @($(<[1]:W).rsp:<=@":>=":E="$(>:W)" -D$(DEFINES) "-I$(INCLUDES:W)" -U$(UNDEFS) $(MIDLFLAGS) /tlb "$(<[1]:W)" /h "$(<[2]:W)" /iid "$(<[3]:W)" /proxy "$(<[4]:W)" /dlldata "$(<[5]:W)") + $(.SETUP) $(.IDL) /nologo @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>:W)" -D$(DEFINES) "-I$(INCLUDES:W)" -U$(UNDEFS) $(MIDLFLAGS) /tlb "$(<[1]:W)" /h "$(<[2]:W)" /iid "$(<[3]:W)" /proxy "$(<[4]:W)" /dlldata "$(<[5]:W)") $(.TOUCH_FILE) "$(<[4]:W)" $(.TOUCH_FILE) "$(<[5]:W)" } @@ -846,7 +846,7 @@ rule link.dll ( targets + : sources * : properties * ) { actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") + $(.SETUP) $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } actions manifest @@ -861,7 +861,7 @@ rule link.dll ( targets + : sources * : properties * ) actions link.dll bind IMPORT_LIB DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(IMPORT_LIB:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") + $(.SETUP) $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(IMPORT_LIB:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") } actions manifest.dll @@ -1998,6 +1998,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] _ = " " ; .ProgramFiles = [ path.make [ common.get-program-files-dir ] ] ; .escaped-double-quote = "\"" ; +.hash = "\#" ; .TOUCH_FILE = [ common.file-touch-command ] ; # List of all registered configurations. From 64a895a3314e152bef58cc912c1e375a3d202f79 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 17 Dec 2020 09:37:45 -0600 Subject: [PATCH 062/126] Adds redirection index.html file for Boost distro. --- doc/jamfile.jam | 13 +- src/engine/jamgram.cpp | 667 ++++++++++++++++------------------------- src/engine/jamgram.hpp | 2 +- 3 files changed, 272 insertions(+), 410 deletions(-) diff --git a/doc/jamfile.jam b/doc/jamfile.jam index 2583d3f02a..856a3fe169 100644 --- a/doc/jamfile.jam +++ b/doc/jamfile.jam @@ -62,6 +62,17 @@ explicit index ; install html : index : $(doc-dir) website-html ; explicit html ; +make index.html : : @make_redir_html : .. ; +actions make_redir_html +{ + echo @($(<):E= +Automatic redirection failed, please go to +doc/html/index.html. + +) +} +explicit index.html ; + alias standalone-html : html ; if $(website) @@ -117,5 +128,5 @@ actions website-publish alias boostdoc ; explicit boostdoc ; -alias boostrelease : standalone-html ; +alias boostrelease : standalone-html index.html ; explicit boostrelease ; diff --git a/src/engine/jamgram.cpp b/src/engine/jamgram.cpp index 2f7382dfae..4f3de0615f 100644 --- a/src/engine/jamgram.cpp +++ b/src/engine/jamgram.cpp @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.6.4. */ +/* A Bison parser, made by GNU Bison 3.7.2. */ /* Bison implementation for Yacc-like parsers in C @@ -49,7 +49,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.6.4" +#define YYBISON_VERSION "3.7.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -135,144 +135,7 @@ # endif # endif -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_YY_SRC_ENGINE_JAMGRAM_HPP_INCLUDED -# define YY_YY_SRC_ENGINE_JAMGRAM_HPP_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - _BANG_t = 258, /* _BANG_t */ - _BANG_EQUALS_t = 259, /* _BANG_EQUALS_t */ - _AMPER_t = 260, /* _AMPER_t */ - _AMPERAMPER_t = 261, /* _AMPERAMPER_t */ - _LPAREN_t = 262, /* _LPAREN_t */ - _RPAREN_t = 263, /* _RPAREN_t */ - _PLUS_EQUALS_t = 264, /* _PLUS_EQUALS_t */ - _COLON_t = 265, /* _COLON_t */ - _SEMIC_t = 266, /* _SEMIC_t */ - _LANGLE_t = 267, /* _LANGLE_t */ - _LANGLE_EQUALS_t = 268, /* _LANGLE_EQUALS_t */ - _EQUALS_t = 269, /* _EQUALS_t */ - _RANGLE_t = 270, /* _RANGLE_t */ - _RANGLE_EQUALS_t = 271, /* _RANGLE_EQUALS_t */ - _QUESTION_EQUALS_t = 272, /* _QUESTION_EQUALS_t */ - _LBRACKET_t = 273, /* _LBRACKET_t */ - _RBRACKET_t = 274, /* _RBRACKET_t */ - ACTIONS_t = 275, /* ACTIONS_t */ - BIND_t = 276, /* BIND_t */ - BREAK_t = 277, /* BREAK_t */ - CASE_t = 278, /* CASE_t */ - CLASS_t = 279, /* CLASS_t */ - CONTINUE_t = 280, /* CONTINUE_t */ - DEFAULT_t = 281, /* DEFAULT_t */ - ELSE_t = 282, /* ELSE_t */ - EXISTING_t = 283, /* EXISTING_t */ - FOR_t = 284, /* FOR_t */ - IF_t = 285, /* IF_t */ - IGNORE_t = 286, /* IGNORE_t */ - IN_t = 287, /* IN_t */ - INCLUDE_t = 288, /* INCLUDE_t */ - LOCAL_t = 289, /* LOCAL_t */ - MODULE_t = 290, /* MODULE_t */ - ON_t = 291, /* ON_t */ - PIECEMEAL_t = 292, /* PIECEMEAL_t */ - QUIETLY_t = 293, /* QUIETLY_t */ - RETURN_t = 294, /* RETURN_t */ - RULE_t = 295, /* RULE_t */ - SWITCH_t = 296, /* SWITCH_t */ - TOGETHER_t = 297, /* TOGETHER_t */ - UPDATED_t = 298, /* UPDATED_t */ - WHILE_t = 299, /* WHILE_t */ - _LBRACE_t = 300, /* _LBRACE_t */ - _BAR_t = 301, /* _BAR_t */ - _BARBAR_t = 302, /* _BARBAR_t */ - _RBRACE_t = 303, /* _RBRACE_t */ - ARG = 304, /* ARG */ - STRING = 305 /* STRING */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif -/* Token kinds. */ -#define YYEOF 0 -#define YYerror 256 -#define YYUNDEF 257 -#define _BANG_t 258 -#define _BANG_EQUALS_t 259 -#define _AMPER_t 260 -#define _AMPERAMPER_t 261 -#define _LPAREN_t 262 -#define _RPAREN_t 263 -#define _PLUS_EQUALS_t 264 -#define _COLON_t 265 -#define _SEMIC_t 266 -#define _LANGLE_t 267 -#define _LANGLE_EQUALS_t 268 -#define _EQUALS_t 269 -#define _RANGLE_t 270 -#define _RANGLE_EQUALS_t 271 -#define _QUESTION_EQUALS_t 272 -#define _LBRACKET_t 273 -#define _RBRACKET_t 274 -#define ACTIONS_t 275 -#define BIND_t 276 -#define BREAK_t 277 -#define CASE_t 278 -#define CLASS_t 279 -#define CONTINUE_t 280 -#define DEFAULT_t 281 -#define ELSE_t 282 -#define EXISTING_t 283 -#define FOR_t 284 -#define IF_t 285 -#define IGNORE_t 286 -#define IN_t 287 -#define INCLUDE_t 288 -#define LOCAL_t 289 -#define MODULE_t 290 -#define ON_t 291 -#define PIECEMEAL_t 292 -#define QUIETLY_t 293 -#define RETURN_t 294 -#define RULE_t 295 -#define SWITCH_t 296 -#define TOGETHER_t 297 -#define UPDATED_t 298 -#define WHILE_t 299 -#define _LBRACE_t 300 -#define _BAR_t 301 -#define _BARBAR_t 302 -#define _RBRACE_t 303 -#define ARG 304 -#define STRING 305 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_SRC_ENGINE_JAMGRAM_HPP_INCLUDED */ +#include "jamgram.hpp" /* Symbol kind. */ enum yysymbol_kind_t { @@ -716,6 +579,7 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 207 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 305 @@ -1258,7 +1122,7 @@ yydestruct (const char *yymsg, } -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1276,34 +1140,30 @@ int yynerrs; int yyparse (void) { - yy_state_fast_t yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + int yyerrstatus = 0; - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ - YYPTRDIFF_T yystacksize; + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The state stack. */ + /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ + /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ @@ -1317,15 +1177,6 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yynerrs = 0; - yystate = 0; - yyerrstatus = 0; - - yystacksize = YYINITDEPTH; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - - YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ @@ -1526,722 +1377,722 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 3: + case 3: /* run: rules */ #line 148 "src/engine/jamgram.y" { parse_save( yyvsp[0].parse ); } -#line 1533 "src/engine/jamgram.cpp" +#line 1384 "src/engine/jamgram.cpp" break; - case 4: + case 4: /* block: null */ #line 159 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1539 "src/engine/jamgram.cpp" +#line 1390 "src/engine/jamgram.cpp" break; - case 5: + case 5: /* block: rules */ #line 161 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1545 "src/engine/jamgram.cpp" +#line 1396 "src/engine/jamgram.cpp" break; - case 6: + case 6: /* rules: rule */ #line 165 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1551 "src/engine/jamgram.cpp" +#line 1402 "src/engine/jamgram.cpp" break; - case 7: + case 7: /* rules: rule rules */ #line 167 "src/engine/jamgram.y" { yyval.parse = prules( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 1557 "src/engine/jamgram.cpp" +#line 1408 "src/engine/jamgram.cpp" break; - case 8: + case 8: /* $@1: %empty */ #line 168 "src/engine/jamgram.y" { yymode( SCAN_ASSIGN ); } -#line 1563 "src/engine/jamgram.cpp" +#line 1414 "src/engine/jamgram.cpp" break; - case 9: + case 9: /* $@2: %empty */ #line 168 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1569 "src/engine/jamgram.cpp" +#line 1420 "src/engine/jamgram.cpp" break; - case 10: + case 10: /* rules: LOCAL_t $@1 list assign_list_opt _SEMIC_t $@2 block */ #line 169 "src/engine/jamgram.y" { yyval.parse = plocal( yyvsp[-4].parse, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1575 "src/engine/jamgram.cpp" +#line 1426 "src/engine/jamgram.cpp" break; - case 11: + case 11: /* null: %empty */ #line 173 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 1581 "src/engine/jamgram.cpp" +#line 1432 "src/engine/jamgram.cpp" break; - case 12: + case 12: /* $@3: %empty */ #line 176 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1587 "src/engine/jamgram.cpp" +#line 1438 "src/engine/jamgram.cpp" break; - case 13: + case 13: /* assign_list_opt: _EQUALS_t $@3 list */ #line 177 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; yyval.number = ASSIGN_SET; } -#line 1593 "src/engine/jamgram.cpp" +#line 1444 "src/engine/jamgram.cpp" break; - case 14: + case 14: /* assign_list_opt: null */ #line 179 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; yyval.number = ASSIGN_APPEND; } -#line 1599 "src/engine/jamgram.cpp" +#line 1450 "src/engine/jamgram.cpp" break; - case 15: + case 15: /* arglist_opt: _LPAREN_t lol _RPAREN_t */ #line 183 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; } -#line 1605 "src/engine/jamgram.cpp" +#line 1456 "src/engine/jamgram.cpp" break; - case 16: + case 16: /* arglist_opt: %empty */ #line 185 "src/engine/jamgram.y" { yyval.parse = P0; } -#line 1611 "src/engine/jamgram.cpp" +#line 1462 "src/engine/jamgram.cpp" break; - case 17: + case 17: /* local_opt: LOCAL_t */ #line 189 "src/engine/jamgram.y" { yyval.number = 1; } -#line 1617 "src/engine/jamgram.cpp" +#line 1468 "src/engine/jamgram.cpp" break; - case 18: + case 18: /* local_opt: %empty */ #line 191 "src/engine/jamgram.y" { yyval.number = 0; } -#line 1623 "src/engine/jamgram.cpp" +#line 1474 "src/engine/jamgram.cpp" break; - case 19: + case 19: /* else_opt: ELSE_t rule */ #line 195 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 1629 "src/engine/jamgram.cpp" +#line 1480 "src/engine/jamgram.cpp" break; - case 20: + case 20: /* else_opt: %empty */ #line 197 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 1635 "src/engine/jamgram.cpp" +#line 1486 "src/engine/jamgram.cpp" break; - case 21: + case 21: /* rule: _LBRACE_t block _RBRACE_t */ #line 200 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; } -#line 1641 "src/engine/jamgram.cpp" +#line 1492 "src/engine/jamgram.cpp" break; - case 22: + case 22: /* $@4: %empty */ #line 201 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1647 "src/engine/jamgram.cpp" +#line 1498 "src/engine/jamgram.cpp" break; - case 23: + case 23: /* rule: INCLUDE_t $@4 list _SEMIC_t */ #line 202 "src/engine/jamgram.y" { yyval.parse = pincl( yyvsp[-1].parse ); yymode( SCAN_NORMAL ); } -#line 1653 "src/engine/jamgram.cpp" +#line 1504 "src/engine/jamgram.cpp" break; - case 24: + case 24: /* $@5: %empty */ #line 203 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1659 "src/engine/jamgram.cpp" +#line 1510 "src/engine/jamgram.cpp" break; - case 25: + case 25: /* rule: ARG $@5 lol _SEMIC_t */ #line 204 "src/engine/jamgram.y" { yyval.parse = prule( yyvsp[-3].string, yyvsp[-1].parse ); yymode( SCAN_NORMAL ); } -#line 1665 "src/engine/jamgram.cpp" +#line 1516 "src/engine/jamgram.cpp" break; - case 26: + case 26: /* $@6: %empty */ #line 205 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1671 "src/engine/jamgram.cpp" +#line 1522 "src/engine/jamgram.cpp" break; - case 27: + case 27: /* rule: arg assign $@6 list _SEMIC_t */ #line 206 "src/engine/jamgram.y" { yyval.parse = pset( yyvsp[-4].parse, yyvsp[-1].parse, yyvsp[-3].number ); yymode( SCAN_NORMAL ); } -#line 1677 "src/engine/jamgram.cpp" +#line 1528 "src/engine/jamgram.cpp" break; - case 28: + case 28: /* $@7: %empty */ #line 207 "src/engine/jamgram.y" { yymode( SCAN_ASSIGN ); } -#line 1683 "src/engine/jamgram.cpp" +#line 1534 "src/engine/jamgram.cpp" break; - case 29: + case 29: /* $@8: %empty */ #line 207 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1689 "src/engine/jamgram.cpp" +#line 1540 "src/engine/jamgram.cpp" break; - case 30: + case 30: /* rule: arg ON_t $@7 list assign $@8 list _SEMIC_t */ #line 208 "src/engine/jamgram.y" { yyval.parse = pset1( yyvsp[-7].parse, yyvsp[-4].parse, yyvsp[-1].parse, yyvsp[-3].number ); yymode( SCAN_NORMAL ); } -#line 1695 "src/engine/jamgram.cpp" +#line 1546 "src/engine/jamgram.cpp" break; - case 31: + case 31: /* $@9: %empty */ #line 209 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1701 "src/engine/jamgram.cpp" +#line 1552 "src/engine/jamgram.cpp" break; - case 32: + case 32: /* rule: RETURN_t $@9 list _SEMIC_t */ #line 210 "src/engine/jamgram.y" { yyval.parse = preturn( yyvsp[-1].parse ); yymode( SCAN_NORMAL ); } -#line 1707 "src/engine/jamgram.cpp" +#line 1558 "src/engine/jamgram.cpp" break; - case 33: + case 33: /* rule: BREAK_t _SEMIC_t */ #line 212 "src/engine/jamgram.y" { yyval.parse = pbreak(); } -#line 1713 "src/engine/jamgram.cpp" +#line 1564 "src/engine/jamgram.cpp" break; - case 34: + case 34: /* rule: CONTINUE_t _SEMIC_t */ #line 214 "src/engine/jamgram.y" { yyval.parse = pcontinue(); } -#line 1719 "src/engine/jamgram.cpp" +#line 1570 "src/engine/jamgram.cpp" break; - case 35: + case 35: /* $@10: %empty */ #line 215 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1725 "src/engine/jamgram.cpp" +#line 1576 "src/engine/jamgram.cpp" break; - case 36: + case 36: /* $@11: %empty */ #line 215 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1731 "src/engine/jamgram.cpp" +#line 1582 "src/engine/jamgram.cpp" break; - case 37: + case 37: /* rule: FOR_t local_opt ARG IN_t $@10 list _LBRACE_t $@11 block _RBRACE_t */ #line 216 "src/engine/jamgram.y" { yyval.parse = pfor( yyvsp[-7].string, yyvsp[-4].parse, yyvsp[-1].parse, yyvsp[-8].number ); } -#line 1737 "src/engine/jamgram.cpp" +#line 1588 "src/engine/jamgram.cpp" break; - case 38: + case 38: /* $@12: %empty */ #line 217 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1743 "src/engine/jamgram.cpp" +#line 1594 "src/engine/jamgram.cpp" break; - case 39: + case 39: /* $@13: %empty */ #line 217 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1749 "src/engine/jamgram.cpp" +#line 1600 "src/engine/jamgram.cpp" break; - case 40: + case 40: /* rule: SWITCH_t $@12 list _LBRACE_t $@13 cases _RBRACE_t */ #line 218 "src/engine/jamgram.y" { yyval.parse = pswitch( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1755 "src/engine/jamgram.cpp" +#line 1606 "src/engine/jamgram.cpp" break; - case 41: + case 41: /* $@14: %empty */ #line 219 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1761 "src/engine/jamgram.cpp" +#line 1612 "src/engine/jamgram.cpp" break; - case 42: + case 42: /* $@15: %empty */ #line 219 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1767 "src/engine/jamgram.cpp" +#line 1618 "src/engine/jamgram.cpp" break; - case 43: + case 43: /* rule: IF_t $@14 expr _LBRACE_t $@15 block _RBRACE_t else_opt */ #line 220 "src/engine/jamgram.y" { yyval.parse = pif( yyvsp[-5].parse, yyvsp[-2].parse, yyvsp[0].parse ); } -#line 1773 "src/engine/jamgram.cpp" +#line 1624 "src/engine/jamgram.cpp" break; - case 44: + case 44: /* $@16: %empty */ #line 221 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1779 "src/engine/jamgram.cpp" +#line 1630 "src/engine/jamgram.cpp" break; - case 45: + case 45: /* $@17: %empty */ #line 221 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1785 "src/engine/jamgram.cpp" +#line 1636 "src/engine/jamgram.cpp" break; - case 46: + case 46: /* rule: MODULE_t $@16 list _LBRACE_t $@17 block _RBRACE_t */ #line 222 "src/engine/jamgram.y" { yyval.parse = pmodule( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1791 "src/engine/jamgram.cpp" +#line 1642 "src/engine/jamgram.cpp" break; - case 47: + case 47: /* $@18: %empty */ #line 223 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1797 "src/engine/jamgram.cpp" +#line 1648 "src/engine/jamgram.cpp" break; - case 48: + case 48: /* $@19: %empty */ #line 223 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1803 "src/engine/jamgram.cpp" +#line 1654 "src/engine/jamgram.cpp" break; - case 49: + case 49: /* rule: CLASS_t $@18 lol _LBRACE_t $@19 block _RBRACE_t */ #line 224 "src/engine/jamgram.y" { yyval.parse = pclass( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1809 "src/engine/jamgram.cpp" +#line 1660 "src/engine/jamgram.cpp" break; - case 50: + case 50: /* $@20: %empty */ #line 225 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1815 "src/engine/jamgram.cpp" +#line 1666 "src/engine/jamgram.cpp" break; - case 51: + case 51: /* $@21: %empty */ #line 225 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1821 "src/engine/jamgram.cpp" +#line 1672 "src/engine/jamgram.cpp" break; - case 52: + case 52: /* rule: WHILE_t $@20 expr $@21 _LBRACE_t block _RBRACE_t */ #line 226 "src/engine/jamgram.y" { yyval.parse = pwhile( yyvsp[-4].parse, yyvsp[-1].parse ); } -#line 1827 "src/engine/jamgram.cpp" +#line 1678 "src/engine/jamgram.cpp" break; - case 53: + case 53: /* $@22: %empty */ #line 227 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 1833 "src/engine/jamgram.cpp" +#line 1684 "src/engine/jamgram.cpp" break; - case 54: + case 54: /* $@23: %empty */ #line 227 "src/engine/jamgram.y" { yymode( SCAN_PARAMS ); } -#line 1839 "src/engine/jamgram.cpp" +#line 1690 "src/engine/jamgram.cpp" break; - case 55: + case 55: /* $@24: %empty */ #line 227 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1845 "src/engine/jamgram.cpp" +#line 1696 "src/engine/jamgram.cpp" break; - case 56: + case 56: /* rule: local_opt RULE_t $@22 ARG $@23 arglist_opt $@24 rule */ #line 228 "src/engine/jamgram.y" { yyval.parse = psetc( yyvsp[-4].string, yyvsp[0].parse, yyvsp[-2].parse, yyvsp[-7].number ); } -#line 1851 "src/engine/jamgram.cpp" +#line 1702 "src/engine/jamgram.cpp" break; - case 57: + case 57: /* rule: ON_t arg rule */ #line 230 "src/engine/jamgram.y" { yyval.parse = pon( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 1857 "src/engine/jamgram.cpp" +#line 1708 "src/engine/jamgram.cpp" break; - case 58: + case 58: /* $@25: %empty */ #line 232 "src/engine/jamgram.y" { yymode( SCAN_STRING ); } -#line 1863 "src/engine/jamgram.cpp" +#line 1714 "src/engine/jamgram.cpp" break; - case 59: + case 59: /* $@26: %empty */ #line 234 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 1869 "src/engine/jamgram.cpp" +#line 1720 "src/engine/jamgram.cpp" break; - case 60: + case 60: /* rule: ACTIONS_t eflags ARG bindlist _LBRACE_t $@25 STRING $@26 _RBRACE_t */ #line 236 "src/engine/jamgram.y" { yyval.parse = psete( yyvsp[-6].string,yyvsp[-5].parse,yyvsp[-2].string,yyvsp[-7].number ); } -#line 1875 "src/engine/jamgram.cpp" +#line 1726 "src/engine/jamgram.cpp" break; - case 61: + case 61: /* assign: _EQUALS_t */ #line 244 "src/engine/jamgram.y" { yyval.number = ASSIGN_SET; } -#line 1881 "src/engine/jamgram.cpp" +#line 1732 "src/engine/jamgram.cpp" break; - case 62: + case 62: /* assign: _PLUS_EQUALS_t */ #line 246 "src/engine/jamgram.y" { yyval.number = ASSIGN_APPEND; } -#line 1887 "src/engine/jamgram.cpp" +#line 1738 "src/engine/jamgram.cpp" break; - case 63: + case 63: /* assign: _QUESTION_EQUALS_t */ #line 248 "src/engine/jamgram.y" { yyval.number = ASSIGN_DEFAULT; } -#line 1893 "src/engine/jamgram.cpp" +#line 1744 "src/engine/jamgram.cpp" break; - case 64: + case 64: /* assign: DEFAULT_t _EQUALS_t */ #line 250 "src/engine/jamgram.y" { yyval.number = ASSIGN_DEFAULT; } -#line 1899 "src/engine/jamgram.cpp" +#line 1750 "src/engine/jamgram.cpp" break; - case 65: + case 65: /* expr: arg */ #line 257 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_EXISTS, yyvsp[0].parse, pnull() ); yymode( SCAN_COND ); } -#line 1905 "src/engine/jamgram.cpp" +#line 1756 "src/engine/jamgram.cpp" break; - case 66: + case 66: /* $@27: %empty */ #line 258 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1911 "src/engine/jamgram.cpp" +#line 1762 "src/engine/jamgram.cpp" break; - case 67: + case 67: /* expr: expr _EQUALS_t $@27 expr */ #line 259 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_EQUALS, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1917 "src/engine/jamgram.cpp" +#line 1768 "src/engine/jamgram.cpp" break; - case 68: + case 68: /* $@28: %empty */ #line 260 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1923 "src/engine/jamgram.cpp" +#line 1774 "src/engine/jamgram.cpp" break; - case 69: + case 69: /* expr: expr _BANG_EQUALS_t $@28 expr */ #line 261 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_NOTEQ, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1929 "src/engine/jamgram.cpp" +#line 1780 "src/engine/jamgram.cpp" break; - case 70: + case 70: /* $@29: %empty */ #line 262 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1935 "src/engine/jamgram.cpp" +#line 1786 "src/engine/jamgram.cpp" break; - case 71: + case 71: /* expr: expr _LANGLE_t $@29 expr */ #line 263 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_LESS, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1941 "src/engine/jamgram.cpp" +#line 1792 "src/engine/jamgram.cpp" break; - case 72: + case 72: /* $@30: %empty */ #line 264 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1947 "src/engine/jamgram.cpp" +#line 1798 "src/engine/jamgram.cpp" break; - case 73: + case 73: /* expr: expr _LANGLE_EQUALS_t $@30 expr */ #line 265 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_LESSEQ, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1953 "src/engine/jamgram.cpp" +#line 1804 "src/engine/jamgram.cpp" break; - case 74: + case 74: /* $@31: %empty */ #line 266 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1959 "src/engine/jamgram.cpp" +#line 1810 "src/engine/jamgram.cpp" break; - case 75: + case 75: /* expr: expr _RANGLE_t $@31 expr */ #line 267 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_MORE, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1965 "src/engine/jamgram.cpp" +#line 1816 "src/engine/jamgram.cpp" break; - case 76: + case 76: /* $@32: %empty */ #line 268 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1971 "src/engine/jamgram.cpp" +#line 1822 "src/engine/jamgram.cpp" break; - case 77: + case 77: /* expr: expr _RANGLE_EQUALS_t $@32 expr */ #line 269 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_MOREEQ, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1977 "src/engine/jamgram.cpp" +#line 1828 "src/engine/jamgram.cpp" break; - case 78: + case 78: /* $@33: %empty */ #line 270 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1983 "src/engine/jamgram.cpp" +#line 1834 "src/engine/jamgram.cpp" break; - case 79: + case 79: /* expr: expr _AMPER_t $@33 expr */ #line 271 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_AND, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 1989 "src/engine/jamgram.cpp" +#line 1840 "src/engine/jamgram.cpp" break; - case 80: + case 80: /* $@34: %empty */ #line 272 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 1995 "src/engine/jamgram.cpp" +#line 1846 "src/engine/jamgram.cpp" break; - case 81: + case 81: /* expr: expr _AMPERAMPER_t $@34 expr */ #line 273 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_AND, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2001 "src/engine/jamgram.cpp" +#line 1852 "src/engine/jamgram.cpp" break; - case 82: + case 82: /* $@35: %empty */ #line 274 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2007 "src/engine/jamgram.cpp" +#line 1858 "src/engine/jamgram.cpp" break; - case 83: + case 83: /* expr: expr _BAR_t $@35 expr */ #line 275 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_OR, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2013 "src/engine/jamgram.cpp" +#line 1864 "src/engine/jamgram.cpp" break; - case 84: + case 84: /* $@36: %empty */ #line 276 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2019 "src/engine/jamgram.cpp" +#line 1870 "src/engine/jamgram.cpp" break; - case 85: + case 85: /* expr: expr _BARBAR_t $@36 expr */ #line 277 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_OR, yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2025 "src/engine/jamgram.cpp" +#line 1876 "src/engine/jamgram.cpp" break; - case 86: + case 86: /* $@37: %empty */ #line 278 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2031 "src/engine/jamgram.cpp" +#line 1882 "src/engine/jamgram.cpp" break; - case 87: + case 87: /* expr: arg IN_t $@37 list */ #line 279 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_IN, yyvsp[-3].parse, yyvsp[0].parse ); yymode( SCAN_COND ); } -#line 2037 "src/engine/jamgram.cpp" +#line 1888 "src/engine/jamgram.cpp" break; - case 88: + case 88: /* $@38: %empty */ #line 280 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2043 "src/engine/jamgram.cpp" +#line 1894 "src/engine/jamgram.cpp" break; - case 89: + case 89: /* expr: _BANG_t $@38 expr */ #line 281 "src/engine/jamgram.y" { yyval.parse = peval( EXPR_NOT, yyvsp[0].parse, pnull() ); } -#line 2049 "src/engine/jamgram.cpp" +#line 1900 "src/engine/jamgram.cpp" break; - case 90: + case 90: /* $@39: %empty */ #line 282 "src/engine/jamgram.y" { yymode( SCAN_CONDB ); } -#line 2055 "src/engine/jamgram.cpp" +#line 1906 "src/engine/jamgram.cpp" break; - case 91: + case 91: /* expr: _LPAREN_t $@39 expr _RPAREN_t */ #line 283 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; } -#line 2061 "src/engine/jamgram.cpp" +#line 1912 "src/engine/jamgram.cpp" break; - case 92: + case 92: /* cases: %empty */ #line 294 "src/engine/jamgram.y" { yyval.parse = P0; } -#line 2067 "src/engine/jamgram.cpp" +#line 1918 "src/engine/jamgram.cpp" break; - case 93: + case 93: /* cases: case cases */ #line 296 "src/engine/jamgram.y" { yyval.parse = pnode( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 2073 "src/engine/jamgram.cpp" +#line 1924 "src/engine/jamgram.cpp" break; - case 94: + case 94: /* $@40: %empty */ #line 299 "src/engine/jamgram.y" { yymode( SCAN_CASE ); } -#line 2079 "src/engine/jamgram.cpp" +#line 1930 "src/engine/jamgram.cpp" break; - case 95: + case 95: /* $@41: %empty */ #line 299 "src/engine/jamgram.y" { yymode( SCAN_NORMAL ); } -#line 2085 "src/engine/jamgram.cpp" +#line 1936 "src/engine/jamgram.cpp" break; - case 96: + case 96: /* case: CASE_t $@40 ARG _COLON_t $@41 block */ #line 300 "src/engine/jamgram.y" { yyval.parse = psnode( yyvsp[-3].string, yyvsp[0].parse ); } -#line 2091 "src/engine/jamgram.cpp" +#line 1942 "src/engine/jamgram.cpp" break; - case 97: + case 97: /* lol: list */ #line 309 "src/engine/jamgram.y" { yyval.parse = pnode( P0, yyvsp[0].parse ); } -#line 2097 "src/engine/jamgram.cpp" +#line 1948 "src/engine/jamgram.cpp" break; - case 98: + case 98: /* lol: list _COLON_t lol */ #line 311 "src/engine/jamgram.y" { yyval.parse = pnode( yyvsp[0].parse, yyvsp[-2].parse ); } -#line 2103 "src/engine/jamgram.cpp" +#line 1954 "src/engine/jamgram.cpp" break; - case 99: + case 99: /* list: listp */ #line 321 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 2109 "src/engine/jamgram.cpp" +#line 1960 "src/engine/jamgram.cpp" break; - case 100: + case 100: /* listp: %empty */ #line 325 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 2115 "src/engine/jamgram.cpp" +#line 1966 "src/engine/jamgram.cpp" break; - case 101: + case 101: /* listp: listp arg */ #line 327 "src/engine/jamgram.y" { yyval.parse = pappend( yyvsp[-1].parse, yyvsp[0].parse ); } -#line 2121 "src/engine/jamgram.cpp" +#line 1972 "src/engine/jamgram.cpp" break; - case 102: + case 102: /* arg: ARG */ #line 331 "src/engine/jamgram.y" { yyval.parse = plist( yyvsp[0].string ); } -#line 2127 "src/engine/jamgram.cpp" +#line 1978 "src/engine/jamgram.cpp" break; - case 103: + case 103: /* @42: %empty */ #line 332 "src/engine/jamgram.y" { yyval.number = yymode( SCAN_CALL ); } -#line 2133 "src/engine/jamgram.cpp" +#line 1984 "src/engine/jamgram.cpp" break; - case 104: + case 104: /* arg: _LBRACKET_t @42 func _RBRACKET_t */ #line 333 "src/engine/jamgram.y" { yyval.parse = yyvsp[-1].parse; yymode( yyvsp[-2].number ); } -#line 2139 "src/engine/jamgram.cpp" +#line 1990 "src/engine/jamgram.cpp" break; - case 105: + case 105: /* $@43: %empty */ #line 341 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2145 "src/engine/jamgram.cpp" +#line 1996 "src/engine/jamgram.cpp" break; - case 106: + case 106: /* func: ARG $@43 lol */ #line 342 "src/engine/jamgram.y" { yyval.parse = prule( yyvsp[-2].string, yyvsp[0].parse ); } -#line 2151 "src/engine/jamgram.cpp" +#line 2002 "src/engine/jamgram.cpp" break; - case 107: + case 107: /* $@44: %empty */ #line 343 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2157 "src/engine/jamgram.cpp" +#line 2008 "src/engine/jamgram.cpp" break; - case 108: + case 108: /* func: ON_t arg ARG $@44 lol */ #line 344 "src/engine/jamgram.y" { yyval.parse = pon( yyvsp[-3].parse, prule( yyvsp[-2].string, yyvsp[0].parse ) ); } -#line 2163 "src/engine/jamgram.cpp" +#line 2014 "src/engine/jamgram.cpp" break; - case 109: + case 109: /* $@45: %empty */ #line 345 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2169 "src/engine/jamgram.cpp" +#line 2020 "src/engine/jamgram.cpp" break; - case 110: + case 110: /* func: ON_t arg RETURN_t $@45 list */ #line 346 "src/engine/jamgram.y" { yyval.parse = pon( yyvsp[-3].parse, yyvsp[0].parse ); } -#line 2175 "src/engine/jamgram.cpp" +#line 2026 "src/engine/jamgram.cpp" break; - case 111: + case 111: /* eflags: %empty */ #line 356 "src/engine/jamgram.y" { yyval.number = 0; } -#line 2181 "src/engine/jamgram.cpp" +#line 2032 "src/engine/jamgram.cpp" break; - case 112: + case 112: /* eflags: eflags eflag */ #line 358 "src/engine/jamgram.y" { yyval.number = yyvsp[-1].number | yyvsp[0].number; } -#line 2187 "src/engine/jamgram.cpp" +#line 2038 "src/engine/jamgram.cpp" break; - case 113: + case 113: /* eflag: UPDATED_t */ #line 362 "src/engine/jamgram.y" { yyval.number = EXEC_UPDATED; } -#line 2193 "src/engine/jamgram.cpp" +#line 2044 "src/engine/jamgram.cpp" break; - case 114: + case 114: /* eflag: TOGETHER_t */ #line 364 "src/engine/jamgram.y" { yyval.number = EXEC_TOGETHER; } -#line 2199 "src/engine/jamgram.cpp" +#line 2050 "src/engine/jamgram.cpp" break; - case 115: + case 115: /* eflag: IGNORE_t */ #line 366 "src/engine/jamgram.y" { yyval.number = EXEC_IGNORE; } -#line 2205 "src/engine/jamgram.cpp" +#line 2056 "src/engine/jamgram.cpp" break; - case 116: + case 116: /* eflag: QUIETLY_t */ #line 368 "src/engine/jamgram.y" { yyval.number = EXEC_QUIETLY; } -#line 2211 "src/engine/jamgram.cpp" +#line 2062 "src/engine/jamgram.cpp" break; - case 117: + case 117: /* eflag: PIECEMEAL_t */ #line 370 "src/engine/jamgram.y" { yyval.number = EXEC_PIECEMEAL; } -#line 2217 "src/engine/jamgram.cpp" +#line 2068 "src/engine/jamgram.cpp" break; - case 118: + case 118: /* eflag: EXISTING_t */ #line 372 "src/engine/jamgram.y" { yyval.number = EXEC_EXISTING; } -#line 2223 "src/engine/jamgram.cpp" +#line 2074 "src/engine/jamgram.cpp" break; - case 119: + case 119: /* bindlist: %empty */ #line 381 "src/engine/jamgram.y" { yyval.parse = pnull(); } -#line 2229 "src/engine/jamgram.cpp" +#line 2080 "src/engine/jamgram.cpp" break; - case 120: + case 120: /* $@46: %empty */ #line 382 "src/engine/jamgram.y" { yymode( SCAN_PUNCT ); } -#line 2235 "src/engine/jamgram.cpp" +#line 2086 "src/engine/jamgram.cpp" break; - case 121: + case 121: /* bindlist: BIND_t $@46 list */ #line 383 "src/engine/jamgram.y" { yyval.parse = yyvsp[0].parse; } -#line 2241 "src/engine/jamgram.cpp" +#line 2092 "src/engine/jamgram.cpp" break; -#line 2245 "src/engine/jamgram.cpp" +#line 2096 "src/engine/jamgram.cpp" default: break; } @@ -2401,13 +2252,13 @@ yyparse (void) yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ + goto yyreturn; #endif -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ +/*-------------------------------------------------------. +| yyreturn -- parsing is finished, clean up and return. | +`-------------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { diff --git a/src/engine/jamgram.hpp b/src/engine/jamgram.hpp index 325bbe1419..48e84c194f 100644 --- a/src/engine/jamgram.hpp +++ b/src/engine/jamgram.hpp @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.6.4. */ +/* A Bison parser, made by GNU Bison 3.7.2. */ /* Bison interface for Yacc-like parsers in C From 02bf50d3f75edb8aff3e753ea7a55bbdf1e62e8b Mon Sep 17 00:00:00 2001 From: WindR Date: Sun, 20 Dec 2020 18:47:58 +0300 Subject: [PATCH 063/126] Fix broken Visual Studio 2019 support (#688) Microsoft still releases VS 2019 Previews, no need to drop their support yet. --- src/engine/vswhere_usability_wrapper.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/vswhere_usability_wrapper.cmd b/src/engine/vswhere_usability_wrapper.cmd index bc5c60528c..b9d9172311 100644 --- a/src/engine/vswhere_usability_wrapper.cmd +++ b/src/engine/vswhere_usability_wrapper.cmd @@ -32,7 +32,7 @@ for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do ( REM Visual Studio 2019 (16.X, toolset 14.2) set VSWHERE_LMT=-version "[16.0,17.0)" -SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% +SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% %VSWHERE_PRERELEASE% for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do ( endlocal echo Found with vswhere %%i @@ -57,4 +57,4 @@ for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do ( :no-vswhere endlocal echo could not find "vswhere" -exit /B 1 \ No newline at end of file +exit /B 1 From 714840f36f0cf7fdc9cbed270bdc2064bf68dd73 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 21 Dec 2020 21:08:12 -0600 Subject: [PATCH 064/126] Add documentation for response-file feature. --- doc/src/bjam.adoc | 29 +++++++++++++++++++- doc/src/history.adoc | 13 +++++++++ doc/src/reference.adoc | 1 + src/tools/features/response-file-feature.jam | 4 ++- test/core_at_file.py | 5 ++-- 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/doc/src/bjam.adoc b/doc/src/bjam.adoc index 2404c20dbc..612ef74be3 100644 --- a/doc/src/bjam.adoc +++ b/doc/src/bjam.adoc @@ -1355,8 +1355,20 @@ Assign _value_ to the variable if it is unset. Concatenate list elements into single element, separated by _joinval_. +`:O=value`:: +Sets semantic options for the evaluation of the variable. The format of the +_value_ is specific to either variable or generated file expansion. + On VMS, `$(var:P)` is the parent directory of `$(var:D)`. +`:<=value`:: +After evaluating the expansion of the variable prefixes the given _value_ +to the elements of the expanded expression values. + +`:>=value`:: +After evaluating the expansion of the variable postfixes the given _value_ +to the elements of the expanded expression values. + [[jam.language.variables.local_for_loop_variables]] ==== Local For Loop Variables @@ -1383,7 +1395,22 @@ the form `@(filename:E=filecontents)` and replaces the expression with `filecontents`. This is useful for creating compiler response files, and other "internal" files. The expansion works both during parsing and action execution. Hence it is possible to create files during any of the -three build phases. +three build phases. This expansion follows the same modifiers as variable +expansion. The generated file expansion accepts these (`:O=`) expansion +option values: + +`F`:: +Always replace the `@()` reference with the name of the file generated. + +`C`:: +Always replace the `@()` reference with the contents, i.e. the _value_ +in the `:E=value` expression. + +`FC` or `CF`:: +Replace with either the file or contents depending on the length of the +contents (`:E=value`). It will replace with the contents in an action +if the length of the command is shorter than the allowed command length +limit. Otherwise the reference is replaced with the filename. [[jam.language.variables.builtins]] ==== Built-in Variables diff --git a/doc/src/history.adoc b/doc/src/history.adoc index f74ecef8de..a99626efd4 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -3,6 +3,11 @@ == Version 4.4.0 +Along with a variety of fixes this version introduces "dynamic" response file +support for some toolsets. This means that under most circumtances, if +supported by the toolset, response files are not generated. Instead the +command is expanded to include the options directly. + * Remove one at time linking limit. Once upon a time this was a performance tweak as hardware and software was not up to doing multiple links at once. Common setups are better equipped. @@ -11,6 +16,14 @@ -- _René Ferdinand Rivera Morell_ * Support building engine as either 32 or 64 bit addressing model. -- _René Ferdinand Rivera Morell_ +* Add `response-file` feature to control the kind of response file usage in + toolset action. + -- _René Ferdinand Rivera Morell_ +* Add `:O=value` variable modifier for `@()` expansion. + -- _René Ferdinand Rivera Morell_ +* Add `:<=value` and `:>=value` variable modifiers for prefix and postfix + values *after* the complete expansion of variable references. + -- _René Ferdinand Rivera Morell_ == Version 4.3.0 diff --git a/doc/src/reference.adoc b/doc/src/reference.adoc index dc646d9dfd..15098317bd 100644 --- a/doc/src/reference.adoc +++ b/doc/src/reference.adoc @@ -277,6 +277,7 @@ include::../../src/tools/features/visibility-feature.jam[tag=doc] include::../../src/tools/features/warnings-feature.jam[tag=doc] include::../../src/tools/features/translate-path-feature.jam[tag=doc] include::../../src/tools/features/lto-feature.jam[tag=doc] +include::../../src/tools/features/response-file-feature.jam[tag=doc] [[bbv2.reference.tools]] == Builtin tools diff --git a/src/tools/features/response-file-feature.jam b/src/tools/features/response-file-feature.jam index de910d55bb..6d7c0bd596 100644 --- a/src/tools/features/response-file-feature.jam +++ b/src/tools/features/response-file-feature.jam @@ -8,7 +8,7 @@ import feature ; #| tag::doc[] [[bbv2.builtin.features.response-file]]`response-file`:: -*Allowed values:* `file`, `contents`, `auto`. +*Allowed values:* `auto`, `file`, `contents`. + Controls whether a response file is used, or not, during the build of the applicable target. For `file` a response file is created and the filename @@ -18,6 +18,8 @@ file is created, or the contents replaced, based on the length of the contents such that if the contents fits within the limits of the command execution line length limits the contents is replaced. Otherwise a response file is created and the filename is replaced in the actions. ++ +Supported for `clang-linux` and `msvc` toolsets. |# # end::doc[] diff --git a/test/core_at_file.py b/test/core_at_file.py index 0a321f4c97..998ec4f8e5 100755 --- a/test/core_at_file.py +++ b/test/core_at_file.py @@ -1,6 +1,7 @@ #!/usr/bin/python # Copyright 2011 Steven Watanabe +# Copyright 2020 René Ferdinand Rivera Morell # 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) @@ -17,7 +18,7 @@ """) t.run_build_system() -t.expect_output_lines("file: on1n2 .txt"); +t.expect_output_lines("file: on1n2 .txt") t.expect_addition("on1n2 .txt") t.expect_content("on1n2 .txt", " test -DM1 -DM2", True) @@ -31,7 +32,7 @@ """) t.run_build_system(["-d2"]) -t.expect_output_lines(' echo file: "on1n2 .txt" '); +t.expect_output_lines(' echo file: "on1n2 .txt" ') t.expect_addition("on1n2 .txt") t.expect_content("on1n2 .txt", " test -DM1 -DM2", True) From af486c017fc5aacc16c96590ac99a8c3dd65f95c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 21 Dec 2020 21:30:15 -0600 Subject: [PATCH 065/126] Damn python not groking utf-8. --- test/core_at_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core_at_file.py b/test/core_at_file.py index 998ec4f8e5..a9ec49ba84 100755 --- a/test/core_at_file.py +++ b/test/core_at_file.py @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright 2011 Steven Watanabe -# Copyright 2020 René Ferdinand Rivera Morell +# Copyright 2020 Rene Ferdinand Rivera Morell # 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) From 8b4c58c0a4c86ad8089af43fba73caa8c4c52136 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 22 Dec 2020 13:45:36 -0600 Subject: [PATCH 066/126] Add more release notes for 4.4.0. --- doc/src/history.adoc | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/doc/src/history.adoc b/doc/src/history.adoc index a99626efd4..d9b3f89140 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -8,6 +8,14 @@ support for some toolsets. This means that under most circumtances, if supported by the toolset, response files are not generated. Instead the command is expanded to include the options directly. +* *New:* Add `response-file` feature to control the kind of response file usage in + toolset action. + -- _René Ferdinand Rivera Morell_ +* *New:* Add `:O=value` variable modifier for `@()` expansion. + -- _René Ferdinand Rivera Morell_ +* *New:* Add `:<=value` and `:>=value` variable modifiers for prefix and postfix + values *after* the complete expansion of variable references. + -- _René Ferdinand Rivera Morell_ * Remove one at time linking limit. Once upon a time this was a performance tweak as hardware and software was not up to doing multiple links at once. Common setups are better equipped. @@ -16,14 +24,29 @@ command is expanded to include the options directly. -- _René Ferdinand Rivera Morell_ * Support building engine as either 32 or 64 bit addressing model. -- _René Ferdinand Rivera Morell_ -* Add `response-file` feature to control the kind of response file usage in - toolset action. +* Basic support for building b2 engine on GNU/Hurd. + -- _Pino Toscano_ +* Update "borland" toolset to bcc32c for building B2. + -- _Tanzinul Islam_ +* Ensure Embarcadero toolset name is only "embtc". + -- _Tanzinul Islam_ +* Adapt for Emscripten 2.0 change of default behaviour for archives. + -- _Basil Fierz_ +* Fix path to bootstrap for back compat. -- _René Ferdinand Rivera Morell_ -* Add `:O=value` variable modifier for `@()` expansion. +* Add missing BOOST_ROOT to boot strap search. -- _René Ferdinand Rivera Morell_ -* Add `:<=value` and `:>=value` variable modifiers for prefix and postfix - values *after* the complete expansion of variable references. +* Fix for engine compile on FreeBSD. -- _René Ferdinand Rivera Morell_ +* Default MSVC to a native platform, and remove ambiguous implicit + address-model ARM/ARM64 values. + -- _Nikita Kniazev_ +* Fix detection of MIPS32 for b2 engine build. + -- _Ivan Melnikov_ +* Enable building b2 engine with clang on Windows. + -- _Gei0r_ +* Fix building b2 engine with Intel Linux icpc. + -- _Alain Miniussi_ == Version 4.3.0 From 4076c6b2014879b98038ea870433e7eeeec06e4d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 22 Dec 2020 14:45:02 -0600 Subject: [PATCH 067/126] Update various CI versions. --- azure-pipelines.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index be9086f384..fdfe19c2cf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -205,6 +205,7 @@ stages: vmImage: 'ubuntu-latest' strategy: matrix: + 1.75.0 .. GCC 10: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} 1.74.0 .. GCC 10: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} 1.73.0 .. GCC 10: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} 1.72.0 .. GCC 10: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} @@ -277,6 +278,7 @@ stages: vmImage: 'macOS-latest' strategy: matrix: + 1.75.0 .. Xcode 11.7: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} 1.74.0 .. Xcode 11.7: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} 1.73.0 .. Xcode 11.7: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} 1.72.0 .. Xcode 11.7: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} @@ -349,6 +351,7 @@ stages: vmImage: 'windows-latest' strategy: matrix: + 1.75.0 .. VS 2019: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: vc142} 1.74.0 .. VS 2019: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: vc142} 1.73.0 .. VS 2019: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: vc142} 1.72.0 .. VS 2019: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: vc142} @@ -415,7 +418,7 @@ stages: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '2.x' + versionSpec: '3.x' - task: UseRubyVersion@0 - bash: | pip install --user Pygments From 4625ec7524a3b7368cb12478ea403801cdc5e232 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 22 Dec 2020 14:45:32 -0600 Subject: [PATCH 068/126] Update the versions we support/test. --- README.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index 2ca949fcb3..35650f2a47 100644 --- a/README.adoc +++ b/README.adoc @@ -14,9 +14,9 @@ file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Continuously tested on: -* Linux Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4, 5, 6, 7, 8 -* Linux GCC 4.7, 4.8, 4.9, 5, 6, 7, 8, 9 -* macOS Xcode 8.3.3, 9.0, 9.0.1, 9.1, 9.2, 9.3, 9.3.1, 9.4, 9.4.1, 10.0, 10.1, 10.2, 10.2.1, 11.0, 11.1, 11.2, 11.3, 11.3.1 +* Linux Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4, 5, 6, 7, 8, 9, 10 +* Linux GCC 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10 +* macOS Xcode 10.0, 10.1, 10.2, 10.2.1, 11.2.1, 11.3, 11.3.1, 11.4.1, 11.5, 11.6, 11.7 * Windows MinGW 8.1.0 * Windows VS 2013, 2015, 2017, 2019 From 6716658f6d132d7fe28ac851310717dfeecdca41 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 22 Dec 2020 19:19:58 -0600 Subject: [PATCH 069/126] Still need py2 for building docs. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fdfe19c2cf..eb7fe6e586 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -418,7 +418,7 @@ stages: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.x' + versionSpec: '2.x' - task: UseRubyVersion@0 - bash: | pip install --user Pygments From e0870c43214a1d5e4c476eacf9f67dae90ec0b56 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 22 Dec 2020 23:08:16 -0600 Subject: [PATCH 070/126] Possible fix for missing response file args in clang-win. --- src/tools/clang-win.jam | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index 94a8f51572..cb2567243a 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -181,4 +181,9 @@ rule init ( version ? : command * : options * ) } toolset.flags clang-win.link LIBRARY_OPTION clang-win : "" : unchecked ; + + # Enable response file control + toolset.flags clang-win RESPONSE_FILE_SUB auto : a ; + toolset.flags clang-win RESPONSE_FILE_SUB file : f ; + toolset.flags clang-win RESPONSE_FILE_SUB contents : c ; } From ab341585995464332733d2852a50f9696867e711 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 25 Dec 2020 16:14:36 -0600 Subject: [PATCH 071/126] Make clags and cxxflags apply to their respective compile commands. This undoes what this https://github.com/boostorg/build/commit/1a0949fbe610b6e0af5bbb5321b1daa27da7f38a did in a different way. As we now expect to have the two flags separate. fixes #690 --- src/tools/msvc.jam | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 6f47851b61..88b0ecff9a 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -613,8 +613,7 @@ actions compile.asm rule compile.c ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; - C++FLAGS on $(targets[1]) = ; - get-rspline $(targets) : -TC ; + get-rspline $(targets) : -TC CFLAGS ; compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; } @@ -622,8 +621,7 @@ rule compile.c ( targets + : sources * : properties * ) rule compile.c.preprocess ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; - C++FLAGS on $(targets[1]) = ; - get-rspline $(targets) : -TC ; + get-rspline $(targets) : -TC CFLAGS ; preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; } @@ -631,9 +629,8 @@ rule compile.c.preprocess ( targets + : sources * : properties * ) rule compile.c.pch ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; - C++FLAGS on $(targets[1]) = ; - get-rspline $(targets[1]) : -TC ; - get-rspline $(targets[2]) : -TC ; + get-rspline $(targets[1]) : -TC CFLAGS ; + get-rspline $(targets[2]) : -TC CFLAGS ; local pch-source = [ on $(<) return $(PCH_SOURCE) ] ; if $(pch-source) { @@ -716,14 +713,14 @@ actions compile-c-c++-pch-s rule compile.c++ ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; - get-rspline $(targets) : -TP ; + get-rspline $(targets) : -TP C++FLAGS ; compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; } rule compile.c++.preprocess ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; - get-rspline $(targets) : -TP ; + get-rspline $(targets) : -TP C++FLAGS ; preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; } @@ -731,8 +728,8 @@ rule compile.c++.preprocess ( targets + : sources * : properties * ) rule compile.c++.pch ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; - get-rspline $(targets[1]) : -TP ; - get-rspline $(targets[2]) : -TP ; + get-rspline $(targets[1]) : -TP C++FLAGS ; + get-rspline $(targets[2]) : -TP C++FLAGS ; local pch-source = [ on $(<) return $(PCH_SOURCE) ] ; if $(pch-source) { @@ -1691,10 +1688,10 @@ local rule default-path ( version ) -rule get-rspline ( target : lang-opt ) +rule get-rspline ( target : lang-opt lang-flags ) { CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS) - $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c -D$(DEFINES) + $($(lang-flags)) $(OPTIONS) -c -D$(DEFINES) \"-I$(INCLUDES:W)\" \"-FI$(FORCE_INCLUDES:W)\" ] ; } @@ -1870,8 +1867,8 @@ local rule register-toolset-really ( ) toolset.flags msvc.compile CFLAGS off/static/multi : /MT ; toolset.flags msvc.compile CFLAGS on/static/multi : /MTd ; - toolset.flags msvc.compile OPTIONS : ; - toolset.flags msvc.compile.c++ OPTIONS : ; + toolset.flags msvc.compile CFLAGS : ; + toolset.flags msvc.compile.c++ C++FLAGS : ; toolset.flags msvc.compile PDB_CFLAG on/database : /Fd ; From 30a7e738ad2757b811720a56173dd3ba3453eaef Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 25 Dec 2020 22:24:52 -0600 Subject: [PATCH 072/126] Move link option order to fix clang-cl invoke. Clanf-cl is a bit more picky than plain msvc link command about order of link option when linking. This moves the linkflags to the end of the command as clang-cl needs. --- src/tools/clang-win.jam | 3 ++- src/tools/msvc.jam | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index cb2567243a..72abbdc198 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -170,7 +170,8 @@ rule init ( version ? : command * : options * ) if $(addr) = 32 { cond += "$(condition)//" ; } toolset.flags clang-win.compile .CC $(cond) : $(compiler) -m$(addr) ; - toolset.flags clang-win.link .LD $(cond) : $(compiler) -m$(addr) /link "/incremental:no" "/manifest" ; + toolset.flags clang-win.link .LD $(cond) : $(compiler) -m$(addr) ; + toolset.flags clang-win.link LINKFLAGS $(cond) : /link "/incremental:no" "/manifest" ; toolset.flags clang-win.compile .ASM $(cond) : $(assembler) -nologo -c -Zp4 -Cp -Cx ; toolset.flags clang-win.compile .ASM_OUTPUT $(cond) : -Fo ; toolset.flags clang-win.archive .LD $(cond) : $(archiver) /nologo ; diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 88b0ecff9a..2d7b76c258 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -843,7 +843,7 @@ rule link.dll ( targets + : sources * : properties * ) { actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") + $(.SETUP) $(.LD) /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") $(LINKFLAGS) /out:"$(<[1]:W)" } actions manifest @@ -858,7 +858,7 @@ rule link.dll ( targets + : sources * : properties * ) actions link.dll bind IMPORT_LIB DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(IMPORT_LIB:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") + $(.SETUP) $(.LD) /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") $(LINKFLAGS) /out:"$(<[1]:W)" /DLL /IMPLIB:"$(IMPORT_LIB:W)" /def:"$(DEF_FILE)" } actions manifest.dll From 8d37b68e1db40ef05ee974e6f263071cd42e6d79 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 25 Dec 2020 23:25:11 -0600 Subject: [PATCH 073/126] Move more/all link options after /link. --- src/tools/clang-win.jam | 3 ++- src/tools/msvc.jam | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index 72abbdc198..6b8561739e 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -171,7 +171,8 @@ rule init ( version ? : command * : options * ) toolset.flags clang-win.compile .CC $(cond) : $(compiler) -m$(addr) ; toolset.flags clang-win.link .LD $(cond) : $(compiler) -m$(addr) ; - toolset.flags clang-win.link LINKFLAGS $(cond) : /link "/incremental:no" "/manifest" ; + toolset.flags clang-win.link LINKOPT $(cond) : /link ; + toolset.flags clang-win.link LINKFLAGS $(cond) : "/incremental:no" "/manifest" ; toolset.flags clang-win.compile .ASM $(cond) : $(assembler) -nologo -c -Zp4 -Cp -Cx ; toolset.flags clang-win.compile .ASM_OUTPUT $(cond) : -Fo ; toolset.flags clang-win.archive .LD $(cond) : $(archiver) /nologo ; diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 2d7b76c258..3f8da44fd9 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -843,7 +843,7 @@ rule link.dll ( targets + : sources * : properties * ) { actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") $(LINKFLAGS) /out:"$(<[1]:W)" + $(.SETUP) $(.LD) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") $(LINKOPT) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" } actions manifest @@ -858,7 +858,7 @@ rule link.dll ( targets + : sources * : properties * ) actions link.dll bind IMPORT_LIB DEF_FILE LIBRARIES_MENTIONED_BY_FILE MANIFEST_FILE { - $(.SETUP) $(.LD) /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" $(OPTIONS) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") $(LINKFLAGS) /out:"$(<[1]:W)" /DLL /IMPLIB:"$(IMPORT_LIB:W)" /def:"$(DEF_FILE)" + $(.SETUP) $(.LD) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>)" $(LIBRARIES_MENTIONED_BY_FILE) $(LIBRARIES) "$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" "$(LIBRARY_OPTION)$(FINDLIBS_SA).lib") $(LINKOPT) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" /MANIFESTINPUT:"$(MANIFEST_FILE)" /DLL /IMPLIB:"$(IMPORT_LIB:W)" /def:"$(DEF_FILE)" } actions manifest.dll @@ -1589,7 +1589,7 @@ local rule configure-really ( version ? : options * ) # LTO toolset.flags msvc.compile OPTIONS $(conditions)/on : /GL ; - toolset.flags msvc.link OPTIONS $(conditions)/on : /LTCG ; + toolset.flags msvc.link LINKFLAGS $(conditions)/on : /LTCG ; # Set version-specific flags. configure-version-specific msvc : $(version) : $(conditions) ; @@ -1906,7 +1906,7 @@ local rule register-toolset-really ( ) toolset.flags msvc LINKFLAGS native : "/subsystem:native" ; toolset.flags msvc LINKFLAGS auto : "/subsystem:posix" ; - toolset.flags msvc.link OPTIONS ; + toolset.flags msvc.link LINKFLAGS ; toolset.flags msvc.link LINKPATH ; toolset.flags msvc.link FINDLIBS_ST ; From f694f2eeddb3a0523b277a015d96c4a2eef6fd02 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Dec 2020 23:21:47 -0600 Subject: [PATCH 074/126] Adjust new asan support. The proposed asan support didn't fit into the regular msvc init structure. This fixes that aspect and cleans up the support to correctly be minimal and to add the missing runtime libs needed to actually enable the asan support. --- src/tools/msvc.jam | 82 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 17 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 9225597cf8..fabe64f7c7 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -489,23 +489,71 @@ rule configure-version-specific ( toolset : version : conditions ) # This check however now only tests for 14.2 (which is 16.0) as msvc.jam doesn't distinguish between minor versions (e.g. 14.21..14.28 etc) if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 2 ] { - # Declare flags for the address sanitizer. - toolset.flags msvc.compile.c OPTIONS on : /fsanitize=address /FS ; - toolset.flags msvc.compile.c++ OPTIONS on : /fsanitize=address /FS ; - - # Declare flags for the address sanitizer. - toolset.flags msvc.link OPTIONS on/64/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/64/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/32/shared/EXE : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; - toolset.flags msvc.link OPTIONS on/32/static/EXE : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; - toolset.flags msvc.link OPTIONS on/64/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/64/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-x86_64.lib" /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; - toolset.flags msvc.link OPTIONS on/32/shared/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; - toolset.flags msvc.link OPTIONS on/32/static/UNIT_TEST : -incremental\:no /wholearchive\:"clang_rt.asan-i386.lib" /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; - toolset.flags msvc.link.dll OPTIONS on/64/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; - toolset.flags msvc.link.dll OPTIONS on/64/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-x86_64.lib" ; - toolset.flags msvc.link.dll OPTIONS on/32/shared : -incremental\:no /wholearchive\:"clang_rt.asan_dynamic-i386.lib" /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; - toolset.flags msvc.link.dll OPTIONS on/32/static : -incremental\:no /wholearchive\:"clang_rt.asan_dll_thunk-i386.lib" ; + # General asan compile and link options. + toolset.flags $(toolset).compile OPTIONS + $(conditions)/on + : /fsanitize=address /FS ; + toolset.flags $(toolset).link LINKFLAGS + $(conditions)/on + : -incremental\:no ; + + # The various 64 bit runtime asan support libraries and related flags. + toolset.flags $(toolset).link FINDLIBS_SA + $(conditions)/on//shared + $(conditions)/on/64/shared + : clang_rt.asan_dynamic-x86_64 + clang_rt.asan_dynamic_runtime_thunk-x86_64 ; + toolset.flags $(toolset).link LINKFLAGS + $(conditions)/on//shared + $(conditions)/on/64/shared + : /wholearchive\:"clang_rt.asan_dynamic-x86_64.lib" + /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ; + toolset.flags $(toolset).link FINDLIBS_SA + $(conditions)/on//static/EXE + $(conditions)/on//static/UNIT_TEST + $(conditions)/on/64/static/EXE + $(conditions)/on/64/static/UNIT_TEST + : clang_rt.asan-x86_64 + clang_rt.asan_cxx-x86_64 ; + toolset.flags $(toolset).link LINKFLAGS + $(conditions)/on//static/EXE + $(conditions)/on//static/UNIT_TEST + $(conditions)/on/64/static/EXE + $(conditions)/on/64/static/UNIT_TEST + : /wholearchive\:"clang_rt.asan-x86_64.lib" + /wholearchive\:"clang_rt.asan_cxx-x86_64.lib" ; + toolset.flags $(toolset).link.dll FINDLIBS_SA + $(conditions)/on//static + $(conditions)/on/64/static + : clang_rt.asan_dll_thunk-x86_64 ; + toolset.flags $(toolset).link.dll LINKFLAGS + $(conditions)/on//static + $(conditions)/on/64/static + : /wholearchive\:"clang_rt.asan_dll_thunk-x86_64.lib" ; + + # The various 32 bit runtime asan support libraries and related flags. + toolset.flags $(toolset).link FINDLIBS_SA + $(conditions)/on/32/shared + : clang_rt.asan_dynamic-i386 clang_rt.asan_dynamic_runtime_thunk-i386 ; + toolset.flags $(toolset).link LINKFLAGS + $(conditions)/on/32/shared + : /wholearchive\:"clang_rt.asan_dynamic-i386.lib" + /wholearchive\:"clang_rt.asan_dynamic_runtime_thunk-i386.lib" ; + toolset.flags $(toolset).link FINDLIBS_SA + $(conditions)/on/32/static/EXE + $(conditions)/on/32/static/UNIT_TEST + : clang_rt.asan-i386 clang_rt.asan_cxx-i386 ; + toolset.flags $(toolset).link LINKFLAGS + $(conditions)/on/32/static/EXE + $(conditions)/on/32/static/UNIT_TEST + : /wholearchive\:"clang_rt.asan-i386.lib" + /wholearchive\:"clang_rt.asan_cxx-i386.lib" ; + toolset.flags $(toolset).link.dll FINDLIBS_SA + $(conditions)/on/32/static/LIB/shared + : clang_rt.asan_dll_thunk-i386 ; + toolset.flags $(toolset).link.dll LINKFLAGS + $(conditions)/on/32/static/LIB/shared + : /wholearchive\:"clang_rt.asan_dll_thunk-i386.lib" ; } # From f5584205b0ee93904a5f2a9921459f99a1caa515 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 27 Dec 2020 07:54:24 -0600 Subject: [PATCH 075/126] Fix missing C++ flags args for msvc. Recent change fixed the use of CFLAGS vs. C++FLAGS which caused a bunch of C++ options to dissappear. This brings then back by setting them to appropriate OPTIONS, CFLAGS, or C++FLAGS var. --- src/tools/msvc.jam | 88 +++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 3f8da44fd9..b1773a7842 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -450,19 +450,19 @@ rule configure-version-specific ( toolset : version : conditions ) # version 7.* explicitly or if we auto-detected the version ourselves. if ! [ MATCH ^(6\\.) : $(version) ] { - toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:forScope" "/Zc:wchar_t" ; + toolset.flags $(toolset).compile OPTIONS $(conditions) : "/Zc:forScope" "/Zc:wchar_t" ; toolset.flags $(toolset).compile.c++ C++FLAGS $(conditions) : /wd4675 ; # Explicitly disable the 'function is deprecated' warning. Some msvc # versions have a bug, causing them to emit the deprecation warning even # with /W0. - toolset.flags $(toolset).compile CFLAGS $(conditions)/off : /wd4996 ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/off : /wd4996 ; if [ MATCH "^([78]\\.)" : $(version) ] { # 64-bit compatibility warning deprecated since 9.0, see # http://msdn.microsoft.com/en-us/library/yt4xw8fh.aspx - toolset.flags $(toolset).compile CFLAGS $(conditions)/all : /Wp64 ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/all : /Wp64 ; } } @@ -471,17 +471,17 @@ rule configure-version-specific ( toolset : version : conditions ) # variables and functions that have internal linkage if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 12 ] { - toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:inline" ; + toolset.flags $(toolset).compile OPTIONS $(conditions) : "/Zc:inline" ; # /Gy analog for variables: https://devblogs.microsoft.com/cppblog/introducing-gw-compiler-switch/ - toolset.flags $(toolset).compile CFLAGS $(conditions)/speed $(conditions)/space : /Gw ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/speed $(conditions)/space : /Gw ; } # 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 [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 ] { - toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:throwingNew" ; + toolset.flags $(toolset).compile C++FLAGS $(conditions) : "/Zc:throwingNew" ; } # @@ -491,34 +491,34 @@ rule configure-version-specific ( toolset : version : conditions ) if [ MATCH "^([67])" : $(version) ] { # 8.0 deprecates some of the options. - toolset.flags $(toolset).compile CFLAGS $(conditions)/speed $(conditions)/space : /Ogiy /Gs ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/speed : /Ot ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/space : /Os ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/speed $(conditions)/space : /Ogiy /Gs ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/speed : /Ot ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/space : /Os ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/ : /GB ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/i486 : /G4 ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/$(.cpu-type-g5) : /G5 ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/$(.cpu-type-g6) : /G6 ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/$(.cpu-type-g7) : /G7 ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/ : /GB ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/i486 : /G4 ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/$(.cpu-type-g5) : /G5 ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/$(.cpu-type-g6) : /G6 ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/$(.cpu-type-g7) : /G7 ; # Improve floating-point accuracy. Otherwise, some of C++ Boost's "math" # tests will fail. - toolset.flags $(toolset).compile CFLAGS $(conditions) : /Op ; + toolset.flags $(toolset).compile OPTIONS $(conditions) : /Op ; # 7.1 and below have single-threaded static RTL. - toolset.flags $(toolset).compile CFLAGS $(conditions)/off/static/single : /ML ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/on/static/single : /MLd ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/off/static/single : /ML ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/on/static/single : /MLd ; } else { # 8.0 and above adds some more options. - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/ : "/favor:blend" ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/$(.cpu-type-em64t) : "/favor:EM64T" ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/$(.cpu-type-amd64) : "/favor:AMD64" ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-amd64)/ : "/favor:blend" ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-amd64)/$(.cpu-type-em64t) : "/favor:EM64T" ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-amd64)/$(.cpu-type-amd64) : "/favor:AMD64" ; # 8.0 and above only has multi-threaded static RTL. - toolset.flags $(toolset).compile CFLAGS $(conditions)/off/static/single : /MT ; - toolset.flags $(toolset).compile CFLAGS $(conditions)/on/static/single : /MTd ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/off/static/single : /MT ; + toolset.flags $(toolset).compile OPTIONS $(conditions)/on/static/single : /MTd ; # Specify target machine type so the linker will not need to guess. toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-amd64) : "/MACHINE:X64" ; @@ -1827,25 +1827,25 @@ local rule register-toolset-really ( ) # Declare flags for compilation. # - toolset.flags msvc.compile CFLAGS speed : /O2 ; - toolset.flags msvc.compile CFLAGS space : /O1 ; + toolset.flags msvc.compile OPTIONS speed : /O2 ; + toolset.flags msvc.compile OPTIONS space : /O1 ; - toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/$(.cpu-type-itanium) : /G1 ; - toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/$(.cpu-type-itanium2) : /G2 ; + toolset.flags msvc.compile OPTIONS $(.cpu-arch-ia64)/$(.cpu-type-itanium) : /G1 ; + toolset.flags msvc.compile OPTIONS $(.cpu-arch-ia64)/$(.cpu-type-itanium2) : /G2 ; - toolset.flags msvc.compile CFLAGS on/object : /Z7 ; - toolset.flags msvc.compile CFLAGS on/database : /Zi ; - toolset.flags msvc.compile CFLAGS off : /Od ; - toolset.flags msvc.compile CFLAGS off : /Ob0 ; - toolset.flags msvc.compile CFLAGS on : /Ob1 ; - toolset.flags msvc.compile CFLAGS full : /Ob2 ; + toolset.flags msvc.compile OPTIONS on/object : /Z7 ; + toolset.flags msvc.compile OPTIONS on/database : /Zi ; + toolset.flags msvc.compile OPTIONS off : /Od ; + toolset.flags msvc.compile OPTIONS off : /Ob0 ; + toolset.flags msvc.compile OPTIONS on : /Ob1 ; + toolset.flags msvc.compile OPTIONS full : /Ob2 ; - toolset.flags msvc.compile CFLAGS on : /W3 ; - toolset.flags msvc.compile CFLAGS off : /W0 ; - toolset.flags msvc.compile CFLAGS all : /W4 ; - toolset.flags msvc.compile CFLAGS extra : /W4 ; - toolset.flags msvc.compile CFLAGS pedantic : /W4 ; - toolset.flags msvc.compile CFLAGS on : /WX ; + toolset.flags msvc.compile OPTIONS on : /W3 ; + toolset.flags msvc.compile OPTIONS off : /W0 ; + toolset.flags msvc.compile OPTIONS all : /W4 ; + toolset.flags msvc.compile OPTIONS extra : /W4 ; + toolset.flags msvc.compile OPTIONS pedantic : /W4 ; + toolset.flags msvc.compile OPTIONS on : /WX ; toolset.flags msvc.compile C++FLAGS on/off/off : /EHs ; toolset.flags msvc.compile C++FLAGS on/off/on : /EHsc ; @@ -1859,13 +1859,13 @@ local rule register-toolset-really ( ) # By default 8.0 enables rtti support while prior versions disabled it. We # simply enable or disable it explicitly so we do not have to depend on this # default behaviour. - toolset.flags msvc.compile CFLAGS on : /GR ; - toolset.flags msvc.compile CFLAGS off : /GR- ; - toolset.flags msvc.compile CFLAGS off/shared : /MD ; - toolset.flags msvc.compile CFLAGS on/shared : /MDd ; + toolset.flags msvc.compile C++FLAGS on : /GR ; + toolset.flags msvc.compile C++FLAGS off : /GR- ; + toolset.flags msvc.compile OPTIONS off/shared : /MD ; + toolset.flags msvc.compile OPTIONS on/shared : /MDd ; - toolset.flags msvc.compile CFLAGS off/static/multi : /MT ; - toolset.flags msvc.compile CFLAGS on/static/multi : /MTd ; + toolset.flags msvc.compile OPTIONS off/static/multi : /MT ; + toolset.flags msvc.compile OPTIONS on/static/multi : /MTd ; toolset.flags msvc.compile CFLAGS : ; toolset.flags msvc.compile.c++ C++FLAGS : ; From 30d2bd61ff5058b83786992e8e242dc14144243f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 27 Dec 2020 09:49:16 -0600 Subject: [PATCH 076/126] Use std::free instead of C free. Fixes #671. --- src/engine/startup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/startup.cpp b/src/engine/startup.cpp index de0a4fec60..e0205bf59c 100644 --- a/src/engine/startup.cpp +++ b/src/engine/startup.cpp @@ -14,7 +14,7 @@ Distributed under the Boost Software License, Version 1.0. #include "output.h" #include "variable.h" -#include +#include #include #include @@ -160,7 +160,7 @@ bool b2::startup::bootstrap(FRAME *frame) const std::string b2_exe_path{b2_exe_path_pchar}; if (b2_exe_path_pchar) { - free(b2_exe_path_pchar); + std::free(b2_exe_path_pchar); } const std::string boost_build_jam{"boost-build.jam"}; std::string b2_file_path; From cc84fc59b4dacc50746feb4eaa2a7b2ad0a8287c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 27 Dec 2020 09:49:16 -0600 Subject: [PATCH 077/126] Use std::free instead of C free. Fixes #671. --- src/engine/startup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/startup.cpp b/src/engine/startup.cpp index de0a4fec60..e0205bf59c 100644 --- a/src/engine/startup.cpp +++ b/src/engine/startup.cpp @@ -14,7 +14,7 @@ Distributed under the Boost Software License, Version 1.0. #include "output.h" #include "variable.h" -#include +#include #include #include @@ -160,7 +160,7 @@ bool b2::startup::bootstrap(FRAME *frame) const std::string b2_exe_path{b2_exe_path_pchar}; if (b2_exe_path_pchar) { - free(b2_exe_path_pchar); + std::free(b2_exe_path_pchar); } const std::string boost_build_jam{"boost-build.jam"}; std::string b2_file_path; From 527589168eea4339ebb79c385197095781a4bbba Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 28 Dec 2020 13:26:13 +0200 Subject: [PATCH 078/126] Add missing case for x86/ (#692) --- src/tools/clang-win.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index 6b8561739e..8093a91e75 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -167,7 +167,7 @@ rule init ( version ? : command * : options * ) .notice "$(addr):" "using idl-compiler '$(idl-compiler)'" ; local cond = "$(condition)//$(addr)" "$(condition)/x86/$(addr)" ; - if $(addr) = 32 { cond += "$(condition)//" ; } + if $(addr) = 32 { cond += "$(condition)//" "$(condition)/x86/" ; } toolset.flags clang-win.compile .CC $(cond) : $(compiler) -m$(addr) ; toolset.flags clang-win.link .LD $(cond) : $(compiler) -m$(addr) ; From 93dabd5a9ad56e7939519d6d2a25cd681603952c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 29 Dec 2020 18:08:17 +0200 Subject: [PATCH 079/126] Autodetect the clang-win default address-model from Target: in the -v output (#694) --- src/tools/clang-win.jam | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index 8093a91e75..b685242420 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -74,11 +74,17 @@ rule init ( version ? : command * : options * ) local compiler = "\"$(command)\"" ; compiler = "$(compiler:J= )" ; - version ?= [ MATCH "version ([0-9.]+)" : [ SHELL "$(compiler) -v 2>&1" ] ] ; + local version-output = [ SHELL "$(compiler) -v 2>&1" ] ; - .notice "using compiler '$(compiler)', version '$(version)'" ; + version ?= [ MATCH "version ([0-9.]+)" : $(version-output) ] ; + local target = [ MATCH "Target: ([A-Za-z0-9_]+)" : $(version-output) ] ; - local condition = [ common.check-init-parameters clang-win : version $(version) ] ; + local default-addr = 32 ; + if $(target) = x86_64 { default-addr = 64 ; } + + .notice "using compiler '$(compiler)', version '$(version)', target '$(target)', default address-model=$(default-addr)" ; + + local condition = [ common.check-init-parameters clang-win : version $(version) ] ; common.handle-options clang-win : $(condition) : $(command) : $(options) ; @@ -167,7 +173,7 @@ rule init ( version ? : command * : options * ) .notice "$(addr):" "using idl-compiler '$(idl-compiler)'" ; local cond = "$(condition)//$(addr)" "$(condition)/x86/$(addr)" ; - if $(addr) = 32 { cond += "$(condition)//" "$(condition)/x86/" ; } + if $(addr) = $(default-addr) { cond += "$(condition)//" "$(condition)/x86/" ; } toolset.flags clang-win.compile .CC $(cond) : $(compiler) -m$(addr) ; toolset.flags clang-win.link .LD $(cond) : $(compiler) -m$(addr) ; From 29baa79c7e1b98dfa8089bf1d8889f8d3981ec4f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 29 Dec 2020 11:36:17 -0600 Subject: [PATCH 080/126] Fix two memory leaks from new @() features. --- src/engine/function.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 434b6ba8d0..056949d9ef 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -641,7 +641,7 @@ struct VAR_EXPANDED { LIST * value = L0; LIST * inner = L0; - bool opt_file:1; + bool opt_file:1; bool opt_content:1; }; @@ -2051,8 +2051,10 @@ static void var_parse_file_compile( VAR_PARSE_VAR const * parse, compiler * c ) &contents_dyn_array ); for ( int32_t i = contents_dyn_array.size - 1; i >= 0; --i ) { - var_parse_group_compile( dynamic_array_at( - VAR_PARSE_GROUP *, ( &contents_dyn_array ), i ), c ); + auto group = dynamic_array_at( + VAR_PARSE_GROUP *, ( &contents_dyn_array ), i ); + var_parse_group_compile( group, c ); + var_parse_group_free( group ); } dynamic_array_free( &contents_dyn_array ); compile_emit( c, INSTR_APPEND_STRINGS, contents_dyn_array.size ); @@ -2201,6 +2203,10 @@ static int32_t try_parse_variable( char const * * s_, char const * * string, *s_ = s; return 1; } + else + { + var_parse_var_free( vp ); + } } return 0; } From ddf2a8c5e0d461ee0cd9e509132cd2d0428ef325 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 31 Dec 2020 08:34:59 -0600 Subject: [PATCH 081/126] Add support to override b2 exec for testing. Adds use of `B2` env var to specify the b2 exec to use for testing. This allows us to use debug and sanitizer builds for testing. --- test/BoostBuild.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/BoostBuild.py b/test/BoostBuild.py index 209fba3bd2..fad7102457 100644 --- a/test/BoostBuild.py +++ b/test/BoostBuild.py @@ -1,6 +1,6 @@ # Copyright 2002-2005 Vladimir Prus. # Copyright 2002-2003 Dave Abrahams. -# Copyright 2006 Rene Rivera. +# Copyright 2006 Rene Ferdinand Rivera Morell. # 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) @@ -236,12 +236,17 @@ class Tester(TestCmd.TestCmd): system output like the --verbose command line option does. """ - def __init__(self, arguments=None, executable="b2", + def __init__(self, arguments=None, executable=None, match=TestCmd.match_exact, boost_build_path=None, translate_suffixes=True, pass_toolset=True, use_test_config=True, ignore_toolset_requirements=False, workdir="", pass_d0=False, **keywords): + if not executable: + executable = os.getenv('B2') + if not executable: + executable = 'b2' + assert arguments.__class__ is not str self.original_workdir = os.path.dirname(__file__) if workdir and not os.path.isabs(workdir): From 359b4f2885cbca41c5833be2a50fe9c00daf6dca Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 31 Dec 2020 08:38:31 -0600 Subject: [PATCH 082/126] Minor clean up list cache code. --- src/engine/lists.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index d646c6e22c..ca880267dd 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -14,44 +14,47 @@ #include -static LIST * freelist[ 32 ]; /* junkpile for list_dealloc() */ +static const size_t freelist_size = 16; -static int32_t get_bucket( int32_t size ) +static LIST * freelist[ freelist_size ]; /* junkpile for list_dealloc() */ + +static int32_t get_bucket_size( size_t bucket ) { - int32_t bucket = 0; - while ( size > ( int32_t(1) << bucket ) ) ++bucket; + return int32_t(1) << ( bucket < freelist_size ? bucket : ( freelist_size - 1 ) ); +} + +static size_t get_bucket( int32_t size ) +{ + size_t bucket = 0; + while ( ( bucket < freelist_size ) && ( size > get_bucket_size( bucket ) ) ) ++bucket; return bucket; } static LIST * list_alloc( int32_t size ) { - int32_t bucket = get_bucket( size ); + size_t bucket = get_bucket( size ); if ( freelist[ bucket ] ) { LIST * result = freelist[ bucket ]; freelist[ bucket ] = result->impl.next; return result; } - return (LIST *)BJAM_MALLOC( sizeof( LIST ) + ( size_t( 1 ) << bucket ) * + return (LIST *)BJAM_MALLOC( sizeof( LIST ) + get_bucket_size( bucket ) * sizeof( OBJECT * ) ); } static void list_dealloc( LIST * l ) { int32_t size = list_length( l ); - int32_t bucket; + size_t bucket; LIST * node = l; if ( size == 0 ) return; bucket = get_bucket( size );; -#ifdef BJAM_NO_MEM_CACHE - BJAM_FREE( node ); -#else node->impl.next = freelist[ bucket ]; freelist[ bucket ] = node; -#endif } /* @@ -70,7 +73,7 @@ LIST * list_append( LIST * l, LIST * nl ) int32_t bucket = get_bucket( size ); /* Do we need to reallocate? */ - if ( l_size <= ( int32_t(1) << ( bucket - 1 ) ) ) + if ( l_size <= get_bucket_size( bucket ) ) { LIST * result = list_alloc( size ); memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( From 51d3a6d1c391e023155836812c17097fa9f044a2 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 31 Dec 2020 08:39:17 -0600 Subject: [PATCH 083/126] Abstract apply mods value. --- src/engine/function.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 056949d9ef..04f0d86b9d 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -923,6 +923,13 @@ static VAR_EXPANDED apply_modifiers( STACK * s, int32_t n ) return result; } +static LIST * apply_modifiers_value( STACK * s, int32_t n ) +{ + auto mod = apply_modifiers( s, n ); + list_free( mod.inner ); + return mod.value; +} + // STACK: LIST * modifiers[modifier_count] static VAR_EXPANDED eval_modifiers( STACK * s, LIST * value, int32_t modifier_count ) { @@ -4943,9 +4950,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) l = stack_pop( s ); n = expand_modifiers( s, code->arg ); stack_push( s, l ); - VAR_EXPANDED m = apply_modifiers( s, n ); - l = m.value; - list_free( m.inner ); + l = apply_modifiers_value( s, n ); list_free( stack_pop( s ) ); stack_deallocate( s, n * sizeof( VAR_EDITS ) ); for ( i = 0; i < code->arg; ++i ) @@ -5000,9 +5005,7 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) { stack_push( s, function_get_named_variable( function, frame, list_item( iter ) ) ); - VAR_EXPANDED m = apply_modifiers( s, n ); - result = m.value; - list_free( m.inner ); + result = apply_modifiers_value( s, n ); list_free( stack_pop( s ) ); } list_free( vars ); From 5fa06452bfb90e2a1214adf80b6ef1c1f27a3f0d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 31 Dec 2020 11:34:26 -0600 Subject: [PATCH 084/126] Fix coercion warning. --- src/engine/lists.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index ca880267dd..590c6bfe8a 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -70,7 +70,7 @@ LIST * list_append( LIST * l, LIST * nl ) int32_t l_size = list_length( l ); int32_t nl_size = list_length( nl ); int32_t size = l_size + nl_size; - int32_t bucket = get_bucket( size ); + size_t bucket = get_bucket( size ); /* Do we need to reallocate? */ if ( l_size <= get_bucket_size( bucket ) ) From 6bba7e3bc4bb0996dfa8171147e9d24fbd3f4c8b Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 1 Jan 2021 11:06:50 -0600 Subject: [PATCH 085/126] Fix list alloc crashes. This is a brute force fix for the instability of list allocations. It gets rid of the caching of lists in favor of straight de/alloc. --- src/engine/lists.cpp | 67 ++++++-------------------------------------- 1 file changed, 9 insertions(+), 58 deletions(-) diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index 590c6bfe8a..55acb3f21b 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -14,47 +14,15 @@ #include -static const size_t freelist_size = 16; - -static LIST * freelist[ freelist_size ]; /* junkpile for list_dealloc() */ - -static int32_t get_bucket_size( size_t bucket ) -{ - return int32_t(1) << ( bucket < freelist_size ? bucket : ( freelist_size - 1 ) ); -} - -static size_t get_bucket( int32_t size ) -{ - size_t bucket = 0; - while ( ( bucket < freelist_size ) && ( size > get_bucket_size( bucket ) ) ) ++bucket; - return bucket; -} - static LIST * list_alloc( int32_t size ) { - size_t bucket = get_bucket( size ); - if ( freelist[ bucket ] ) - { - LIST * result = freelist[ bucket ]; - freelist[ bucket ] = result->impl.next; - return result; - } - return (LIST *)BJAM_MALLOC( sizeof( LIST ) + get_bucket_size( bucket ) * - sizeof( OBJECT * ) ); + if ( size == 0 ) return L0; + return (LIST *)BJAM_MALLOC( sizeof( LIST ) + size * sizeof( OBJECT * ) ); } static void list_dealloc( LIST * l ) { - int32_t size = list_length( l ); - size_t bucket; - LIST * node = l; - - if ( size == 0 ) return; - - bucket = get_bucket( size );; - - node->impl.next = freelist[ bucket ]; - freelist[ bucket ] = node; + // if ( l ) BJAM_FREE( l ); } /* @@ -70,18 +38,11 @@ LIST * list_append( LIST * l, LIST * nl ) int32_t l_size = list_length( l ); int32_t nl_size = list_length( nl ); int32_t size = l_size + nl_size; - size_t bucket = get_bucket( size ); - - /* Do we need to reallocate? */ - if ( l_size <= get_bucket_size( bucket ) ) - { - LIST * result = list_alloc( size ); - memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( - OBJECT * ) ); - list_dealloc( l ); - l = result; - } - + LIST * result = list_alloc( size ); + memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( + OBJECT * ) ); + list_dealloc( l ); + l = result; l->impl.size = size; memcpy( list_begin( l ) + l_size, list_begin( nl ), nl_size * sizeof( OBJECT * ) ); @@ -124,7 +85,7 @@ LIST * list_push_back( LIST * head, OBJECT * value ) { head = list_alloc( 1 ); } - else if ( ( ( size - 1 ) & size ) == 0 ) + else { LIST * l = list_alloc( size + 1 ); memcpy( l, head, sizeof( LIST ) + size * sizeof( OBJECT * ) ); @@ -368,16 +329,6 @@ LIST * list_unique( LIST * sorted_list ) void list_done() { - for ( int32_t i = 0; i < int32_t(sizeof( freelist ) / sizeof( freelist[ 0 ] )); ++i ) - { - LIST * l = freelist[ i ]; - while ( l ) - { - LIST * const tmp = l; - l = l->impl.next; - BJAM_FREE( tmp ); - } - } } From 1e294144db4d7836bde8a98d449682d82f5eff41 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 1 Jan 2021 11:08:44 -0600 Subject: [PATCH 086/126] Forgot to put back the list dealloc. --- src/engine/lists.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index 55acb3f21b..60a35b65a4 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -22,7 +22,7 @@ static LIST * list_alloc( int32_t size ) static void list_dealloc( LIST * l ) { - // if ( l ) BJAM_FREE( l ); + if ( l ) BJAM_FREE( l ); } /* From ba075e6ac93dfc2dca866de7e54f6b0c5c522b17 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 1 Jan 2021 14:22:23 -0600 Subject: [PATCH 087/126] Slightly more optimal list alloc by using realloc. --- src/engine/lists.cpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index 60a35b65a4..62a7fd2895 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -25,6 +25,11 @@ static void list_dealloc( LIST * l ) if ( l ) BJAM_FREE( l ); } +static LIST * list_realloc( LIST * l, int32_t size ) +{ + return (LIST *)BJAM_REALLOC( l, sizeof( LIST ) + size * sizeof( OBJECT * ) ); +} + /* * list_append() - append a list onto another one, returning total */ @@ -33,16 +38,13 @@ LIST * list_append( LIST * l, LIST * nl ) { if ( list_empty( l ) ) return nl; - if ( !list_empty( nl ) ) + if ( list_empty( nl ) ) + return l; { int32_t l_size = list_length( l ); int32_t nl_size = list_length( nl ); int32_t size = l_size + nl_size; - LIST * result = list_alloc( size ); - memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( - OBJECT * ) ); - list_dealloc( l ); - l = result; + l = list_realloc( l, size ); l->impl.size = size; memcpy( list_begin( l ) + l_size, list_begin( nl ), nl_size * sizeof( OBJECT * ) ); @@ -80,17 +82,13 @@ LIST * list_push_back( LIST * head, OBJECT * value ) if ( DEBUG_LISTS ) out_printf( "list > %s <\n", object_str( value ) ); - /* If the size is a power of 2, reallocate. */ if ( size == 0 ) { head = list_alloc( 1 ); } else { - LIST * l = list_alloc( size + 1 ); - memcpy( l, head, sizeof( LIST ) + size * sizeof( OBJECT * ) ); - list_dealloc( head ); - head = l; + head = list_realloc( head, size + 1 ); } list_begin( head )[ size ] = value; @@ -212,12 +210,7 @@ LIST * list_pop_front( LIST * l ) if ( ( ( size - 1 ) & size ) == 0 ) { - LIST * const nl = list_alloc( size ); - nl->impl.size = size; - memcpy( list_begin( nl ), list_begin( l ) + 1, size * sizeof( OBJECT * ) - ); - list_dealloc( l ); - return nl; + l = list_realloc( l, size ); } l->impl.size = size; From d1e5ae08c583f63d8b5ee22ac0150e8dfb31786e Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 1 Jan 2021 15:43:52 -0600 Subject: [PATCH 088/126] Revert list alloc changes. --- src/engine/lists.cpp | 82 +++++++------------------------------------- 1 file changed, 13 insertions(+), 69 deletions(-) diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index ca880267dd..62a7fd2895 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -14,47 +14,20 @@ #include -static const size_t freelist_size = 16; - -static LIST * freelist[ freelist_size ]; /* junkpile for list_dealloc() */ - -static int32_t get_bucket_size( size_t bucket ) -{ - return int32_t(1) << ( bucket < freelist_size ? bucket : ( freelist_size - 1 ) ); -} - -static size_t get_bucket( int32_t size ) -{ - size_t bucket = 0; - while ( ( bucket < freelist_size ) && ( size > get_bucket_size( bucket ) ) ) ++bucket; - return bucket; -} - static LIST * list_alloc( int32_t size ) { - size_t bucket = get_bucket( size ); - if ( freelist[ bucket ] ) - { - LIST * result = freelist[ bucket ]; - freelist[ bucket ] = result->impl.next; - return result; - } - return (LIST *)BJAM_MALLOC( sizeof( LIST ) + get_bucket_size( bucket ) * - sizeof( OBJECT * ) ); + if ( size == 0 ) return L0; + return (LIST *)BJAM_MALLOC( sizeof( LIST ) + size * sizeof( OBJECT * ) ); } static void list_dealloc( LIST * l ) { - int32_t size = list_length( l ); - size_t bucket; - LIST * node = l; - - if ( size == 0 ) return; - - bucket = get_bucket( size );; + if ( l ) BJAM_FREE( l ); +} - node->impl.next = freelist[ bucket ]; - freelist[ bucket ] = node; +static LIST * list_realloc( LIST * l, int32_t size ) +{ + return (LIST *)BJAM_REALLOC( l, sizeof( LIST ) + size * sizeof( OBJECT * ) ); } /* @@ -65,23 +38,13 @@ LIST * list_append( LIST * l, LIST * nl ) { if ( list_empty( l ) ) return nl; - if ( !list_empty( nl ) ) + if ( list_empty( nl ) ) + return l; { int32_t l_size = list_length( l ); int32_t nl_size = list_length( nl ); int32_t size = l_size + nl_size; - int32_t bucket = get_bucket( size ); - - /* Do we need to reallocate? */ - if ( l_size <= get_bucket_size( bucket ) ) - { - LIST * result = list_alloc( size ); - memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( - OBJECT * ) ); - list_dealloc( l ); - l = result; - } - + l = list_realloc( l, size ); l->impl.size = size; memcpy( list_begin( l ) + l_size, list_begin( nl ), nl_size * sizeof( OBJECT * ) ); @@ -119,17 +82,13 @@ LIST * list_push_back( LIST * head, OBJECT * value ) if ( DEBUG_LISTS ) out_printf( "list > %s <\n", object_str( value ) ); - /* If the size is a power of 2, reallocate. */ if ( size == 0 ) { head = list_alloc( 1 ); } - else if ( ( ( size - 1 ) & size ) == 0 ) + else { - LIST * l = list_alloc( size + 1 ); - memcpy( l, head, sizeof( LIST ) + size * sizeof( OBJECT * ) ); - list_dealloc( head ); - head = l; + head = list_realloc( head, size + 1 ); } list_begin( head )[ size ] = value; @@ -251,12 +210,7 @@ LIST * list_pop_front( LIST * l ) if ( ( ( size - 1 ) & size ) == 0 ) { - LIST * const nl = list_alloc( size ); - nl->impl.size = size; - memcpy( list_begin( nl ), list_begin( l ) + 1, size * sizeof( OBJECT * ) - ); - list_dealloc( l ); - return nl; + l = list_realloc( l, size ); } l->impl.size = size; @@ -368,16 +322,6 @@ LIST * list_unique( LIST * sorted_list ) void list_done() { - for ( int32_t i = 0; i < int32_t(sizeof( freelist ) / sizeof( freelist[ 0 ] )); ++i ) - { - LIST * l = freelist[ i ]; - while ( l ) - { - LIST * const tmp = l; - l = l->impl.next; - BJAM_FREE( tmp ); - } - } } From 537dabb6d3bcbab3551149fde99a90fc69ab6767 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 1 Jan 2021 16:40:42 -0600 Subject: [PATCH 089/126] Revert more list alloc changes. --- src/engine/function.cpp | 15 ++++---- src/engine/lists.cpp | 79 ++++++++++++++++++++++++++++++++++------- 2 files changed, 72 insertions(+), 22 deletions(-) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 04f0d86b9d..056949d9ef 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -923,13 +923,6 @@ static VAR_EXPANDED apply_modifiers( STACK * s, int32_t n ) return result; } -static LIST * apply_modifiers_value( STACK * s, int32_t n ) -{ - auto mod = apply_modifiers( s, n ); - list_free( mod.inner ); - return mod.value; -} - // STACK: LIST * modifiers[modifier_count] static VAR_EXPANDED eval_modifiers( STACK * s, LIST * value, int32_t modifier_count ) { @@ -4950,7 +4943,9 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) l = stack_pop( s ); n = expand_modifiers( s, code->arg ); stack_push( s, l ); - l = apply_modifiers_value( s, n ); + VAR_EXPANDED m = apply_modifiers( s, n ); + l = m.value; + list_free( m.inner ); list_free( stack_pop( s ) ); stack_deallocate( s, n * sizeof( VAR_EDITS ) ); for ( i = 0; i < code->arg; ++i ) @@ -5005,7 +5000,9 @@ LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s ) { stack_push( s, function_get_named_variable( function, frame, list_item( iter ) ) ); - result = apply_modifiers_value( s, n ); + VAR_EXPANDED m = apply_modifiers( s, n ); + result = m.value; + list_free( m.inner ); list_free( stack_pop( s ) ); } list_free( vars ); diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index 62a7fd2895..d646c6e22c 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -14,20 +14,44 @@ #include -static LIST * list_alloc( int32_t size ) +static LIST * freelist[ 32 ]; /* junkpile for list_dealloc() */ + +static int32_t get_bucket( int32_t size ) { - if ( size == 0 ) return L0; - return (LIST *)BJAM_MALLOC( sizeof( LIST ) + size * sizeof( OBJECT * ) ); + int32_t bucket = 0; + while ( size > ( int32_t(1) << bucket ) ) ++bucket; + return bucket; } -static void list_dealloc( LIST * l ) +static LIST * list_alloc( int32_t size ) { - if ( l ) BJAM_FREE( l ); + int32_t bucket = get_bucket( size ); + if ( freelist[ bucket ] ) + { + LIST * result = freelist[ bucket ]; + freelist[ bucket ] = result->impl.next; + return result; + } + return (LIST *)BJAM_MALLOC( sizeof( LIST ) + ( size_t( 1 ) << bucket ) * + sizeof( OBJECT * ) ); } -static LIST * list_realloc( LIST * l, int32_t size ) +static void list_dealloc( LIST * l ) { - return (LIST *)BJAM_REALLOC( l, sizeof( LIST ) + size * sizeof( OBJECT * ) ); + int32_t size = list_length( l ); + int32_t bucket; + LIST * node = l; + + if ( size == 0 ) return; + + bucket = get_bucket( size );; + +#ifdef BJAM_NO_MEM_CACHE + BJAM_FREE( node ); +#else + node->impl.next = freelist[ bucket ]; + freelist[ bucket ] = node; +#endif } /* @@ -38,13 +62,23 @@ LIST * list_append( LIST * l, LIST * nl ) { if ( list_empty( l ) ) return nl; - if ( list_empty( nl ) ) - return l; + if ( !list_empty( nl ) ) { int32_t l_size = list_length( l ); int32_t nl_size = list_length( nl ); int32_t size = l_size + nl_size; - l = list_realloc( l, size ); + int32_t bucket = get_bucket( size ); + + /* Do we need to reallocate? */ + if ( l_size <= ( int32_t(1) << ( bucket - 1 ) ) ) + { + LIST * result = list_alloc( size ); + memcpy( list_begin( result ), list_begin( l ), l_size * sizeof( + OBJECT * ) ); + list_dealloc( l ); + l = result; + } + l->impl.size = size; memcpy( list_begin( l ) + l_size, list_begin( nl ), nl_size * sizeof( OBJECT * ) ); @@ -82,13 +116,17 @@ LIST * list_push_back( LIST * head, OBJECT * value ) if ( DEBUG_LISTS ) out_printf( "list > %s <\n", object_str( value ) ); + /* If the size is a power of 2, reallocate. */ if ( size == 0 ) { head = list_alloc( 1 ); } - else + else if ( ( ( size - 1 ) & size ) == 0 ) { - head = list_realloc( head, size + 1 ); + LIST * l = list_alloc( size + 1 ); + memcpy( l, head, sizeof( LIST ) + size * sizeof( OBJECT * ) ); + list_dealloc( head ); + head = l; } list_begin( head )[ size ] = value; @@ -210,7 +248,12 @@ LIST * list_pop_front( LIST * l ) if ( ( ( size - 1 ) & size ) == 0 ) { - l = list_realloc( l, size ); + LIST * const nl = list_alloc( size ); + nl->impl.size = size; + memcpy( list_begin( nl ), list_begin( l ) + 1, size * sizeof( OBJECT * ) + ); + list_dealloc( l ); + return nl; } l->impl.size = size; @@ -322,6 +365,16 @@ LIST * list_unique( LIST * sorted_list ) void list_done() { + for ( int32_t i = 0; i < int32_t(sizeof( freelist ) / sizeof( freelist[ 0 ] )); ++i ) + { + LIST * l = freelist[ i ]; + while ( l ) + { + LIST * const tmp = l; + l = l->impl.next; + BJAM_FREE( tmp ); + } + } } From 98a6f949947290a138ac0a0ef1f774675ecc3a91 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 15 Jan 2021 09:05:20 -0600 Subject: [PATCH 090/126] Rewrite, and simplify, build for better detection. This rewrites the build.sh to remove duplication of base compiler command to combine checking the command and specifying it. Which allows for only detecting valid working commands, and hence toolsets. This also adds the new Intel oneAPI compiler. --- src/engine/build.sh | 463 ++++++++++++++++++++------------------------ 1 file changed, 207 insertions(+), 256 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 3cf0f53a30..1fee471e7d 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -5,18 +5,33 @@ #~ (See accompanying file LICENSE_1_0.txt or copy at #~ http://www.boost.org/LICENSE_1_0.txt) +FALSE=1 +TRUE=0 + # Reset the toolset. B2_TOOLSET= -B2_OS= + +# Internal options. +B2_VERBOSE=${FALSE} +B2_DEBUG=${FALSE} +B2_GUESS_TOOLSET=${FALSE} + +test_true () +{ + if test $1 -eq ${TRUE} ; then + return ${TRUE} + fi + return ${FALSE} +} # Run a command, and echo before doing so. Also checks the exit status and quits # if there was an error. echo_run () { - echo "> $@" + if test_true ${B2_VERBOSE} ; then echo "> $@" ; fi $@ r=$? - if test $r -ne 0 ; then + if test $r -ne ${TRUE} ; then exit $r fi } @@ -68,379 +83,321 @@ test_uname () fi } -# Check that the given command runs. -test_exec () +test_compiler () { - "$*" 1>/dev/null 2>/dev/null + local ARGS="${CXX:=$@}" + if test_true ${B2_VERBOSE} ; then + echo_run ${ARGS} ${CXXFLAGS} check_cxx11.cpp + else + ${ARGS} ${CXXFLAGS} check_cxx11.cpp 1>/dev/null 2>/dev/null + fi + local CHECK_RESULT=$? + if test_true ${CHECK_RESULT} ; then + B2_CXX=${ARGS} ${CXXFLAGS} + fi + rm -rf check_cxx11.o* a.out 1>/dev/null 2>/dev/null + return ${CHECK_RESULT} } -# Check that the compiler can do C++11. -test_cxx11 () +test_toolset () { - local CXX="${CXX}" - local CXXFLAGS="${CXXFLAGS}" - if test ${NO_CXX_VARS} ; then - CXX= - CXXFLAGS= - fi - if ! test $NO_CXX11_CHECK ; then - case $1 in - gcc) ( ${CXX:=g++} ${CXXFLAGS} -x c++ -std=c++11 -c check_cxx11.cpp && rm -f check_cxx11.o* ) 1>/dev/null 2>/dev/null ;; - intel-darwin) ( ${CXX:=icc} ${CXXFLAGS} -xc++ check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - intel-linux) ( ${CXX:=icpc} ${CXXFLAGS} -x c++ -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - vacpp) ( ${CXX:=xlC_r} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - xlcpp) ( ${CXX:=xlC_r} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - como) ( ${CXX:=como} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - kcc) ( ${CXX:=KCC} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - kylix) ( ${CXX:=bc++} ${CXXFLAGS} -tC -q check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - mipspro) ( ${CXX:=CC} ${CXXFLAGS} -FE:template_in_elf_section -ptused check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - pathscale) ( ${CXX:=pathCC} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - pgi) ( ${CXX:=pgc++} ${CXXFLAGS} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - sun*) ( ${CXX:=CC} ${CXXFLAGS} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - clang*) ( ${CXX:=clang++} ${CXXFLAGS} -x c++ -std=c++11 -c check_cxx11.cpp && rm -f check_cxx11.o* ) 1>/dev/null 2>/dev/null ;; - tru64cxx) ( ${CXX:=cc} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - acc) ( ${CXX:=aCC} ${CXXFLAGS} -AA check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - qcc) ( ${CXX:=QCC} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - cxx) ( ${CXX:=cxx} ${CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - cross-cxx) ( ${BUILD_CXX:=cxx} ${BUILD_CXXFLAGS} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - *) test "0" = "1" ;; - esac - else - test $NO_CXX11_CHECK - fi + if test "${B2_TOOLSET}" = "" ; then return ${TRUE} ; fi + if test "${B2_TOOLSET}" = "$1" -o "${B2_TOOLSET}" = "$2" -o "${B2_TOOLSET}" = "$3" ; then return ${TRUE} ; fi + return 1 } -# Try and guess the toolset to bootstrap the build with... -guess_toolset () +# Check the toolset to bootstrap the build with. The one optional argument to +# the function is a toolset name. This operates as follows based on these +# contextual vars, if set, and if an arg is given: +# +# No vars set: +# Checks, in some priority order, possible toolset commands. Upon finding the +# first working command sets B2_TOOLSET to the toolset and B2_CXX to the +# compile command with any base options. +# +# B2_TOOLSET set, only: +# Checks that toolset for possible compile commands and sets B2_CXX to the +# command that works for the toolset. +# +# CXX set: +# Checks if the indicated CXX command works for building the engine. Sets +# B2_CXX to CXX if successful. +# +check_toolset () { - local NO_CXX_VARS=1 - if test_uname Darwin && test_cxx11 clang ; then B2_TOOLSET=clang - elif test_uname IRIX && test_cxx11 mipspro ; then B2_TOOLSET=mipspro - elif test_uname IRIX64 && test_cxx11 mipspro ; then B2_TOOLSET=mipspro - elif test_uname OSF1 && test_cxx11 tru64cxx ; then B2_TOOLSET=tru64cxx - elif test_uname QNX && test_path QCC && test_cxx11 qcc ; then B2_TOOLSET=qcc - elif test_uname Linux && test_path xlC_r ; then - if /usr/bin/lscpu | grep Byte | grep Little > /dev/null 2>&1 ; then - # Little endian linux - B2_TOOLSET=xlcpp - else - #Big endian linux - B2_TOOLSET=vacpp - fi - elif test_uname AIX && test_path xlC_r && test_cxx11 vacpp ; then B2_TOOLSET=vacpp - elif test_uname FreeBSD && test_path freebsd-version && test_path clang++ && test_cxx11 clang ; then B2_TOOLSET=clang - elif test_path g++ && test_cxx11 gcc ; then B2_TOOLSET=gcc - elif test_path clang++ && test_cxx11 clang ; then B2_TOOLSET=clang - elif test_path icpc && test_cxx11 intel-linux ; then B2_TOOLSET=intel-linux - elif test -r /opt/intel/inteloneapi/setvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel/inteloneapi - elif test -r /opt/intel/cc/9.0/bin/iccvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel/cc/9.0 - elif test -r /opt/intel_cc_80/bin/iccvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel_cc_80 - elif test -r /opt/intel/compiler70/ia32/bin/iccvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel/compiler70/ia32/ - elif test -r /opt/intel/compiler60/ia32/bin/iccvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel/compiler60/ia32/ - elif test -r /opt/intel/compiler50/ia32/bin/iccvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel/compiler50/ia32/ - elif test_path pgc++ && test_cxx11 pgi ; then B2_TOOLSET=pgi - elif test_path pathCC && test_cxx11 pathscale ; then B2_TOOLSET=pathscale - elif test_path como && test_cxx11 como ; then B2_TOOLSET=como - elif test_path KCC && test_cxx11 kcc ; then B2_TOOLSET=kcc - elif test_path bc++ && test_cxx11 kylix ; then B2_TOOLSET=kylix - elif test_path aCC && test_cxx11 acc ; then B2_TOOLSET=acc - elif test_uname HP-UX ; then B2_TOOLSET=acc - elif test -r /opt/SUNWspro/bin/cc && test_cxx11 sunpro ; then - B2_TOOLSET=sunpro - B2_TOOLSET_ROOT=/opt/SUNWspro/ - # Test for some common compile command as the default fallback. - elif test_path $CXX ; then B2_TOOLSET=cxx - elif test_path cxx ; then - B2_TOOLSET=cxx - CXX=cxx - elif test_path cpp ; then - B2_TOOLSET=cxx - CXX=cpp - elif test_path CC ; then - B2_TOOLSET=cxx - CXX=CC + # If we have CXX, and hence also B2_TOOLSET, we check only that and use it. + if test "${CXX}" != "" ; then + if test_compiler "${CXX}" ; then + B2_CXX="${CXX}" + return ${TRUE} + else + return ${FALSE} + fi + fi + # GCC (gcc).. + if test_toolset gcc && test_compiler g++ -x c++ -std=c++11 ; then B2_TOOLSET=gcc ; fi + # Clang (clang).. + if test_toolset clang && test_compiler clang++ -x c++ -std=c++11 ; then B2_TOOLSET=clang ; fi + # Intel macOS (intel-darwin) + if test_toolset intel-darwin && test -r "${HOME}/intel/oneapi/setvars.sh" && test_uname Darwin ; then + . "${HOME}/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi + if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi + fi + if test_toolset intel-darwin && test -r "/opt/intel/oneapi/setvars.sh" && test_uname Darwin ; then + . "/opt/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi + if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi fi - if test "$B2_TOOLSET" = "" ; then + # Intel oneAPI (intel-linux) + if test_toolset intel-linux && test_path icpx ; then + if test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + if test_toolset xyz && test_path icc ; then + if test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + if test_toolset intel-linux && test -r "${HOME}/intel/oneapi/setvars.sh" ; then + . "${HOME}/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + if test_toolset intel-linux && test -r "/opt/intel/oneapi/setvars.sh" ; then + . "/opt/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + # Intel Pro (intel-linux) + if test_toolset intel-linux && test_path icpc ; then + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + if test_toolset intel-linux && test -r "/opt/intel/inteloneapi/setvars.sh" ; then + . "/opt/intel/inteloneapi/setvars.sh" 1>/dev/null 2>/dev/null + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + if test_toolset intel-linux && test -r "/opt/intel/cc/9.0/bin/iccvars.sh" ; then + . "/opt/intel/cc/9.0/bin/iccvars.sh" 1>/dev/null 2>/dev/null + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + if test_toolset intel-linux && test -r "/opt/intel_cc_80/bin/iccvars.sh" ; then + . "/opt/intel_cc_80/bin/iccvars.sh" 1>/dev/null 2>/dev/null + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + fi + # Mips Pro (mipspro) + if test_toolset mipspro && test_uname IRIX && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; fi + if test_toolset mipspro && test_uname IRIX64 && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; fi + # OSF Tru64 C++ (tru64cxx) + if test_toolset tru64cxx && test_uname OSF1 && test_compiler cc ; then B2_TOOLSET=mipspro ; fi + # QNX (qcc) + if test_toolset qcc && test_uname QNX && test_compiler QCC ; then B2_TOOLSET=mipspro ; fi + # Linux XL/VA C++ (xlcpp, vacpp) + if test_toolset xlcpp vacpp && test_uname Linux && test_compiler xlC_r ; then + if /usr/bin/lscpu | grep Byte | grep Little > /dev/null 2>&1 ; then + # Little endian linux + B2_TOOLSET=xlcpp + else + # Big endian linux + B2_TOOLSET=vacpp + fi + fi + # AIX VA C++ (vacpp) + if test_toolset vacpp && test_uname AIX && test_compiler xlC_r ; then B2_TOOLSET=vacpp ; fi + # PGI (pgi) + if test_toolset pgi && test_compiler pgc++ -std=c++11 ; then B2_TOOLSET=pgi ; fi + # Pathscale C++ (pathscale) + if test_toolset pathscale && test_compiler pathCC ; then B2_TOOLSET=pathscale ; fi + # Como (como) + if test_toolset como && test_compiler como ; then B2_TOOLSET=como ; fi + # Borland C++ (kcc, kylix) + if test_toolset kcc && test_compiler KCC ; then B2_TOOLSET=kcc ; fi + if test_toolset kylix && test_compiler bc++ -tC -q ; then B2_TOOLSET=kylix ; fi + # aCC (acc) + if test_toolset acc && test_compiler aCC -AA ; then B2_TOOLSET=acc ; fi + # Sun Pro C++ (sunpro) + if test_toolset sunpro && test_compiler /opt/SUNWspro/bin/CC -std=c++11 ; then B2_TOOLSET=sunpro ; fi + # Generic (cxx) + if test_toolset cxx && test_compiler cxx ; then B2_TOOLSET=cxx ; fi + if test_toolset cxx && test_compiler cpp ; then B2_TOOLSET=cxx ; fi + if test_toolset cxx && test_compiler CC ; then B2_TOOLSET=cxx ; fi + # Generic cross compile (cross-cxx) + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cxx} ; then B2_TOOLSET=cross-cxx ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cpp} ; then B2_TOOLSET=cross-cxx ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=CC} ; then B2_TOOLSET=cross-cxx ; fi + + # Nothing found. + if test "${B2_TOOLSET}" = "" ; then error_exit "Could not find a suitable toolset." fi + return ${TRUE} } -check_debug_build () -{ - while test $# -gt 0 - do - case "$1" in - --debug) return 0 ;; - esac - shift - done - return 1 -} +# Handle command options and args. +while test $# -gt 0 +do + case "$1" in + --verbose) B2_VERBOSE=${TRUE} ;; + --debug) B2_DEBUG=${TRUE} ;; + --guess-toolset) B2_GUESS_TOOLSET=${TRUE} ;; + -*) ;; + ?*) B2_TOOLSET=$1 ;; + esac + shift +done + +# If we have a CXX but no B2_TOLSET specified by the user we assume they meant +# "cxx" as the toolset. +if test "${CXX}" != "" -a "${B2_TOOLSET}" = "" ; then + B2_TOOLSET=cxx +fi -# The one option we support in the invocation -# is the name of the toolset to force building -# with. -case "$1" in - --guess-toolset) NO_CXX11_CHECK=1 ; guess_toolset ; echo "$B2_TOOLSET" ; exit 1 ;; - -*) guess_toolset ;; - ?*) B2_TOOLSET=$1 ; shift ;; - *) guess_toolset ;; -esac +# Guess toolset, or toolset commands. +check_toolset +TOOLSET_CHECK=$? -# We need a C++11 compiler. Check here and give some feedback about it. -if ! test_cxx11 $B2_TOOLSET ; then - error_exit " -A C++11 capable compiler is required for building the B2 engine. -Toolset '$B2_TOOLSET' does not appear to support C++11. +# We can bail from the rest of the checks and build if we are just guessing +# the toolset. +if test_true ${B2_GUESS_TOOLSET} ; then + echo "${B2_TOOLSET}" + exit 0 +fi +# We need a viable compiler. Check here and give some feedback about it. +if ! test_true ${TOOLSET_CHECK} ; then + echo " +A C++11 capable compiler is required for building the B2 engine. +Toolset '${B2_TOOLSET}' does not appear to support C++11. +" + (B2_VERBOSE=${TRUE} check_toolset) + error_exit " ** Note, the C++11 capable compiler is _only_ required for building the B2 ** engine. The B2 build system allows for using any C++ level and any other ** supported language and resource in your projects. " fi -case $B2_TOOLSET in +# Set the additional options needed to build the engine based on the toolset. +case "${B2_TOOLSET}" in gcc) - CXX=${CXX:=g++} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - # Check whether it's MinGW GCC, which has Windows headers and none of POSIX ones. - machine=$(${CXX} -dumpmachine 2>/dev/null) + # Check for machine specific options. + machine=$(${B2_CXX} -dumpmachine 2>/dev/null) if test $? -ne 0 ; then echo "B2_TOOLSET is gcc, but the 'gcc' command cannot be executed." echo "Make sure 'gcc' is in PATH, or use a different toolset." exit 1 fi case $machine in - *mingw*) - # MinGW insists that its bin directory be in PATH. - if test -r ${B2_TOOLSET_ROOT}bin/gcc ; then - export PATH=${B2_TOOLSET_ROOT}bin:$PATH - fi - B2_CXX="${CXX} -x c++ -std=c++11" - B2_CXXFLAGS_RELEASE="-O2 -s" - B2_CXXFLAGS_DEBUG="-O0 -g" - B2_OS="NT" - ;; - - *cygwin*) - B2_CXX="${CXX} -x c++ -std=gnu++11" - B2_CXXFLAGS_RELEASE="-O2 -s" - B2_CXXFLAGS_DEBUG="-O0 -g" - ;; - - *ibm-aix*) - # AIX needs threading option to use std::thread, it seems. - B2_CXX="${CXX} -x c++ -std=c++11 -pthread" - B2_CXXFLAGS_RELEASE="-O2 -s" - B2_CXXFLAGS_DEBUG="-O0 -g" - ;; - - *) - B2_CXX="${CXX} -x c++ -std=c++11" + *ibm-aix*) + # AIX needs threading option to use std::thread, it seems. + B2_CXX="${B2_CXX} -pthread" + ;; + esac B2_CXXFLAGS_RELEASE="-O2 -s" B2_CXXFLAGS_DEBUG="-O0 -g" - esac ;; - intel-darwin) - CXX=${CXX:=icc} + intel-*) CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX} -xc++" - B2_CXXFLAGS_RELEASE="-O3 -s" - B2_CXXFLAGS_DEBUG="-O0 -g -p" - ;; - - intel-linux) - CXX=${CXX:=icpc} - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - if test_path ${CXX} ; then - echo "Found ${CXX} in environment" - B2_TOOLSET_ROOT=`echo ${CXX}| sed -e 's/bin.*\/icpc//'` - # probably the most widespread - ARCH=intel64 - else - echo "No intel compiler in current path" - echo "Look in a few common places just in case" - if test -r /opt/intel/inteloneapi/setvars.sh ; then - B2_TOOLSET_ROOT=/opt/intel/inteloneapi - elif test -r /opt/intel/cc/9.0/bin/iccvars.sh ; then - B2_TOOLSET_ROOT=/opt/intel/cc/9.0/ - elif test -r /opt/intel_cc_80/bin/iccvars.sh ; then - B2_TOOLSET_ROOT=/opt/intel_cc_80/ - elif test -r /opt/intel/compiler70/ia32/bin/iccvars.sh ; then - B2_TOOLSET_ROOT=/opt/intel/compiler70/ia32/ - elif test -r /opt/intel/compiler60/ia32/bin/iccvars.sh ; then - B2_TOOLSET_ROOT=/opt/intel/compiler60/ia32/ - elif test -r /opt/intel/compiler50/ia32/bin/iccvars.sh ; then - B2_TOOLSET_ROOT=/opt/intel/compiler50/ia32/ - fi - fi - if test -r ${B2_TOOLSET_ROOT}/setvars.sh ; then - . ${B2_TOOLSET_ROOT}/setvars.sh - elif test -r ${B2_TOOLSET_ROOT}bin/iccvars.sh ; then - # iccvars does not change LD_RUN_PATH. We adjust LD_RUN_PATH here in - # order not to have to rely on ld.so.conf knowing the icpc library - # directory. We do this before running iccvars.sh in order to allow a - # user to add modifications to LD_RUN_PATH in iccvars.sh. - if test -z "${LD_RUN_PATH}"; then - LD_RUN_PATH="${B2_TOOLSET_ROOT}lib" - else - LD_RUN_PATH="${B2_TOOLSET_ROOT}lib:${LD_RUN_PATH}" - fi - export LD_RUN_PATH - . ${B2_TOOLSET_ROOT}bin/iccvars.sh $ARCH - fi - B2_CXX="${CXX} -x c++ -std=c++11" B2_CXXFLAGS_RELEASE="-O3 -s" B2_CXXFLAGS_DEBUG="-O0 -g -p" ;; vacpp) - CXX=${CXX:=xlC_r} CXX_VERSION_OPT=${CXX_VERSION_OPT:=-qversion} - B2_CXX="${CXX}" B2_CXXFLAGS_RELEASE="-O3 -s -qstrict -qinline" B2_CXXFLAGS_DEBUG="-g -qNOOPTimize -qnoinline -pg" ;; xlcpp) - CXX=${CXX:=xlC_r} CXX_VERSION_OPT=${CXX_VERSION_OPT:=-qversion} - B2_CXX="${CXX}" B2_CXXFLAGS_RELEASE="-s -O3 -qstrict -qinline" B2_CXXFLAGS_DEBUG="-g -qNOOPTimize -qnoinline -pg" ;; como) - CXX=${CXX:=como} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX}" B2_CXXFLAGS_RELEASE="-O3 --inlining" B2_CXXFLAGS_DEBUG="-O0 -g --no_inlining --long_long" ;; kcc) - CXX=${CXX:=KCC} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="KCC" B2_CXXFLAGS_RELEASE="+K2 -s" B2_CXXFLAGS_DEBUG="+K0 -g" ;; kylix) - CXX=${CXX:=bc++} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="bc++ -tC -q" B2_CXXFLAGS_RELEASE="-O2 -vi -w-inl -s" B2_CXXFLAGS_DEBUG="-Od -v -vi-" ;; mipspro) - CXX=${CXX:=CC} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX} -FE:template_in_elf_section -ptused" B2_CXXFLAGS_RELEASE="-Ofast -g0 \"-INLINE:none\" -s" B2_CXXFLAGS_DEBUG="-O0 -INLINE -g" ;; pathscale) - CXX=${CXX:=pathCC} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX}" B2_CXXFLAGS_RELEASE="-O3 -inline -s" B2_CXXFLAGS_DEBUG="-O0 -noinline -ggdb" ;; pgi) - CXX=${CXX:=pgc++} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX} -std=c++11" B2_CXXFLAGS_RELEASE="-fast -s" B2_CXXFLAGS_DEBUG="-O0 -gopt" ;; sun*) - CXX=${CXX:=CC} CXX_VERSION_OPT=${CXX_VERSION_OPT:=-V} - if test -z "${B2_TOOLSET_ROOT}" -a -r /opt/SUNWspro/bin/CC ; then - B2_TOOLSET_ROOT=/opt/SUNWspro/ - fi - if test -r "${B2_TOOLSET_ROOT}/bin/CC" ; then - PATH=${B2_TOOLSET_ROOT}bin:${PATH} - export PATH - fi - B2_CXX="${CXX} -std=c++11" B2_CXXFLAGS_RELEASE="-xO4 -s" B2_CXXFLAGS_DEBUG="-g" ;; clang*) - CXX=${CXX:=clang++} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX} -x c++ -std=c++11" - B2_TOOLSET=clang B2_CXXFLAGS_RELEASE="-O3 -s" B2_CXXFLAGS_DEBUG="-O0 -fno-inline -g" ;; tru64cxx) CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="cc" B2_CXXFLAGS_RELEASE="-O5 -inline speed -s" B2_CXXFLAGS_DEBUG="-O0 -pg -g" ;; acc) - CXX=${CXX:=aCC} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX} -AA" B2_CXXFLAGS_RELEASE="-O3 -s" B2_CXXFLAGS_DEBUG="+d -g" ;; qcc) - CXX=${CXX:=QCC} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX}" B2_CXXFLAGS_RELEASE="-O3 -Wc,-finline-functions" B2_CXXFLAGS_DEBUG="O0 -Wc,-fno-inline -gstabs+" ;; cxx) - CXX=${CXX:=cxx} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX}" ;; cross-cxx) - CXX=${BUILD_CXX:=cxx} CXXFLAGS=${BUILD_CXXFLAGS} CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX}" ;; *) - error_exit "Unknown toolset: $B2_TOOLSET" + error_exit "Unknown toolset: ${B2_TOOLSET}" ;; esac echo " ### ### -### Using '$B2_TOOLSET' toolset. +### Using '${B2_TOOLSET}' toolset. ### ### " @@ -459,7 +416,9 @@ B2_SOURCES="\ debug.cpp \ debugger.cpp \ execcmd.cpp \ + execunix.cpp \ filesys.cpp \ + fileunix.cpp \ frames.cpp \ function.cpp \ glob.cpp\ @@ -467,6 +426,7 @@ B2_SOURCES="\ hcache.cpp \ hdrmacro.cpp \ headers.cpp \ + jam_strings.cpp \ jam.cpp \ jamgram.cpp \ lists.cpp \ @@ -481,11 +441,11 @@ B2_SOURCES="\ output.cpp \ parse.cpp \ pathsys.cpp \ + pathunix.cpp \ regexp.cpp \ rules.cpp \ scan.cpp \ search.cpp \ - jam_strings.cpp \ startup.cpp \ subst.cpp \ sysinfo.cpp \ @@ -499,18 +459,9 @@ B2_SOURCES="\ modules/sequence.cpp \ modules/set.cpp \ " -case $B2_OS in - NT) - B2_SOURCES="${B2_SOURCES} execnt.cpp filent.cpp pathnt.cpp" - ;; - - *) - B2_SOURCES="${B2_SOURCES} execunix.cpp fileunix.cpp pathunix.cpp" - ;; -esac -if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}" +if test_true ${B2_DEBUG} ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}" else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG" fi -echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 -echo_run cp b2 bjam +B2_VERBOSE=${TRUE} echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 +B2_VERBOSE=${TRUE} echo_run cp b2 bjam From 9c8bb1d22fdd28cd3b29ed6e8b6f7fe67be17f19 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 15 Jan 2021 12:59:34 -0600 Subject: [PATCH 091/126] Make the use CXX only replace the exec. CXX was previously only used to replace the exec part of the compiler commands. This change restores that aspect. It also makes the toolset checks short circuit so that we do get the best toolset and command detected. --- src/engine/build.sh | 98 +++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 53 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 1fee471e7d..0ce382ce31 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -85,15 +85,18 @@ test_uname () test_compiler () { - local ARGS="${CXX:=$@}" + local exe="${CXX:=$1}" + shift + local args="$@" + local command="${exe} ${args} ${CXXFLAGS}" if test_true ${B2_VERBOSE} ; then - echo_run ${ARGS} ${CXXFLAGS} check_cxx11.cpp + echo_run ${command} check_cxx11.cpp else - ${ARGS} ${CXXFLAGS} check_cxx11.cpp 1>/dev/null 2>/dev/null + ${command} check_cxx11.cpp 1>/dev/null 2>/dev/null fi local CHECK_RESULT=$? if test_true ${CHECK_RESULT} ; then - B2_CXX=${ARGS} ${CXXFLAGS} + B2_CXX=${command} fi rm -rf check_cxx11.o* a.out 1>/dev/null 2>/dev/null return ${CHECK_RESULT} @@ -115,119 +118,108 @@ test_toolset () # first working command sets B2_TOOLSET to the toolset and B2_CXX to the # compile command with any base options. # -# B2_TOOLSET set, only: +# B2_TOOLSET set: # Checks that toolset for possible compile commands and sets B2_CXX to the # command that works for the toolset. # -# CXX set: -# Checks if the indicated CXX command works for building the engine. Sets -# B2_CXX to CXX if successful. -# check_toolset () { - # If we have CXX, and hence also B2_TOOLSET, we check only that and use it. - if test "${CXX}" != "" ; then - if test_compiler "${CXX}" ; then - B2_CXX="${CXX}" - return ${TRUE} - else - return ${FALSE} - fi - fi # GCC (gcc).. - if test_toolset gcc && test_compiler g++ -x c++ -std=c++11 ; then B2_TOOLSET=gcc ; fi + if test_toolset gcc && test_compiler g++ -x c++ -std=c++11 ; then B2_TOOLSET=gcc ; return ${TRUE} ; fi # Clang (clang).. - if test_toolset clang && test_compiler clang++ -x c++ -std=c++11 ; then B2_TOOLSET=clang ; fi + if test_toolset clang && test_compiler clang++ -x c++ -std=c++11 ; then B2_TOOLSET=clang ; return ${TRUE} ; fi # Intel macOS (intel-darwin) if test_toolset intel-darwin && test -r "${HOME}/intel/oneapi/setvars.sh" && test_uname Darwin ; then . "${HOME}/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null - if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi - if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi + if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi + if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi fi if test_toolset intel-darwin && test -r "/opt/intel/oneapi/setvars.sh" && test_uname Darwin ; then . "/opt/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null - if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi - if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; fi + if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi + if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi fi # Intel oneAPI (intel-linux) if test_toolset intel-linux && test_path icpx ; then - if test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset xyz && test_path icc ; then - if test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "${HOME}/intel/oneapi/setvars.sh" ; then . "${HOME}/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null - if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi - if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "/opt/intel/oneapi/setvars.sh" ; then . "/opt/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null - if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi - if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi # Intel Pro (intel-linux) if test_toolset intel-linux && test_path icpc ; then - if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "/opt/intel/inteloneapi/setvars.sh" ; then . "/opt/intel/inteloneapi/setvars.sh" 1>/dev/null 2>/dev/null - if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "/opt/intel/cc/9.0/bin/iccvars.sh" ; then . "/opt/intel/cc/9.0/bin/iccvars.sh" 1>/dev/null 2>/dev/null - if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "/opt/intel_cc_80/bin/iccvars.sh" ; then . "/opt/intel_cc_80/bin/iccvars.sh" 1>/dev/null 2>/dev/null - if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; fi + if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi # Mips Pro (mipspro) - if test_toolset mipspro && test_uname IRIX && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; fi - if test_toolset mipspro && test_uname IRIX64 && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; fi + if test_toolset mipspro && test_uname IRIX && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; return ${TRUE} ; fi + if test_toolset mipspro && test_uname IRIX64 && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; return ${TRUE} ; fi # OSF Tru64 C++ (tru64cxx) - if test_toolset tru64cxx && test_uname OSF1 && test_compiler cc ; then B2_TOOLSET=mipspro ; fi + if test_toolset tru64cxx && test_uname OSF1 && test_compiler cc ; then B2_TOOLSET=mipspro ; return ${TRUE} ; fi # QNX (qcc) - if test_toolset qcc && test_uname QNX && test_compiler QCC ; then B2_TOOLSET=mipspro ; fi + if test_toolset qcc && test_uname QNX && test_compiler QCC ; then B2_TOOLSET=mipspro ; return ${TRUE} ; fi # Linux XL/VA C++ (xlcpp, vacpp) if test_toolset xlcpp vacpp && test_uname Linux && test_compiler xlC_r ; then if /usr/bin/lscpu | grep Byte | grep Little > /dev/null 2>&1 ; then # Little endian linux B2_TOOLSET=xlcpp + return ${TRUE} else # Big endian linux B2_TOOLSET=vacpp + return ${TRUE} fi fi # AIX VA C++ (vacpp) - if test_toolset vacpp && test_uname AIX && test_compiler xlC_r ; then B2_TOOLSET=vacpp ; fi + if test_toolset vacpp && test_uname AIX && test_compiler xlC_r ; then B2_TOOLSET=vacpp ; return ${TRUE} ; fi # PGI (pgi) - if test_toolset pgi && test_compiler pgc++ -std=c++11 ; then B2_TOOLSET=pgi ; fi + if test_toolset pgi && test_compiler pgc++ -std=c++11 ; then B2_TOOLSET=pgi ; return ${TRUE} ; fi # Pathscale C++ (pathscale) - if test_toolset pathscale && test_compiler pathCC ; then B2_TOOLSET=pathscale ; fi + if test_toolset pathscale && test_compiler pathCC ; then B2_TOOLSET=pathscale ; return ${TRUE} ; fi # Como (como) - if test_toolset como && test_compiler como ; then B2_TOOLSET=como ; fi + if test_toolset como && test_compiler como ; then B2_TOOLSET=como ; return ${TRUE} ; fi # Borland C++ (kcc, kylix) - if test_toolset kcc && test_compiler KCC ; then B2_TOOLSET=kcc ; fi - if test_toolset kylix && test_compiler bc++ -tC -q ; then B2_TOOLSET=kylix ; fi + if test_toolset kcc && test_compiler KCC ; then B2_TOOLSET=kcc ; return ${TRUE} ; fi + if test_toolset kylix && test_compiler bc++ -tC -q ; then B2_TOOLSET=kylix ; return ${TRUE} ; fi # aCC (acc) - if test_toolset acc && test_compiler aCC -AA ; then B2_TOOLSET=acc ; fi + if test_toolset acc && test_compiler aCC -AA ; then B2_TOOLSET=acc ; return ${TRUE} ; fi # Sun Pro C++ (sunpro) - if test_toolset sunpro && test_compiler /opt/SUNWspro/bin/CC -std=c++11 ; then B2_TOOLSET=sunpro ; fi + if test_toolset sunpro && test_compiler /opt/SUNWspro/bin/CC -std=c++11 ; then B2_TOOLSET=sunpro ; return ${TRUE} ; fi # Generic (cxx) - if test_toolset cxx && test_compiler cxx ; then B2_TOOLSET=cxx ; fi - if test_toolset cxx && test_compiler cpp ; then B2_TOOLSET=cxx ; fi - if test_toolset cxx && test_compiler CC ; then B2_TOOLSET=cxx ; fi + if test_toolset cxx && test_compiler cxx ; then B2_TOOLSET=cxx ; return ${TRUE} ; fi + if test_toolset cxx && test_compiler cpp ; then B2_TOOLSET=cxx ; return ${TRUE} ; fi + if test_toolset cxx && test_compiler CC ; then B2_TOOLSET=cxx ; return ${TRUE} ; fi # Generic cross compile (cross-cxx) - if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cxx} ; then B2_TOOLSET=cross-cxx ; fi - if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cpp} ; then B2_TOOLSET=cross-cxx ; fi - if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=CC} ; then B2_TOOLSET=cross-cxx ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cxx} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cpp} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=CC} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi # Nothing found. if test "${B2_TOOLSET}" = "" ; then error_exit "Could not find a suitable toolset." fi - return ${TRUE} + return ${FALSE} } # Handle command options and args. From e0fb497c0c4fe4383e24bb5cb83ddcfcc81c9028 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 15 Jan 2021 13:20:00 -0600 Subject: [PATCH 092/126] Fix bac local var name on some shells. --- src/engine/build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 0ce382ce31..9393b4c137 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -87,8 +87,7 @@ test_compiler () { local exe="${CXX:=$1}" shift - local args="$@" - local command="${exe} ${args} ${CXXFLAGS}" + local command="${exe} $@ ${CXXFLAGS}" if test_true ${B2_VERBOSE} ; then echo_run ${command} check_cxx11.cpp else From 38e16bee51b1d9d023c069ac38b97996531813a4 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 15 Jan 2021 17:02:40 -0600 Subject: [PATCH 093/126] Move local var to top to try and avoid Ubuntu errors. --- src/engine/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 9393b4c137..ad37216581 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -85,17 +85,18 @@ test_uname () test_compiler () { - local exe="${CXX:=$1}" + local EXE="${CXX:=$1}" + local COMAND shift - local command="${exe} $@ ${CXXFLAGS}" + COMAND="${EXE} $@ ${CXXFLAGS:=}" if test_true ${B2_VERBOSE} ; then - echo_run ${command} check_cxx11.cpp + echo_run ${COMAND} check_cxx11.cpp else - ${command} check_cxx11.cpp 1>/dev/null 2>/dev/null + ${COMAND} check_cxx11.cpp 1>/dev/null 2>/dev/null fi local CHECK_RESULT=$? if test_true ${CHECK_RESULT} ; then - B2_CXX=${command} + B2_CXX=${COMAND} fi rm -rf check_cxx11.o* a.out 1>/dev/null 2>/dev/null return ${CHECK_RESULT} From 69b1c679bbe5b35e8a9afe5cb8f7feae9328e9cd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 16 Jan 2021 10:41:04 -0600 Subject: [PATCH 094/126] Fix script to work when run from outside dirs. --- src/engine/build.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/engine/build.sh b/src/engine/build.sh index ad37216581..3a22f9ac49 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -16,6 +16,18 @@ B2_VERBOSE=${FALSE} B2_DEBUG=${FALSE} B2_GUESS_TOOLSET=${FALSE} +# We need to calculate and set SCRIPT_PATH and SCRIPT_DIR to reference this +# script so that we can refer to file relative to it. +SCRIPT_PATH=${BASH_SOURCE[0]} +if test "${SCRIPT_PATH}" == "" ; then + SCRIPT_PATH=$0 +fi +SCRIPT_DIR="$( cd "$( dirname "${SCRIPT_PATH}" )" && pwd )" + +# This script needs to operate at engine source directory. +SAVED_PWD="${PWD}" +cd "${SCRIPT_DIR}" + test_true () { if test $1 -eq ${TRUE} ; then From 7231fa11bfa51de0f2c6c7a21305b18ff22424c8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 16 Jan 2021 12:10:02 -0600 Subject: [PATCH 095/126] Fix @() parsing errors. --- doc/jamfile.jam | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/jamfile.jam b/doc/jamfile.jam index 856a3fe169..8ed7bfd38b 100644 --- a/doc/jamfile.jam +++ b/doc/jamfile.jam @@ -63,13 +63,15 @@ install html : index : $(doc-dir) website-html ; explicit html ; make index.html : : @make_redir_html : .. ; +REDIR_HTML = " + +Automatic redirection failed, please go to doc/html/index.html. + + +" ; actions make_redir_html { - echo @($(<):E= -Automatic redirection failed, please go to -doc/html/index.html. - -) + echo @($(<):O=F:E=$(REDIR_HTML)) } explicit index.html ; From c6937c02288dc956ec11c4df15cd75e3228b79fd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 16 Jan 2021 13:02:13 -0600 Subject: [PATCH 096/126] Guard against non-bash shells. --- src/engine/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 3a22f9ac49..5cc1a8ec6d 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -18,7 +18,9 @@ B2_GUESS_TOOLSET=${FALSE} # We need to calculate and set SCRIPT_PATH and SCRIPT_DIR to reference this # script so that we can refer to file relative to it. -SCRIPT_PATH=${BASH_SOURCE[0]} +if test -v BASH_SOURCE ; then + SCRIPT_PATH=${BASH_SOURCE[0]} +fi if test "${SCRIPT_PATH}" == "" ; then SCRIPT_PATH=$0 fi From f3aa3f9ae870796cbf2139d69d43001aed76cecd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 16 Jan 2021 16:59:28 -0600 Subject: [PATCH 097/126] Fixes for POSIX sh. --- src/engine/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 5cc1a8ec6d..3cfbb11e27 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -18,10 +18,11 @@ B2_GUESS_TOOLSET=${FALSE} # We need to calculate and set SCRIPT_PATH and SCRIPT_DIR to reference this # script so that we can refer to file relative to it. -if test -v BASH_SOURCE ; then +SCRIPT_PATH="" +if test "${BASH_SOURCE}" ; then SCRIPT_PATH=${BASH_SOURCE[0]} fi -if test "${SCRIPT_PATH}" == "" ; then +if test "${SCRIPT_PATH}" = "" ; then SCRIPT_PATH=$0 fi SCRIPT_DIR="$( cd "$( dirname "${SCRIPT_PATH}" )" && pwd )" From c4f6ad58ecc23f2b232e9af37272050309355935 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 16 Jan 2021 21:24:43 -0600 Subject: [PATCH 098/126] Update doc build env to latest. --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb7fe6e586..17f278569c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -414,11 +414,11 @@ stages: - job: Documentation pool: - vmImage: 'ubuntu-16.04' + vmImage: 'ubuntu-latest' steps: - task: UsePythonVersion@0 inputs: - versionSpec: '2.x' + versionSpec: '3.x' - task: UseRubyVersion@0 - bash: | pip install --user Pygments From e63cedb6c43cc1e8fb679820a11428a84d5dad3d Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 18 Jan 2021 11:40:46 -0500 Subject: [PATCH 099/126] Support the new Intel OneAPI product (#700) Fix for the latest icl.exe in the Intel OneAPI product. The icl.exe major version number in the oneAPI product starts with "2021" rather than "21", but the fix supports also specifying the major version number of icl.exe in the oneAPI as starting with "21". In the oneAPI product the setup file is called "setvars.bat" and not "iclvars.bat". Finally all tests for icl major versions are changed from the previously faulty string comparisons to the correct number comparisons. --- src/tools/intel-win.jam | 56 +++++++++++++++++++++++++++++++---------- src/tools/intel.jam | 13 +++++----- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/tools/intel-win.jam b/src/tools/intel-win.jam index f79fd530a2..08acd9ab3e 100644 --- a/src/tools/intel-win.jam +++ b/src/tools/intel-win.jam @@ -16,6 +16,7 @@ import toolset ; import generators ; import type ; import path ; +import numbers ; feature.extend-subfeature toolset intel : platform : win ; @@ -166,27 +167,44 @@ local rule configure-really ( version ? : command * : options * : compatibility local root = [ feature.get-values : $(options) ] ; if $(command) || $(root) { - local bin = [ common.get-absolute-tool-path $(command[-1]) ] ; - if $(major) >= 12 + local bin ; + if $(command) { - bin = [ path.make $(bin) ] ; - bin = [ path.parent $(bin) ] ; + bin = [ common.get-absolute-tool-path $(command[-1]) ] ; + if $(bin) && ( $(major) = 12 || [ numbers.less 12 $(major) ] ) + { + bin = [ path.make $(bin) ] ; + bin = [ path.parent $(bin) ] ; + } } root ?= $(bin) ; root = $(root)/ ; } local setup ; - setup = [ path.glob $(root) : iclvars_*.bat ] ; + local setup_astk_bat ; + local setup_bat ; + if $(major) = 21 || [ numbers.less 21 $(major) ] + { + setup_astk_bat = "setvars_*.bat" ; + setup_bat = "setvars.bat" ; + } + else + { + setup_astk_bat = "iclvars_*.bat" ; + setup_bat = "iclvars.bat" ; + } + + setup = [ path.glob $(root) : $(setup_astk_bat) ] ; if ! $(setup) { - setup = [ path.join $(root) "iclvars.bat" ] ; + setup = [ path.join $(root) $(setup_bat) ] ; setup = [ path.native $(setup) ] ; } local target_types ; local iclvars_vs_arg ; - if $(major) >= 12 + if $(major) = 12 || [ numbers.less 12 $(major) ] { # if we have a known intel toolset check for visual studio compatibility # if not trust parameters @@ -208,7 +226,17 @@ local rule configure-really ( version ? : command * : options * : compatibility # and don't rely on whether the OS reports whether we're 64 or 32 bit # as that really only tells us which subsystem bjam is running in: # - local intel64_path = [ path.join $(root) intel64 ] ; + local root_start ; + if $(major) = 21 || [ numbers.less 21 $(major) ] + { + root_start = [ path.join $(root) "compiler/latest/windows/bin" ] ; + root_start = [ path.native $(root_start) ] ; + } + else + { + root_start = $(root) ; + } + local intel64_path = [ path.join $(root_start) intel64 ] ; if [ path.glob $(intel64_path) : icl.exe ] { target_types = ia32 intel64 ; @@ -233,7 +261,7 @@ local rule configure-really ( version ? : command * : options * : compatibility { local cpu-conditions ; local setup-call ; - if $(major) >= 12 + if $(major) = 12 || [ numbers.less 12 $(major) ] { cpu-conditions = $(condition)/$(.cpu-arch-$(c)) ; @@ -310,18 +338,18 @@ local rule configure-really ( version ? : command * : options * : compatibility # Disable Microsoft "secure" overloads in Dinkumware libraries since they # cause compile errors with Intel versions 9 and 10. - if $(major) < 12 + if [ numbers.less $(major) 12 ] { C++FLAGS += -D_SECURE_SCL=0 ; } - if $(major) > 5 + if [ numbers.less 5 $(major) ] { C++FLAGS += "/Zc:forScope" ; # Add support for correct for loop scoping. } # Add options recognized only by intel7 and above. - if $(major) >= 7 + if $(major) = 7 || [ numbers.less 7 $(major) ] { C++FLAGS += /Qansi_alias ; } @@ -340,7 +368,7 @@ local rule configure-really ( version ? : command * : options * : compatibility } else { - if $(major) > 5 + if [ numbers.less 5 $(major) ] { # Add support for wchar_t C++FLAGS += "/Zc:wchar_t" @@ -498,6 +526,8 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .iclvars-18.0-supported-vcs = "14.1 14.0 12.0 11.0 10.0" ; .iclvars-19.0-supported-vcs = "14.2 14.1 14.0 12.0" ; .iclvars-19.1-supported-vcs = "14.2 14.1 14.0 12.0" ; +.iclvars-21.1-supported-vcs = "14.2 14.1" ; +.iclvars-2021.1-supported-vcs = "14.2 14.1" ; .iclvars-version-alias-vc14.2 = vs2019 ; .iclvars-version-alias-vc14.1 = vs2017 ; .iclvars-version-alias-vc14 = vs2015 ; diff --git a/src/tools/intel.jam b/src/tools/intel.jam index 0c602a8c09..83b00ae313 100644 --- a/src/tools/intel.jam +++ b/src/tools/intel.jam @@ -44,12 +44,13 @@ Specifies additional command line options that will be passed to the linker. For the Linux version, specifies the root directory of the compiler installation. This option is necessary only if it is not possible to detect this information from the compiler command -- for example if the specified compiler command is -a user script. For the Windows version, specifies the directory where the -`iclvars.bat` file for configuring the compiler exists. Specifying the `root` -option without specifying the compiler command allows the end-user not to have -to worry about whether he is compiling 32-bit or 64-bit code, as the toolset will -automatically configure the compiler for the appropriate address model and compiler -command using the `iclvars.bat` batch file. +a user script. For the Windows version, specifies the directory of the +`iclvars.bat` file, for versions prior to 21 ( or 2021 ), or of the `setvars.bat`, +for versions from 21 ( or 2021 ) on up, for configuring the compiler. +Specifying the `root` option without specifying the compiler command allows the +end-user not to have to worry about whether they are compiling 32-bit or 64-bit code, +as the toolset will automatically configure the compiler for the appropriate address +model and compiler command using the `iclvars.bat` or `setvars.bat` batch file. |# # end::doc[] From 2377e082625ddcbdb463f96319121940c6cbf139 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 20 Jan 2021 16:17:28 -0600 Subject: [PATCH 100/126] Support building on Windows bash with mingw. fixes #703 --- src/engine/build.sh | 4 +++- src/engine/execnt.cpp | 4 +++- src/engine/execunix.cpp | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 3cfbb11e27..0aba819956 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -113,7 +113,7 @@ test_compiler () if test_true ${CHECK_RESULT} ; then B2_CXX=${COMAND} fi - rm -rf check_cxx11.o* a.out 1>/dev/null 2>/dev/null + rm -rf check_cxx11.o* a.out a.exe 1>/dev/null 2>/dev/null return ${CHECK_RESULT} } @@ -423,8 +423,10 @@ B2_SOURCES="\ debug.cpp \ debugger.cpp \ execcmd.cpp \ + execnt.cpp \ execunix.cpp \ filesys.cpp \ + filent.cpp \ fileunix.cpp \ frames.cpp \ function.cpp \ diff --git a/src/engine/execnt.cpp b/src/engine/execnt.cpp index e365d73965..5eb77ec7ac 100644 --- a/src/engine/execnt.cpp +++ b/src/engine/execnt.cpp @@ -37,8 +37,10 @@ */ #include "jam.h" -#include "output.h" + #ifdef USE_EXECNT + +#include "output.h" #include "execcmd.h" #include "lists.h" diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index 5cd5139ff1..207677998c 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -6,6 +6,9 @@ */ #include "jam.h" + +#ifdef USE_EXECUNIX + #include "execcmd.h" #include "lists.h" @@ -26,8 +29,6 @@ #include #endif -#ifdef USE_EXECUNIX - #include #if defined(__APPLE__) From e61e0587462cbbda5b2994837c6e24b9bf02c93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Thu, 21 Jan 2021 08:27:32 -0600 Subject: [PATCH 101/126] Allow verbose and debug build control from env vars. Allows presetting `B2_VERBOSE` and `B2_DEBUG` env vars to build displaying extra build info and building debug version of engine respectively. --- src/engine/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 0aba819956..6839be6fea 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -12,8 +12,8 @@ TRUE=0 B2_TOOLSET= # Internal options. -B2_VERBOSE=${FALSE} -B2_DEBUG=${FALSE} +B2_VERBOSE=${B2_VERBOSE:=${FALSE}} +B2_DEBUG=${B2_DEBUG:=${FALSE}} B2_GUESS_TOOLSET=${FALSE} # We need to calculate and set SCRIPT_PATH and SCRIPT_DIR to reference this From 5ede4e8d8d8931e52b227f1409c4581785d5e5f0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 22 Jan 2021 07:39:14 -0600 Subject: [PATCH 102/126] Rewrite intel-linux to support oneAPI release. This rewrites the inte-linux toolset to support auto detection and oneAPI version of compiler. --- src/engine/build.sh | 4 +- src/tools/intel-linux.jam | 296 +++++++++++++++++++++++--------------- 2 files changed, 184 insertions(+), 116 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 0aba819956..bf61bd2e30 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -305,8 +305,8 @@ case "${B2_TOOLSET}" in intel-*) CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXXFLAGS_RELEASE="-O3 -s" - B2_CXXFLAGS_DEBUG="-O0 -g -p" + B2_CXXFLAGS_RELEASE="-O3 -s -static" + B2_CXXFLAGS_DEBUG="-O0 -g -p -static" ;; vacpp) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index d97ee231c0..919dce39f1 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -6,16 +6,19 @@ # http://www.boost.org/LICENSE_1_0.txt) import toolset ; -import feature ; import toolset : flags ; -import intel ; -import gcc ; import common ; import errors ; +import feature ; +import gcc ; import generators ; -import type ; +import intel ; import numbers ; +import os ; +import path ; +import regex ; +import type ; feature.extend-subfeature toolset intel : platform : linux ; @@ -45,123 +48,191 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .debug-configuration = true ; } -# Initializes the intel-linux toolset -# version in mandatory -# name (default icpc) is used to invoke the specified intel-linux compiler -# compile and link options allow you to specify addition command line options for each version +.home = [ os.home-directories ] ; +.home = $(.home[1]) ; + +# Intel oneAPI 2020, and onward. +.bin(oneAPI) = + [ path.join $(.home) intel/oneapi/compiler/latest/linux/bin ] + /opt/intel/oneapi/compiler/latest/linux/bin ; +# Intel C++ Composer XE 2011 for Linux, aka Intel C++ Compiler XE 12.0, +# aka intel-linux-12.0. +.bin(12.0) = /opt/intel/bin ; +# Intel C++ Compiler 11.1. +.bin(11.1) = /opt/intel_cce_11.1.064.x86_64/bin ; +# Intel C++ Compiler 11.0. +.bin(11.0) = /opt/intel_cce_11.0.074.x86_64/bin ; +# Intel C++ Compiler 10.1. +.bin(10.1) = /opt/intel_cce_10.1.013_x64/bin ; +# Intel C++ Compiler 9.1. +.bin(9.1) = /opt/intel_cc_91/bin ; +# Intel C++ Compiler 9.0. +.bin(9.0) = /opt/intel_cc_90/bin ; +# Intel C++ Compiler 8.1. +.bin(8.1) = /opt/intel_cc_81/bin ; +# Intel C++ Compiler 8.0. +.bin(8.0) = /opt/intel_cc_80/bin ; + rule init ( version ? : command * : options * ) { - local condition = [ common.check-init-parameters intel-linux - : version $(version) ] ; - - if $(.debug-configuration) - { - ECHO "notice: intel-linux version is" $(version) ; - } - - local default_path ; - - # Intel C++ Composer XE 2011 for Linux, aka Intel C++ Compiler XE 12.0, - # aka intel-linux-12.0. In this version, Intel thankfully decides to install - # to a sane 'intel' folder in /opt. - if [ MATCH "(12[.]0|12)" : $(version) ] - { default_path = /opt/intel/bin ; } - # Intel C++ Compiler 11.1. - else if [ MATCH "(11[.]1)" : $(version) ] - { default_path = /opt/intel_cce_11.1.064.x86_64/bin ; } - # Intel C++ Compiler 11.0. - else if [ MATCH "(11[.]0|11)" : $(version) ] - { default_path = /opt/intel_cce_11.0.074.x86_64/bin ; } - # Intel C++ Compiler 10.1. - else if [ MATCH "(10[.]1)" : $(version) ] - { default_path = /opt/intel_cce_10.1.013_x64/bin ; } - # Intel C++ Compiler 9.1. - else if [ MATCH "(9[.]1)" : $(version) ] - { default_path = /opt/intel_cc_91/bin ; } - # Intel C++ Compiler 9.0. - else if [ MATCH "(9[.]0|9)" : $(version) ] - { default_path = /opt/intel_cc_90/bin ; } - # Intel C++ Compiler 8.1. - else if [ MATCH "(8[.]1)" : $(version) ] - { default_path = /opt/intel_cc_81/bin ; } - # Intel C++ Compiler 8.0 - this used to be the default, so now it's the - # fallback. - else - { default_path = /opt/intel_cc_80/bin ; } - - if $(.debug-configuration) + local user_version = [ MATCH "([0-9.]+)" : $(version) ] ; + local user_command = $(command) ; + if $(user_version) { - ECHO "notice: default search path for intel-linux is" $(default_path) ; + user_version = [ regex.split $(user_version) "[.]" ] ; } - command = [ common.get-invocation-command intel-linux : icpc - : $(command) : $(default_path) ] ; - - common.handle-options intel-linux : $(condition) : $(command) : $(options) ; - - local root = [ feature.get-values : $(options) ] ; - local bin ; - if $(command) || $(root) + local command_lib_path ; + local detected_version ; + local detected_command ; + if ! $(user_version) && ! $(user_command) { - bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; - root ?= $(bin:D) ; - - local command-string = $(command:J=" ") ; - local version-output = [ SHELL "$(command-string) --version" ] ; - local real-version = [ MATCH "([0-9.]+)" : $(version-output) ] ; - local major = [ MATCH "([0-9]+).*" : $(real-version) ] ; - - # If we failed to determine major version, use the behaviour for - # the current compiler. - if $(major) && [ numbers.less $(major) 10 ] + # If nothing given, try and discover the latest toolset available. + if ! $(detected_command) { - flags intel-linux.compile OPTIONS $(condition)/off : "-Ob0" ; - flags intel-linux.compile OPTIONS $(condition)/on : "-Ob1" ; - flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; - flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; - flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + local bin_paths = $(.bin(oneAPI)) ; + detected_command = [ common.find-tool icpx : $(bin_paths) : path-last ] ; + command_lib_path = $(detected_command:D)/../compiler/lib/intel64 ; } - else if $(major) && [ numbers.less $(major) 11 ] + if ! $(detected_command) { - flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; - flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; - flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; - flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; - flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + local bin_paths = $(.bin(12.0)) $(.bin(11.1)) $(.bin(11.0)) ; + detected_command = [ common.find-tool icpc : $(bin_paths) : path-last ] ; + command_lib_path = $(detected_command:D)/../lib/x86_64 ; } - else # newer version of intel do have -Os (at least 11+, don't know about 10) + if ! $(detected_command) { - flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; - flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; - flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; - flags intel-linux.compile OPTIONS $(condition)/space : "-Os" ; - flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + local bin_paths = $(.bin(10.1)) $(.bin(9.1)) $(.bin(9.0)) + $(.bin(8.1)) $(.bin(8.0)) ; + detected_command = [ common.find-tool icpc : $(bin_paths) : path-last ] ; + command_lib_path = $(detected_command:D)/../lib ; } - - if $(root) + if $(detected_command) + { + local version_cmd = "LD_LIBRARY_PATH=$(command_lib_path) $(detected_command) --version" ; + local version_output = [ SHELL $(version_cmd) ] ; + detected_version = [ MATCH "([0-9.]+)" : $(version_output) ] ; + } + } + else if $(user_command) + { + # If only a command given, determine the version from the command. + # Note, we assume that the user command does everything needed to + # property execute the command. + local version_cmd = $(user_command:J=" ") ; + local version_output = [ SHELL "$(version_cmd) --version" ] ; + detected_command = $(user_command) ; + detected_version = [ MATCH "([0-9.]+)" : $(version_output) ] ; + } + else if $(user_version) + { + # Only version given, try and find the command in the location for the version. + if [ numbers.less $(user_version[1]) 2020 ] { - # 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) + local version_xy = $(user_version[1]) $(user_version[2]) ; + local bin_paths = $(.bin($(version_xy:J=.))) ; + if $(bin_paths) + { + detected_command = [ common.find-tool icpc : $(bin_paths) : path-last ] ; + } + if [ numbers.less $(user_version[1]) 11 ] { - ECHO notice\: using intel libraries "::" $(condition) "::" $(lib_path) ; + command_lib_path = $(detected_command:D)/../lib ; } - flags intel-linux.link RUN_PATH $(condition) : $(lib_path) ; + else + { + command_lib_path = $(detected_command:D)/../lib/x86_64 ; + } + } + else + { + detected_command = [ common.find-tool icpx + : [ regex.replace-list $(.bin(oneAPI)) : "latest" : $(user_version:J=.) ] + : path-last ] ; + command_lib_path = $(detected_command:D)/../compiler/lib/intel64 ; + } + if $(detected_command) + { + local version_cmd = "LD_LIBRARY_PATH=$(command_lib_path) $(detected_command) --version" ; + local version_output = [ SHELL $(version_cmd) ] ; + detected_version = [ MATCH "([0-9.]+)" : $(version_output) ] ; } } -} -SPACE = " " ; + if $(.debug-configuration) + { + ECHO "notice: intel-linux command is" $(command:E=$(detected_command)) ; + } + + version ?= $(detected_version) ; + local condition = [ common.check-init-parameters intel-linux : version $(version) ] ; + + if $(.debug-configuration) + { + ECHO "notice: intel-linux version is" $(version) ; + } + + command ?= $(detected_command) ; + common.handle-options intel-linux : $(condition) : $(command) : $(options) ; + + local tool_version = $(detected_version) ; + if $(tool_version) + { + tool_version = [ regex.split $(tool_version) "[.]" ] ; + } + tool_version ?= $(user_version) ; + + if [ numbers.less $(tool_version[1]) 10 ] + { + flags intel-linux.compile OPTIONS $(condition)/off : "-Ob0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-Ob1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; + flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + } + else if [ numbers.less $(tool_version[1]) 11 ] + { + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + } + else # newer version of intel do have -Os (at least 11+, don't know about 10) + { + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + flags intel-linux.compile OPTIONS $(condition)/space : "-Os" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + } + if [ numbers.less $(tool_version[1]) 2020 ] + { + flags intel-linux.compile OPTIONS off : -w0 ; + flags intel-linux.compile OPTIONS on : -w1 ; + flags intel-linux.compile OPTIONS all : -w2 ; + flags intel-linux.compile OPTIONS extra : -w3 ; + flags intel-linux.compile OPTIONS pedantic : -w3 -Wcheck ; + flags intel-linux.compile OPTIONS on : -Werror-all ; + } + else + { + flags intel-linux.compile OPTIONS off : -w ; + flags intel-linux.compile OPTIONS on : -Wall ; + flags intel-linux.compile OPTIONS all : -Wall ; + flags intel-linux.compile OPTIONS extra : -Wall ; + flags intel-linux.compile OPTIONS pedantic : -Wall ; + flags intel-linux.compile OPTIONS on : -Werror-all ; + } + if $(.debug-configuration) + { + ECHO notice\: using intel libraries "::" $(condition) "::" $(command_lib_path) ; + } + flags intel-linux.compile RUN_PATH $(condition) : $(command_lib_path) ; + flags intel-linux.link RUN_PATH $(condition) : $(command_lib_path) ; +} -flags intel-linux.compile OPTIONS off : -w0 ; -flags intel-linux.compile OPTIONS on : -w1 ; -flags intel-linux.compile OPTIONS all : -w2 ; -flags intel-linux.compile OPTIONS extra : -w3 ; -flags intel-linux.compile OPTIONS pedantic : -w3 -Wcheck ; -flags intel-linux.compile OPTIONS on : -Werror-all ; +_ = " " ; rule compile.c++ ( targets * : sources * : properties * ) { @@ -170,7 +241,7 @@ rule compile.c++ ( targets * : sources * : properties * ) actions compile.c++ bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" + LD_LIBRARY_PATH="$(RUN_PATH)" "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" } rule compile.c ( targets * : sources * : properties * ) @@ -180,7 +251,7 @@ rule compile.c ( targets * : sources * : properties * ) actions compile.c bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" + LD_LIBRARY_PATH="$(RUN_PATH)" "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" } rule compile.c++.pch ( targets * : sources * : properties * ) @@ -193,12 +264,12 @@ rule compile.c++.pch ( targets * : sources * : properties * ) # actions compile.c++.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" + rm -f "$(<)" && LD_LIBRARY_PATH="$(RUN_PATH)" "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" } actions compile.fortran { - "ifort" -c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + LD_LIBRARY_PATH="$(RUN_PATH)" "ifort" -c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } rule compile.c.pch ( targets * : sources * : properties * ) @@ -207,29 +278,26 @@ rule compile.c.pch ( targets * : sources * : properties * ) actions compile.c.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" + rm -f "$(<)" && LD_LIBRARY_PATH="$(RUN_PATH)" "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" } rule link ( targets * : sources * : properties * ) { - SPACE on $(targets) = " " ; + _ on $(targets) = " " ; } actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) + LD_LIBRARY_PATH="$(RUN_PATH)" "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(_)-Wl,"$(RPATH)" -Wl,-rpath-link$(_)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) } rule link.dll ( targets * : sources * : properties * ) { - SPACE on $(targets) = " " ; + _ on $(targets) = " " ; } # Differ from 'link' above only by -shared. actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) + LD_LIBRARY_PATH="$(RUN_PATH)" "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(_)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(_)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) } - - - From a79d60c9136a74321814aa0800da777d849517ee Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 22 Jan 2021 22:29:20 -0600 Subject: [PATCH 103/126] Test build variations. Adding tests for building b2 engine in different ways. Initially test that the default basic build works in a mostly clean environment. --- azure-pipelines.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 17f278569c..76cc2686f1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,6 +27,23 @@ stages: - stage: Test jobs: + - job: 'Linux Default Build' + strategy: + matrix: + Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} + pool: + vmImage: $(VM_IMAGE) + steps: + - bash: | + set -e + uname -a + ./.ci/linux-cxx-install.sh + displayName: Install + - bash: | + set -e + ./src/engine/build.sh + displayName: Default Build + - job: 'Linux' strategy: matrix: From 97847c71cd1f09f93cd6b2158d8ccb7c468c71f6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 22 Jan 2021 22:34:45 -0600 Subject: [PATCH 104/126] Fix test job name. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 76cc2686f1..d8aea03880 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,7 +27,7 @@ stages: - stage: Test jobs: - - job: 'Linux Default Build' + - job: 'Linux_Default_Build' strategy: matrix: Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} From 2e66a93bc5fa0664d0c2bcb10fa0d1b90b4421dd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 22 Jan 2021 22:39:29 -0600 Subject: [PATCH 105/126] Add clang only default build check. --- azure-pipelines.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d8aea03880..52cb5bfeaf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,8 +41,26 @@ stages: displayName: Install - bash: | set -e - ./src/engine/build.sh - displayName: Default Build + ./src/engine/build.sh --verbose + displayName: Build + + - job: 'Linux_Clang_Only_Build' + strategy: + matrix: + Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} + pool: + vmImage: $(VM_IMAGE) + steps: + - bash: | + set -e + uname -a + ./.ci/linux-cxx-install.sh + sudo apt remove gcc g++ + displayName: Install + - bash: | + set -e + ./src/engine/build.sh --verbose + displayName: Build - job: 'Linux' strategy: From 54847f1c249a6e88015c969b882f9cc453473fe0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 22 Jan 2021 22:46:49 -0600 Subject: [PATCH 106/126] Move build tests to pre-stage for faster turn around. --- azure-pipelines.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 52cb5bfeaf..0be148096c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,7 +24,7 @@ pr: stages: -- stage: Test +- stage: Base jobs: - job: 'Linux_Default_Build' @@ -62,6 +62,9 @@ stages: ./src/engine/build.sh --verbose displayName: Build +- stage: Test + jobs: + - job: 'Linux' strategy: matrix: From 3468fa7b635d549b0518bdf62f9e2ee023d71b44 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 22 Jan 2021 22:51:05 -0600 Subject: [PATCH 107/126] Fix POSIX sh inheriting early exit causing failed compiler detection. --- src/engine/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/build.sh b/src/engine/build.sh index e6fb0cf763..08d86ffd9b 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -5,6 +5,10 @@ #~ (See accompanying file LICENSE_1_0.txt or copy at #~ http://www.boost.org/LICENSE_1_0.txt) +# POSIX shells will inherit the error exit flag. Particularly the Bash POSIX mode. +# Hence we force it off explicitly so that we can query command results. +set +e + FALSE=1 TRUE=0 From 895c49ccc45334f0cd5bc43ff5b03daf084880ca Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 23 Jan 2021 10:56:53 -0600 Subject: [PATCH 108/126] Fix a bunch of problems with resetting various vars. There was a systemic error of using ":=" instead of ":-" var expansion that caused all kinds of problems. Replacing all the instances to be correct fixed them. But also brought to light other problems. The changes include fixing the intel detection to no leak and persist it's setup. And to also support setup script generally if required. Fixes #705 --- src/engine/build.sh | 220 ++++++++++++++++++++++++-------------------- 1 file changed, 121 insertions(+), 99 deletions(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 08d86ffd9b..4c4d0ec31f 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -5,15 +5,12 @@ #~ (See accompanying file LICENSE_1_0.txt or copy at #~ http://www.boost.org/LICENSE_1_0.txt) -# POSIX shells will inherit the error exit flag. Particularly the Bash POSIX mode. -# Hence we force it off explicitly so that we can query command results. -set +e - FALSE=1 TRUE=0 # Reset the toolset. B2_TOOLSET= +B2_SETUP= # Internal options. B2_VERBOSE=${B2_VERBOSE:=${FALSE}} @@ -104,18 +101,21 @@ test_uname () test_compiler () { - local EXE="${CXX:=$1}" - local COMAND + local EXE="${CXX:-$1}" + local CMD + local SETUP shift - COMAND="${EXE} $@ ${CXXFLAGS:=}" + CMD="${EXE} $@ ${CXXFLAGS:-}" + SETUP=${B2_SETUP:-true} if test_true ${B2_VERBOSE} ; then - echo_run ${COMAND} check_cxx11.cpp + echo "> ${CMD} check_cxx11.cpp" + ( ${SETUP} ; ${CMD} check_cxx11.cpp ) else - ${COMAND} check_cxx11.cpp 1>/dev/null 2>/dev/null + ( ${SETUP} ; ${CMD} check_cxx11.cpp ) 1>/dev/null 2>/dev/null fi local CHECK_RESULT=$? if test_true ${CHECK_RESULT} ; then - B2_CXX=${COMAND} + B2_CXX=${CMD} fi rm -rf check_cxx11.o* a.out a.exe 1>/dev/null 2>/dev/null return ${CHECK_RESULT} @@ -149,14 +149,16 @@ check_toolset () if test_toolset clang && test_compiler clang++ -x c++ -std=c++11 ; then B2_TOOLSET=clang ; return ${TRUE} ; fi # Intel macOS (intel-darwin) if test_toolset intel-darwin && test -r "${HOME}/intel/oneapi/setvars.sh" && test_uname Darwin ; then - . "${HOME}/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source ${HOME}/intel/oneapi/setvars.sh" if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi + B2_SETUP= fi if test_toolset intel-darwin && test -r "/opt/intel/oneapi/setvars.sh" && test_uname Darwin ; then - . "/opt/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source /opt/intel/oneapi/setvars.sh" if test_toolset intel-darwin && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi if test_toolset intel-darwin && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-darwin ; return ${TRUE} ; fi + B2_SETUP= fi # Intel oneAPI (intel-linux) if test_toolset intel-linux && test_path icpx ; then @@ -166,30 +168,35 @@ check_toolset () if test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "${HOME}/intel/oneapi/setvars.sh" ; then - . "${HOME}/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source ${HOME}/intel/oneapi/setvars.sh" if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + B2_SETUP= fi if test_toolset intel-linux && test -r "/opt/intel/oneapi/setvars.sh" ; then - . "/opt/intel/oneapi/setvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source /opt/intel/oneapi/setvars.sh" if test_toolset intel-linux && test_compiler icpx -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi if test_toolset intel-linux && test_compiler icc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + B2_SETUP= fi # Intel Pro (intel-linux) if test_toolset intel-linux && test_path icpc ; then if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi fi if test_toolset intel-linux && test -r "/opt/intel/inteloneapi/setvars.sh" ; then - . "/opt/intel/inteloneapi/setvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source /opt/intel/inteloneapi/setvars.sh" if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + B2_SETUP= fi if test_toolset intel-linux && test -r "/opt/intel/cc/9.0/bin/iccvars.sh" ; then - . "/opt/intel/cc/9.0/bin/iccvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source /opt/intel/cc/9.0/bin/iccvars.sh" if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + B2_SETUP= fi if test_toolset intel-linux && test -r "/opt/intel_cc_80/bin/iccvars.sh" ; then - . "/opt/intel_cc_80/bin/iccvars.sh" 1>/dev/null 2>/dev/null + B2_SETUP="source /opt/intel_cc_80/bin/iccvars.sh" if test_compiler icpc -x c++ -std=c++11 ; then B2_TOOLSET=intel-linux ; return ${TRUE} ; fi + B2_SETUP= fi # Mips Pro (mipspro) if test_toolset mipspro && test_uname IRIX && test_compiler CC -FE:template_in_elf_section -ptused ; then B2_TOOLSET=mipspro ; return ${TRUE} ; fi @@ -230,9 +237,9 @@ check_toolset () if test_toolset cxx && test_compiler cpp ; then B2_TOOLSET=cxx ; return ${TRUE} ; fi if test_toolset cxx && test_compiler CC ; then B2_TOOLSET=cxx ; return ${TRUE} ; fi # Generic cross compile (cross-cxx) - if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cxx} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi - if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=cpp} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi - if test_toolset cross-cxx && test_compiler ${BUILD_CXX:=CC} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:-cxx} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:-cpp} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi + if test_toolset cross-cxx && test_compiler ${BUILD_CXX:-CC} ; then B2_TOOLSET=cross-cxx ; return ${TRUE} ; fi # Nothing found. if test "${B2_TOOLSET}" = "" ; then @@ -289,7 +296,7 @@ fi case "${B2_TOOLSET}" in gcc) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} # Check for machine specific options. machine=$(${B2_CXX} -dumpmachine 2>/dev/null) if test $? -ne 0 ; then @@ -308,96 +315,96 @@ case "${B2_TOOLSET}" in ;; intel-*) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O3 -s -static" B2_CXXFLAGS_DEBUG="-O0 -g -p -static" ;; vacpp) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=-qversion} + CXX_VERSION_OPT=${CXX_VERSION_OPT:--qversion} B2_CXXFLAGS_RELEASE="-O3 -s -qstrict -qinline" B2_CXXFLAGS_DEBUG="-g -qNOOPTimize -qnoinline -pg" ;; xlcpp) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=-qversion} + CXX_VERSION_OPT=${CXX_VERSION_OPT:--qversion} B2_CXXFLAGS_RELEASE="-s -O3 -qstrict -qinline" B2_CXXFLAGS_DEBUG="-g -qNOOPTimize -qnoinline -pg" ;; como) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O3 --inlining" B2_CXXFLAGS_DEBUG="-O0 -g --no_inlining --long_long" ;; kcc) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="+K2 -s" B2_CXXFLAGS_DEBUG="+K0 -g" ;; kylix) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O2 -vi -w-inl -s" B2_CXXFLAGS_DEBUG="-Od -v -vi-" ;; mipspro) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-Ofast -g0 \"-INLINE:none\" -s" B2_CXXFLAGS_DEBUG="-O0 -INLINE -g" ;; pathscale) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O3 -inline -s" B2_CXXFLAGS_DEBUG="-O0 -noinline -ggdb" ;; pgi) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-fast -s" B2_CXXFLAGS_DEBUG="-O0 -gopt" ;; sun*) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=-V} + CXX_VERSION_OPT=${CXX_VERSION_OPT:--V} B2_CXXFLAGS_RELEASE="-xO4 -s" B2_CXXFLAGS_DEBUG="-g" ;; clang*) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O3 -s" B2_CXXFLAGS_DEBUG="-O0 -fno-inline -g" ;; tru64cxx) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O5 -inline speed -s" B2_CXXFLAGS_DEBUG="-O0 -pg -g" ;; acc) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O3 -s" B2_CXXFLAGS_DEBUG="+d -g" ;; qcc) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} B2_CXXFLAGS_RELEASE="-O3 -Wc,-finline-functions" B2_CXXFLAGS_DEBUG="O0 -Wc,-fno-inline -gstabs+" ;; cxx) - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} ;; cross-cxx) CXXFLAGS=${BUILD_CXXFLAGS} - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} ;; *) @@ -405,76 +412,91 @@ case "${B2_TOOLSET}" in ;; esac -echo " +build_b2 () +{ + echo " ### ### ### Using '${B2_TOOLSET}' toolset. ### ### " -echo_run ${CXX} ${CXX_VERSION_OPT} + echo_run ${B2_CXX} ${CXX_VERSION_OPT} echo " ### ### " -B2_SOURCES="\ - builtins.cpp \ - class.cpp \ - command.cpp \ - compile.cpp \ - constants.cpp \ - cwd.cpp \ - debug.cpp \ - debugger.cpp \ - execcmd.cpp \ - execnt.cpp \ - execunix.cpp \ - filesys.cpp \ - filent.cpp \ - fileunix.cpp \ - frames.cpp \ - function.cpp \ - glob.cpp\ - hash.cpp \ - hcache.cpp \ - hdrmacro.cpp \ - headers.cpp \ - jam_strings.cpp \ - jam.cpp \ - jamgram.cpp \ - lists.cpp \ - make.cpp \ - make1.cpp \ - md5.cpp \ - mem.cpp \ - modules.cpp \ - native.cpp \ - object.cpp \ - option.cpp \ - output.cpp \ - parse.cpp \ - pathsys.cpp \ - pathunix.cpp \ - regexp.cpp \ - rules.cpp \ - scan.cpp \ - search.cpp \ - startup.cpp \ - subst.cpp \ - sysinfo.cpp \ - timestamp.cpp \ - variable.cpp \ - w32_getreg.cpp \ - modules/order.cpp \ - modules/path.cpp \ - modules/property-set.cpp \ - modules/regex.cpp \ - modules/sequence.cpp \ - modules/set.cpp \ - " - -if test_true ${B2_DEBUG} ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}" -else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG" + B2_SOURCES="\ +builtins.cpp \ +class.cpp \ +command.cpp \ +compile.cpp \ +constants.cpp \ +cwd.cpp \ +debug.cpp \ +debugger.cpp \ +execcmd.cpp \ +execnt.cpp \ +execunix.cpp \ +filesys.cpp \ +filent.cpp \ +fileunix.cpp \ +frames.cpp \ +function.cpp \ +glob.cpp \ +hash.cpp \ +hcache.cpp \ +hdrmacro.cpp \ +headers.cpp \ +jam_strings.cpp \ +jam.cpp \ +jamgram.cpp \ +lists.cpp \ +make.cpp \ +make1.cpp \ +md5.cpp \ +mem.cpp \ +modules.cpp \ +native.cpp \ +object.cpp \ +option.cpp \ +output.cpp \ +parse.cpp \ +pathsys.cpp \ +pathunix.cpp \ +regexp.cpp \ +rules.cpp \ +scan.cpp \ +search.cpp \ +startup.cpp \ +subst.cpp \ +sysinfo.cpp \ +timestamp.cpp \ +variable.cpp \ +w32_getreg.cpp \ +modules/order.cpp \ +modules/path.cpp \ +modules/property-set.cpp \ +modules/regex.cpp \ +modules/sequence.cpp \ +modules/set.cpp \ +" + + if test_true ${B2_DEBUG} ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}" + else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG" + fi + ( B2_VERBOSE=${TRUE} echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 ) + ( B2_VERBOSE=${TRUE} echo_run cp b2 bjam ) +} + +if test_true ${B2_VERBOSE} ; then + ( + ${B2_SETUP} + build_b2 + ) +else + ( + ${B2_SETUP} 1>/dev/null 2>/dev/null + build_b2 + ) fi -B2_VERBOSE=${TRUE} echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 -B2_VERBOSE=${TRUE} echo_run cp b2 bjam From 3382716793f99f0147c78edd73eff702d77d3938 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 23 Jan 2021 12:08:23 -0600 Subject: [PATCH 109/126] Rework AZP stages for quicker fails. --- azure-pipelines.yml | 270 +++++++++++++++++++++++++------------------- 1 file changed, 151 insertions(+), 119 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0be148096c..37ffdb64bb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,7 +24,7 @@ pr: stages: -- stage: Base +- stage: Core jobs: - job: 'Linux_Default_Build' @@ -33,7 +33,7 @@ stages: Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} pool: vmImage: $(VM_IMAGE) - steps: + steps: &linux_default_build_steps - bash: | set -e uname -a @@ -50,7 +50,7 @@ stages: Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} pool: vmImage: $(VM_IMAGE) - steps: + steps: &linux_clang_only_build_steps - bash: | set -e uname -a @@ -62,36 +62,13 @@ stages: ./src/engine/build.sh --verbose displayName: Build -- stage: Test - jobs: - - - job: 'Linux' + - job: 'Linux_Latest' strategy: matrix: GCC 10: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10, VM_IMAGE: 'ubuntu-18.04'} - GCC 9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-9, PACKAGES: g++-9, VM_IMAGE: 'ubuntu-18.04'} - GCC 8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-8, PACKAGES: g++-8, VM_IMAGE: 'ubuntu-18.04'} - GCC 7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-7, PACKAGES: g++-7, VM_IMAGE: 'ubuntu-18.04'} - GCC 6: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-6, PACKAGES: g++-6, VM_IMAGE: 'ubuntu-18.04'} - GCC 5: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-5, PACKAGES: g++-5, VM_IMAGE: 'ubuntu-18.04'} - GCC 4.9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.9, PACKAGES: g++-4.9, VM_IMAGE: 'ubuntu-16.04'} - GCC 4.8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.8, PACKAGES: g++-4.8, VM_IMAGE: 'ubuntu-16.04'} - GCC 4.7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.7, PACKAGES: g++-4.7, VM_IMAGE: 'ubuntu-16.04'} - Clang 10: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} - Clang 9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-9, PACKAGES: clang-9, LLVM_OS: bionic, LLVM_VER: 9, VM_IMAGE: 'ubuntu-18.04'} - Clang 8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-8, PACKAGES: clang-8, LLVM_OS: bionic, LLVM_VER: 8, VM_IMAGE: 'ubuntu-18.04'} - Clang 7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-7, PACKAGES: clang-7, LLVM_OS: bionic, LLVM_VER: 7, VM_IMAGE: 'ubuntu-18.04'} - Clang 6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-6.0, PACKAGES: clang-6.0, LLVM_OS: bionic, LLVM_VER: 6.0, VM_IMAGE: 'ubuntu-18.04'} - Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_OS: bionic, LLVM_VER: 5.0, VM_IMAGE: 'ubuntu-18.04'} - Clang 4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-4.0, PACKAGES: clang-4.0, LLVM_OS: xenial, LLVM_VER: 4.0, VM_IMAGE: 'ubuntu-16.04'} - Clang 3.9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.9, PACKAGES: clang-3.9, VM_IMAGE: 'ubuntu-16.04'} - Clang 3.8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.8, PACKAGES: clang-3.8, VM_IMAGE: 'ubuntu-16.04'} - Clang 3.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.7, PACKAGES: clang-3.7, VM_IMAGE: 'ubuntu-16.04'} - Clang 3.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.6, PACKAGES: clang-3.6, VM_IMAGE: 'ubuntu-16.04'} - Clang 3.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.5, PACKAGES: clang-3.5, VM_IMAGE: 'ubuntu-16.04'} pool: vmImage: $(VM_IMAGE) - steps: + steps: &linux_test_steps - bash: | set -e uname -a @@ -133,15 +110,13 @@ stages: b2 -n --debug-configuration displayName: Bootstrap - - job: 'Windows' + - job: 'Windows_Latest' strategy: matrix: VS 2019: {TOOLSET: vc142, TEST_TOOLSET: msvc, VM_IMAGE: 'windows-2019'} - VS 2017: {TOOLSET: vc141, TEST_TOOLSET: msvc, VM_IMAGE: 'vs2017-win2016'} - MinGW 8.1.0: {TOOLSET: mingw, TEST_TOOLSET: gcc, VM_IMAGE: 'vs2017-win2016'} pool: vmImage: $(VM_IMAGE) - steps: + steps: &windows_test_steps - powershell: | cd src/engine $env:path += ';' + $env:CXX_PATH @@ -179,20 +154,10 @@ stages: - job: 'macOS' strategy: matrix: - Xcode 11.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.6.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.5.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.4.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.3.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'} - Xcode 10.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.1.app, VM_IMAGE: 'macOS-10.14'} - Xcode 10.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.app, VM_IMAGE: 'macOS-10.14'} - Xcode 10.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.1.app, VM_IMAGE: 'macOS-10.14'} - Xcode 10.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.app, VM_IMAGE: 'macOS-10.14'} + Xcode 12.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.3.app, VM_IMAGE: 'macOS-10.15'} pool: vmImage: $(VM_IMAGE) - steps: + steps: &macos_test_steps - bash: | set -e uname -a @@ -234,25 +199,81 @@ stages: b2 -n --debug-configuration displayName: Bootstrap -- stage: Boost +- stage: Compilers + dependsOn: [Core] jobs: - - job: 'Release_Linux' - displayName: 'Release Linux' + - job: 'Linux' + strategy: + matrix: + GCC 9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-9, PACKAGES: g++-9, VM_IMAGE: 'ubuntu-18.04'} + GCC 8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-8, PACKAGES: g++-8, VM_IMAGE: 'ubuntu-18.04'} + GCC 7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-7, PACKAGES: g++-7, VM_IMAGE: 'ubuntu-18.04'} + GCC 6: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-6, PACKAGES: g++-6, VM_IMAGE: 'ubuntu-18.04'} + GCC 5: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-5, PACKAGES: g++-5, VM_IMAGE: 'ubuntu-18.04'} + GCC 4.9: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.9, PACKAGES: g++-4.9, VM_IMAGE: 'ubuntu-16.04'} + GCC 4.8: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.8, PACKAGES: g++-4.8, VM_IMAGE: 'ubuntu-16.04'} + GCC 4.7: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-4.7, PACKAGES: g++-4.7, VM_IMAGE: 'ubuntu-16.04'} + Clang 10: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} + Clang 9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-9, PACKAGES: clang-9, LLVM_OS: bionic, LLVM_VER: 9, VM_IMAGE: 'ubuntu-18.04'} + Clang 8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-8, PACKAGES: clang-8, LLVM_OS: bionic, LLVM_VER: 8, VM_IMAGE: 'ubuntu-18.04'} + Clang 7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-7, PACKAGES: clang-7, LLVM_OS: bionic, LLVM_VER: 7, VM_IMAGE: 'ubuntu-18.04'} + Clang 6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-6.0, PACKAGES: clang-6.0, LLVM_OS: bionic, LLVM_VER: 6.0, VM_IMAGE: 'ubuntu-18.04'} + Clang 5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-5.0, PACKAGES: clang-5.0, LLVM_OS: bionic, LLVM_VER: 5.0, VM_IMAGE: 'ubuntu-18.04'} + Clang 4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-4.0, PACKAGES: clang-4.0, LLVM_OS: xenial, LLVM_VER: 4.0, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.9: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.9, PACKAGES: clang-3.9, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.8: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.8, PACKAGES: clang-3.8, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.7, PACKAGES: clang-3.7, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.6, PACKAGES: clang-3.6, VM_IMAGE: 'ubuntu-16.04'} + Clang 3.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.5, PACKAGES: clang-3.5, VM_IMAGE: 'ubuntu-16.04'} + pool: + vmImage: $(VM_IMAGE) + steps: *linux_test_steps + + - job: 'Windows' + strategy: + matrix: + VS 2017: {TOOLSET: vc141, TEST_TOOLSET: msvc, VM_IMAGE: 'vs2017-win2016'} + MinGW 8.1.0: {TOOLSET: mingw, TEST_TOOLSET: gcc, VM_IMAGE: 'vs2017-win2016'} + pool: + vmImage: $(VM_IMAGE) + steps: *windows_test_steps + + - job: 'macOS' + strategy: + matrix: + Xcode 12.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.2.app, VM_IMAGE: 'macOS-10.15'} + Xcode 12.1.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.1.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 12.0.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.0.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.6.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.5.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.4.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.3.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 10.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.1.app, VM_IMAGE: 'macOS-10.14'} + Xcode 10.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.app, VM_IMAGE: 'macOS-10.14'} + Xcode 10.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.1.app, VM_IMAGE: 'macOS-10.14'} + Xcode 10.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.app, VM_IMAGE: 'macOS-10.14'} + pool: + vmImage: $(VM_IMAGE) + steps: *macos_test_steps + +- stage: Boost_Dev + dependsOn: [Core] + jobs: + + - job: 'Dev_Linux' + displayName: 'Dev Linux' pool: vmImage: 'ubuntu-latest' strategy: matrix: - 1.75.0 .. GCC 10: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.74.0 .. GCC 10: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.73.0 .. GCC 10: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.72.0 .. GCC 10: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.71.0 .. GCC 10: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.70.0 .. GCC 10: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.69.0 .. GCC 10: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.68.0 .. GCC 10: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.67.0 .. GCC 10: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - 1.66.0 .. GCC 10: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + Master .. GCC 10: {BOOST_BRANCH: master, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + Master .. Clang 10: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10} + Develop .. GCC 10: {BOOST_BRANCH: develop, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + Develop .. Clang 10: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10} steps: - bash: | set -e @@ -268,29 +289,29 @@ stages: - bash: | set -e pushd ${HOME} - git clone -b boost-${BOOST_VERSION} --single-branch --recurse-submodules https://github.com/boostorg/boost.git boost_${BOOST_VERSION_U} - cd boost_${BOOST_VERSION_U} + git clone --recursive https://github.com/boostorg/boost.git + cd boost + git checkout ${BOOST_BRANCH} CXX_PATH=`which ${CXX}` echo "using ${TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam "${BUILD_SOURCESDIRECTORY}/src/engine/b2" "--boost-build=${BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=${TOOLSET} install popd displayName: Test - - job: 'Dev_Linux' - displayName: 'Dev Linux' + - job: 'Dev_macOS' + displayName: 'Dev macOS' pool: - vmImage: 'ubuntu-latest' + vmImage: 'macOS-latest' strategy: matrix: - Master .. GCC 10: {BOOST_BRANCH: master, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - Master .. Clang 10: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10} - Develop .. GCC 10: {BOOST_BRANCH: develop, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} - Develop .. Clang 10: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10} + Master .. Xcode 11.7: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + Develop .. Xcode 11.7: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} steps: - bash: | set -e uname -a - ./.ci/linux-cxx-install.sh + sudo xcode-select -switch ${XCODE_APP} + which clang++ displayName: Install - bash: | set -e @@ -310,28 +331,60 @@ stages: popd displayName: Test - - job: 'Release_macOS' - displayName: 'Release macOS' + - job: 'Dev_Windows' + displayName: 'Dev Windows' pool: - vmImage: 'macOS-latest' + vmImage: 'windows-latest' strategy: matrix: - 1.75.0 .. Xcode 11.7: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.74.0 .. Xcode 11.7: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.73.0 .. Xcode 11.7: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.72.0 .. Xcode 11.7: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.71.0 .. Xcode 11.7: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.70.0 .. Xcode 11.7: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.69.0 .. Xcode 11.7: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.68.0 .. Xcode 11.7: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.67.0 .. Xcode 11.7: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - 1.66.0 .. Xcode 11.7: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + Master .. VS 2019: {BOOST_BRANCH: master, TOOLSET: vc142} + Develop .. VS 2019: {BOOST_BRANCH: develop, TOOLSET: vc142} + steps: + - powershell: | + cd src/engine + $env:path += ';' + ${env:CXX_PATH} + cmd /c build.bat ${env:TOOLSET} + ./b2.exe -v + cd ../.. + displayName: Build + - powershell: | + $env:HOME = "$env:HOMEDRIVE" + "$env:HOMEPATH" + cd "${env:HOME}" + git clone --recursive https://github.com/boostorg/boost.git + cd boost + $OriginalErrorActionPreference = $ErrorActionPreference + $ErrorActionPreference= 'silentlycontinue' + git checkout "${env:BOOST_BRANCH}" + $ErrorActionPreference = $OriginalErrorActionPreference + echo "using" "msvc" ";" > "${env:HOME}/user-config.jam" + & "${env:BUILD_SOURCESDIRECTORY}\src\engine\b2.exe" "--boost-build=${env:BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=msvc install + displayName: Test + +- stage: Boost_Release + dependsOn: [Boost_Dev] + jobs: + + - job: 'Release_Linux' + displayName: 'Release Linux' + pool: + vmImage: 'ubuntu-latest' + strategy: + matrix: + 1.75.0 .. GCC 10: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.74.0 .. GCC 10: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.73.0 .. GCC 10: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.72.0 .. GCC 10: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.71.0 .. GCC 10: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.70.0 .. GCC 10: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.69.0 .. GCC 10: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.68.0 .. GCC 10: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.67.0 .. GCC 10: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} + 1.66.0 .. GCC 10: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10} steps: - bash: | set -e uname -a - sudo xcode-select -switch ${XCODE_APP} - which clang++ + ./.ci/linux-cxx-install.sh displayName: Install - bash: | set -e @@ -350,14 +403,22 @@ stages: popd displayName: Test - - job: 'Dev_macOS' - displayName: 'Dev macOS' + - job: 'Release_macOS' + displayName: 'Release macOS' pool: vmImage: 'macOS-latest' strategy: matrix: - Master .. Xcode 11.7: {BOOST_BRANCH: master, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} - Develop .. Xcode 11.7: {BOOST_BRANCH: develop, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.75.0 .. Xcode 11.7: {BOOST_VERSION: 1.75.0, BOOST_VERSION_U: 1_75_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.74.0 .. Xcode 11.7: {BOOST_VERSION: 1.74.0, BOOST_VERSION_U: 1_74_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.73.0 .. Xcode 11.7: {BOOST_VERSION: 1.73.0, BOOST_VERSION_U: 1_73_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.72.0 .. Xcode 11.7: {BOOST_VERSION: 1.72.0, BOOST_VERSION_U: 1_72_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.71.0 .. Xcode 11.7: {BOOST_VERSION: 1.71.0, BOOST_VERSION_U: 1_71_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.70.0 .. Xcode 11.7: {BOOST_VERSION: 1.70.0, BOOST_VERSION_U: 1_70_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.69.0 .. Xcode 11.7: {BOOST_VERSION: 1.69.0, BOOST_VERSION_U: 1_69_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.68.0 .. Xcode 11.7: {BOOST_VERSION: 1.68.0, BOOST_VERSION_U: 1_68_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.67.0 .. Xcode 11.7: {BOOST_VERSION: 1.67.0, BOOST_VERSION_U: 1_67_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} + 1.66.0 .. Xcode 11.7: {BOOST_VERSION: 1.66.0, BOOST_VERSION_U: 1_66_0, TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app} steps: - bash: | set -e @@ -374,9 +435,8 @@ stages: - bash: | set -e pushd ${HOME} - git clone --recursive https://github.com/boostorg/boost.git - cd boost - git checkout ${BOOST_BRANCH} + git clone -b boost-${BOOST_VERSION} --single-branch --recurse-submodules https://github.com/boostorg/boost.git boost_${BOOST_VERSION_U} + cd boost_${BOOST_VERSION_U} CXX_PATH=`which ${CXX}` echo "using ${TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam "${BUILD_SOURCESDIRECTORY}/src/engine/b2" "--boost-build=${BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=${TOOLSET} install @@ -416,36 +476,8 @@ stages: & "${env:BUILD_SOURCESDIRECTORY}\src\engine\b2.exe" "--boost-build=${env:BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=msvc install displayName: Test - - job: 'Dev_Windows' - displayName: 'Dev Windows' - pool: - vmImage: 'windows-latest' - strategy: - matrix: - Master .. VS 2019: {BOOST_BRANCH: master, TOOLSET: vc142} - Develop .. VS 2019: {BOOST_BRANCH: develop, TOOLSET: vc142} - steps: - - powershell: | - cd src/engine - $env:path += ';' + ${env:CXX_PATH} - cmd /c build.bat ${env:TOOLSET} - ./b2.exe -v - cd ../.. - displayName: Build - - powershell: | - $env:HOME = "$env:HOMEDRIVE" + "$env:HOMEPATH" - cd "${env:HOME}" - git clone --recursive https://github.com/boostorg/boost.git - cd boost - $OriginalErrorActionPreference = $ErrorActionPreference - $ErrorActionPreference= 'silentlycontinue' - git checkout "${env:BOOST_BRANCH}" - $ErrorActionPreference = $OriginalErrorActionPreference - echo "using" "msvc" ";" > "${env:HOME}/user-config.jam" - & "${env:BUILD_SOURCESDIRECTORY}\src\engine\b2.exe" "--boost-build=${env:BUILD_SOURCESDIRECTORY}/src" --debug-configuration --build-type=complete --layout=versioned -n -d1 toolset=msvc install - displayName: Test - -- stage: WebsiteUpdate +- stage: Website_Update + dependsOn: [Core] displayName: 'Website Update' condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/develop') jobs: From 52efe2b26f1907506726e28d04251f58538e9273 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 23 Jan 2021 12:25:57 -0600 Subject: [PATCH 110/126] AZP doesn't support YML anchors.. lame! --- azure-pipelines.yml | 129 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 121 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 37ffdb64bb..015aff158d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,7 +33,7 @@ stages: Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} pool: vmImage: $(VM_IMAGE) - steps: &linux_default_build_steps + steps: - bash: | set -e uname -a @@ -50,7 +50,7 @@ stages: Clang 10: {PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04'} pool: vmImage: $(VM_IMAGE) - steps: &linux_clang_only_build_steps + steps: - bash: | set -e uname -a @@ -68,7 +68,7 @@ stages: GCC 10: {TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: g++-10, PACKAGES: g++-10, VM_IMAGE: 'ubuntu-18.04'} pool: vmImage: $(VM_IMAGE) - steps: &linux_test_steps + steps: - bash: | set -e uname -a @@ -116,7 +116,7 @@ stages: VS 2019: {TOOLSET: vc142, TEST_TOOLSET: msvc, VM_IMAGE: 'windows-2019'} pool: vmImage: $(VM_IMAGE) - steps: &windows_test_steps + steps: - powershell: | cd src/engine $env:path += ';' + $env:CXX_PATH @@ -157,7 +157,7 @@ stages: Xcode 12.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.3.app, VM_IMAGE: 'macOS-10.15'} pool: vmImage: $(VM_IMAGE) - steps: &macos_test_steps + steps: - bash: | set -e uname -a @@ -228,7 +228,47 @@ stages: Clang 3.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++-3.5, PACKAGES: clang-3.5, VM_IMAGE: 'ubuntu-16.04'} pool: vmImage: $(VM_IMAGE) - steps: *linux_test_steps + steps: + - bash: | + set -e + uname -a + ./.ci/linux-cxx-install.sh + displayName: Install + - bash: | + set -e + cd src/engine + set PATH=${PATH};${CXX_PATH} + ./build.sh ${TOOLSET} + ./b2 -v + cd ../.. + displayName: Build + - bash: | + set -e + CXX_PATH=`which ${CXX}` + cd test + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + python test_all.py ${TEST_TOOLSET} + cd .. + displayName: Test + - bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} + displayName: "No Warnings" + - bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./bootstrap.sh ${TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + rm ./b2 + export PATH=$HOME/temp/.b2/bin:$PATH + cd $HOME + touch build.jam + b2 -v + b2 -n --debug-configuration + displayName: Bootstrap - job: 'Windows' strategy: @@ -237,7 +277,40 @@ stages: MinGW 8.1.0: {TOOLSET: mingw, TEST_TOOLSET: gcc, VM_IMAGE: 'vs2017-win2016'} pool: vmImage: $(VM_IMAGE) - steps: *windows_test_steps + steps: + - powershell: | + cd src/engine + $env:path += ';' + $env:CXX_PATH + cmd /c build.bat $env:TOOLSET + ./b2.exe -v + cd ../.. + displayName: Build + - powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + cd test + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam + python test_all.py $env:TEST_TOOLSET + cd .. + displayName: Test + - powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam + ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET + displayName: "No Warnings" + - powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam + ./bootstrap.bat $env:TOOLSET + ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET + Remove-Item ./b2.exe + $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH + cd $env:HOME + echo $null >> build.jam + b2 -v + b2 -n --debug-configuration + displayName: Bootstrap - job: 'macOS' strategy: @@ -258,7 +331,47 @@ stages: Xcode 10.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.app, VM_IMAGE: 'macOS-10.14'} pool: vmImage: $(VM_IMAGE) - steps: *macos_test_steps + steps: + - bash: | + set -e + uname -a + sudo xcode-select -switch ${XCODE_APP} + which clang++ + displayName: Install + - bash: | + set -e + cd src/engine + ./build.sh ${TOOLSET} + ./b2 -v + cd ../.. + displayName: Build + - bash: | + set -e + CXX_PATH=`which ${CXX}` + cd test + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + python test_all.py ${TEST_TOOLSET} + cd .. + displayName: Test + - bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} + displayName: "No Warnings" + - bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./bootstrap.sh ${TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + rm ./b2 + export PATH=$HOME/temp/.b2/bin:$PATH + cd $HOME + touch build.jam + b2 -v + b2 -n --debug-configuration + displayName: Bootstrap - stage: Boost_Dev dependsOn: [Core] From 5de634b3fa40ac720801daba41083c4e595ca219 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 24 Jan 2021 22:11:09 -0600 Subject: [PATCH 111/126] AZP templates to avoid duplication of steps. --- .ci/azp-linux-test.yml | 41 +++++++ .ci/azp-macos-test.yml | 41 +++++++ .ci/azp-windows-test.yml | 34 ++++++ azure-pipelines.yml | 232 +-------------------------------------- 4 files changed, 122 insertions(+), 226 deletions(-) create mode 100644 .ci/azp-linux-test.yml create mode 100644 .ci/azp-macos-test.yml create mode 100644 .ci/azp-windows-test.yml diff --git a/.ci/azp-linux-test.yml b/.ci/azp-linux-test.yml new file mode 100644 index 0000000000..0520ea7321 --- /dev/null +++ b/.ci/azp-linux-test.yml @@ -0,0 +1,41 @@ +steps: +- bash: | + set -e + uname -a + ./.ci/linux-cxx-install.sh + displayName: Install +- bash: | + set -e + cd src/engine + set PATH=${PATH};${CXX_PATH} + ./build.sh ${TOOLSET} + ./b2 -v + cd ../.. + displayName: Build +- bash: | + set -e + CXX_PATH=`which ${CXX}` + cd test + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + python test_all.py ${TEST_TOOLSET} + cd .. + displayName: Test +- bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} + displayName: "No Warnings" +- bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./bootstrap.sh ${TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + rm ./b2 + export PATH=$HOME/temp/.b2/bin:$PATH + cd $HOME + touch build.jam + b2 -v + b2 -n --debug-configuration + displayName: Bootstrap diff --git a/.ci/azp-macos-test.yml b/.ci/azp-macos-test.yml new file mode 100644 index 0000000000..2bc040e579 --- /dev/null +++ b/.ci/azp-macos-test.yml @@ -0,0 +1,41 @@ +steps: +- bash: | + set -e + uname -a + sudo xcode-select -switch ${XCODE_APP} + which clang++ + displayName: Install +- bash: | + set -e + cd src/engine + ./build.sh ${TOOLSET} + ./b2 -v + cd ../.. + displayName: Build +- bash: | + set -e + CXX_PATH=`which ${CXX}` + cd test + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + python test_all.py ${TEST_TOOLSET} + cd .. + displayName: Test +- bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} + displayName: "No Warnings" +- bash: | + set -e + CXX_PATH=`which ${CXX}` + echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam + ./bootstrap.sh ${TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + rm ./b2 + export PATH=$HOME/temp/.b2/bin:$PATH + cd $HOME + touch build.jam + b2 -v + b2 -n --debug-configuration + displayName: Bootstrap diff --git a/.ci/azp-windows-test.yml b/.ci/azp-windows-test.yml new file mode 100644 index 0000000000..25aaf8f837 --- /dev/null +++ b/.ci/azp-windows-test.yml @@ -0,0 +1,34 @@ +steps: +- powershell: | + cd src/engine + $env:path += ';' + $env:CXX_PATH + cmd /c build.bat $env:TOOLSET + ./b2.exe -v + cd ../.. + displayName: Build +- powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + cd test + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam + python test_all.py $env:TEST_TOOLSET + cd .. + displayName: Test +- powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam + ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET + displayName: "No Warnings" +- powershell: | + $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH + $env:path += ';' + $env:CXX_PATH + echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam + ./bootstrap.bat $env:TOOLSET + ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET + Remove-Item ./b2.exe + $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH + cd $env:HOME + echo $null >> build.jam + b2 -v + b2 -n --debug-configuration + displayName: Bootstrap diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 015aff158d..afec0145b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -69,46 +69,7 @@ stages: pool: vmImage: $(VM_IMAGE) steps: - - bash: | - set -e - uname -a - ./.ci/linux-cxx-install.sh - displayName: Install - - bash: | - set -e - cd src/engine - set PATH=${PATH};${CXX_PATH} - ./build.sh ${TOOLSET} - ./b2 -v - cd ../.. - displayName: Build - - bash: | - set -e - CXX_PATH=`which ${CXX}` - cd test - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - python test_all.py ${TEST_TOOLSET} - cd .. - displayName: Test - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} - displayName: "No Warnings" - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} - rm ./b2 - export PATH=$HOME/temp/.b2/bin:$PATH - cd $HOME - touch build.jam - b2 -v - b2 -n --debug-configuration - displayName: Bootstrap + - template: .ci/azp-linux-test.yml - job: 'Windows_Latest' strategy: @@ -117,39 +78,7 @@ stages: pool: vmImage: $(VM_IMAGE) steps: - - powershell: | - cd src/engine - $env:path += ';' + $env:CXX_PATH - cmd /c build.bat $env:TOOLSET - ./b2.exe -v - cd ../.. - displayName: Build - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - cd test - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - python test_all.py $env:TEST_TOOLSET - cd .. - displayName: Test - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET - displayName: "No Warnings" - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - ./bootstrap.bat $env:TOOLSET - ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET - Remove-Item ./b2.exe - $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH - cd $env:HOME - echo $null >> build.jam - b2 -v - b2 -n --debug-configuration - displayName: Bootstrap + - template: .ci/azp-windows-test.yml - job: 'macOS' strategy: @@ -158,46 +87,7 @@ stages: pool: vmImage: $(VM_IMAGE) steps: - - bash: | - set -e - uname -a - sudo xcode-select -switch ${XCODE_APP} - which clang++ - displayName: Install - - bash: | - set -e - cd src/engine - ./build.sh ${TOOLSET} - ./b2 -v - cd ../.. - displayName: Build - - bash: | - set -e - CXX_PATH=`which ${CXX}` - cd test - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - python test_all.py ${TEST_TOOLSET} - cd .. - displayName: Test - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} - displayName: "No Warnings" - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} - rm ./b2 - export PATH=$HOME/temp/.b2/bin:$PATH - cd $HOME - touch build.jam - b2 -v - b2 -n --debug-configuration - displayName: Bootstrap + - template: .ci/azp-macos-test.yml - stage: Compilers dependsOn: [Core] @@ -229,46 +119,7 @@ stages: pool: vmImage: $(VM_IMAGE) steps: - - bash: | - set -e - uname -a - ./.ci/linux-cxx-install.sh - displayName: Install - - bash: | - set -e - cd src/engine - set PATH=${PATH};${CXX_PATH} - ./build.sh ${TOOLSET} - ./b2 -v - cd ../.. - displayName: Build - - bash: | - set -e - CXX_PATH=`which ${CXX}` - cd test - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - python test_all.py ${TEST_TOOLSET} - cd .. - displayName: Test - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} - displayName: "No Warnings" - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} - rm ./b2 - export PATH=$HOME/temp/.b2/bin:$PATH - cd $HOME - touch build.jam - b2 -v - b2 -n --debug-configuration - displayName: Bootstrap + - template: .ci/azp-linux-test.yml - job: 'Windows' strategy: @@ -278,39 +129,7 @@ stages: pool: vmImage: $(VM_IMAGE) steps: - - powershell: | - cd src/engine - $env:path += ';' + $env:CXX_PATH - cmd /c build.bat $env:TOOLSET - ./b2.exe -v - cd ../.. - displayName: Build - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - cd test - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - python test_all.py $env:TEST_TOOLSET - cd .. - displayName: Test - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - ./src/engine/b2.exe --debug-configuration b2 warnings-as-errors=on variant=debug,release toolset=$env:TEST_TOOLSET - displayName: "No Warnings" - - powershell: | - $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH - $env:path += ';' + $env:CXX_PATH - echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - ./bootstrap.bat $env:TOOLSET - ./b2.exe --debug-configuration --prefix=${env:HOME}/temp/.b2 install toolset=$env:TEST_TOOLSET - Remove-Item ./b2.exe - $env:path += $env:HOME + '/temp/.b2/bin' + ';' + $env:PATH - cd $env:HOME - echo $null >> build.jam - b2 -v - b2 -n --debug-configuration - displayName: Bootstrap + - template: .ci/azp-windows-test.yml - job: 'macOS' strategy: @@ -332,46 +151,7 @@ stages: pool: vmImage: $(VM_IMAGE) steps: - - bash: | - set -e - uname -a - sudo xcode-select -switch ${XCODE_APP} - which clang++ - displayName: Install - - bash: | - set -e - cd src/engine - ./build.sh ${TOOLSET} - ./b2 -v - cd ../.. - displayName: Build - - bash: | - set -e - CXX_PATH=`which ${CXX}` - cd test - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - python test_all.py ${TEST_TOOLSET} - cd .. - displayName: Test - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} - displayName: "No Warnings" - - bash: | - set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} - rm ./b2 - export PATH=$HOME/temp/.b2/bin:$PATH - cd $HOME - touch build.jam - b2 -v - b2 -n --debug-configuration - displayName: Bootstrap + - template: .ci/azp-macos-test.yml - stage: Boost_Dev dependsOn: [Core] From 7e6cc793fb01c0c5650ae1c2ee97d12d30a59382 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 25 Jan 2021 14:33:44 -0600 Subject: [PATCH 112/126] No need to cd to engine dir for build. --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 37bc9502f6..b0b22f2e95 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -10,7 +10,7 @@ # Build b2 echo "Building the B2 engine.." pwd=`pwd` -( cd "./src/engine" && ./build.sh "$*" ) +"${pwd}/src/engine/build.sh" "$*" if [ $? -ne 0 ]; then echo echo "Failed to build the B2 engine." 1>&2 From 4a7dd4937ffcc6e6ba8fdf7098f557e1642e1835 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 26 Jan 2021 21:04:28 -0600 Subject: [PATCH 113/126] Use pathnt.cpp on mingw. --- src/engine/build.sh | 1 + src/engine/jam.h | 3 +++ src/engine/pathnt.cpp | 4 ++++ src/engine/pathunix.cpp | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/src/engine/build.sh b/src/engine/build.sh index 4c4d0ec31f..289eec5c0c 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -462,6 +462,7 @@ object.cpp \ option.cpp \ output.cpp \ parse.cpp \ +pathnt.cpp \ pathsys.cpp \ pathunix.cpp \ regexp.cpp \ diff --git a/src/engine/jam.h b/src/engine/jam.h index f9f139582e..5d706dcb79 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -88,6 +88,7 @@ #define SPLITPATH ';' #define MAXLINE (undefined__see_execnt_c) /* max chars per command line */ #define USE_EXECNT +#define USE_PATHNT #define PATH_DELIM '\\' /* AS400 cross-compile from NT. */ @@ -131,6 +132,7 @@ #define SPLITPATH ';' #define MAXLINE 996 /* max chars per command line */ #define USE_EXECUNIX +#define USE_PATHNT #define PATH_DELIM '\\' #endif /* #ifdef MINGW */ @@ -145,6 +147,7 @@ #define OSMAJOR "UNIX=true" #define USE_EXECUNIX #define USE_FILEUNIX +#define USE_PATHUNIX #define PATH_DELIM '/' #ifdef _AIX diff --git a/src/engine/pathnt.cpp b/src/engine/pathnt.cpp index cff639bc9f..a4cdc93c86 100644 --- a/src/engine/pathnt.cpp +++ b/src/engine/pathnt.cpp @@ -17,6 +17,8 @@ */ #include "jam.h" +#ifdef USE_PATHNT + #include "pathsys.h" #include "hash.h" @@ -407,3 +409,5 @@ void path_done( void ) hashdone( path_key_cache ); } } + +#endif // USE_PATHNT diff --git a/src/engine/pathunix.cpp b/src/engine/pathunix.cpp index 2b2347c871..b4aab23822 100644 --- a/src/engine/pathunix.cpp +++ b/src/engine/pathunix.cpp @@ -16,6 +16,9 @@ * pathunix.c - UNIX specific path manipulation support */ +#include "jam.h" +#ifdef USE_PATHUNIX + #include "pathsys.h" #include @@ -84,3 +87,5 @@ OBJECT * path_as_key( OBJECT * path ) void path_done( void ) { } + +#endif // USE_PATHUNIX From e52464b88e2501352df93877e6bb61f96a6e9306 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 31 Jan 2021 12:12:57 -0600 Subject: [PATCH 114/126] Some minor doc fixes. --- doc/jamfile.jam | 4 ++++ doc/src/howto.adoc | 6 ------ doc/src/standalone.adoc | 18 +++++++++++++++--- doc/src/tutorial.adoc | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/doc/jamfile.jam b/doc/jamfile.jam index 8ed7bfd38b..579650ca58 100644 --- a/doc/jamfile.jam +++ b/doc/jamfile.jam @@ -35,6 +35,7 @@ project b2doc ; path-constant PYGMENTS_DIR : src/pygments ; +path-constant STYLES_DIR : src/styles ; doc-dir = [ MATCH "--doc-dir=(.*)" : [ modules.peek : ARGV ] ] ; doc-dir ?= html ; @@ -56,6 +57,9 @@ html index : src/standalone.adoc : --trace --verbose $(PYGMENTS_DIR)/pygments_init.rb + # "-a stylesheet=amber.css" + # "-a stylesdir=$(STYLES_DIR)" + # linkcss ; explicit index ; diff --git a/doc/src/howto.adoc b/doc/src/howto.adoc index 38a31f3c7c..4310f405d5 100644 --- a/doc/src/howto.adoc +++ b/doc/src/howto.adoc @@ -13,9 +13,3 @@ If there's anything you find unclear in this documentation, report the problem directly in the https://github.com/boostorg/build/issues[issue tracker]. For more general questions, please post them to our mailing list (http://boost.org/more/mailing_lists.htm#jamboost[]). - -**** -Copyright 2006, 2014 http://vladimirprus.com[Vladimir Prus]. 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) -**** \ No newline at end of file diff --git a/doc/src/standalone.adoc b/doc/src/standalone.adoc index 9b7c0b4b1c..147dc2ec39 100644 --- a/doc/src/standalone.adoc +++ b/doc/src/standalone.adoc @@ -1,14 +1,17 @@ = B2 User Manual -:copyright: Copyright 2018 Rene Rivera; Copyright 2006, 2014 Vladimir Prus -:author: Rene Rivera, Vladimir Prus, Steven Watanabe +:copyright: Copyright 2018-2021 René Ferdinand Rivera Morell; Copyright 2006, 2014 Vladimir Prus +:author: René Ferdinand Rivera Morell, Vladimir Prus, Steven Watanabe :toc: left -:toclevels: 3 +:toclevels: 2 :sectanchors: :sectnums: :nofooter: +// :source-highlighter: rouge :source-highlighter: pygments :source-language: jam :highlightjsdir: hljs +:pygments-style: native +// :rouge-style: native :pygments-style: friendly :caution-caption: âš‘ :important-caption: ‼ @@ -17,6 +20,8 @@ :warning-caption: âš  :CPP: C++ +== Introduction + ifdef::backend-html5[] ++++