From 855b569d25b5810213ae7e52c04df4e5e0cf8d46 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Apr 2009 14:54:29 +0000 Subject: Start a new branch for C++0x experimentation. With GCC, build as C++0x (set the binary name to my particular installed GCC 4.4 snapshot). --- src/build-data/cc/gcc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/build-data') diff --git a/src/build-data/cc/gcc b/src/build-data/cc/gcc index 68d79ddf8..bde1e5822 100644 --- a/src/build-data/cc/gcc +++ b/src/build-data/cc/gcc @@ -1,6 +1,6 @@ realname "GNU C++" -binary_name "g++" +binary_name "g++-4.4-20090331" compiler_has_tr1 yes @@ -10,7 +10,7 @@ add_include_dir_option "-I" add_lib_dir_option "-L" add_lib_option "-l" -lang_flags "-D_REENTRANT -ansi -Wno-long-long" +lang_flags "-D_REENTRANT -ansi -Wno-long-long -std=c++0x" warning_flags "-W -Wall" #warning_flags "-Wextra -Wall -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wno-unused-parameter" -- cgit v1.2.3 From aa7beddcc30d256dbcaea55a951ca75c5361b2b4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 9 Sep 2009 00:03:55 +0000 Subject: Use GCC 4.4.1-release for C++0x testing --- src/build-data/cc/gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/build-data') diff --git a/src/build-data/cc/gcc b/src/build-data/cc/gcc index 7ab80b6ca..23671efce 100644 --- a/src/build-data/cc/gcc +++ b/src/build-data/cc/gcc @@ -1,6 +1,6 @@ realname "GNU C++" -binary_name "g++-4.4-20090331" +binary_name "g++-4.4.1" compiler_has_tr1 yes -- cgit v1.2.3 From 75ce98125baa42cb8f5a64c1329f946061a28c9b Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 13 Nov 2009 23:35:16 +0000 Subject: Use GCC 4.5 snapshot for C++0x build --- src/build-data/cc/gcc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/build-data') diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index c4b5b9fbc..82c1a983d 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -1,6 +1,6 @@ macro_name "GCC" -binary_name "g++-4.4.1" +binary_name "g++-4.5-20091112" compiler_has_tr1 yes -- cgit v1.2.3 From 5ef971f34aced376e385a7ac301e0db96fbef0d4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 13 Nov 2009 23:38:01 +0000 Subject: Remove TR1 hooks - can be assumed to exist under a C++0x compiler --- configure.py | 44 ++++++-------------------------------------- src/build-data/cc/gcc.txt | 2 -- src/build-data/cc/icc.txt | 2 -- src/cert/cvc/info.txt | 2 -- src/math/gfpmath/info.txt | 4 +--- 5 files changed, 7 insertions(+), 47 deletions(-) (limited to 'src/build-data') diff --git a/configure.py b/configure.py index 5e2e4004d..d48396c8a 100755 --- a/configure.py +++ b/configure.py @@ -174,10 +174,6 @@ def process_command_line(args): default=False, action='store_true', help='enable Boost.Python wrapper') - build_group.add_option('--with-tr1-implementation', metavar='WHICH', - dest='with_tr1', default=None, - help='enable TR1 (options: none, system, boost)') - build_group.add_option('--with-build-dir', metavar='DIR', default='', help='setup the build in DIR') @@ -368,7 +364,6 @@ class ModuleInfo(object): { 'load_on': 'auto', 'define': None, 'modset': None, - 'uses_tr1': 'false', 'need_isa': None, 'note': '', 'mp_bits': 0 }) @@ -399,11 +394,6 @@ class ModuleInfo(object): self.mp_bits = int(self.mp_bits) - if self.uses_tr1 == 'yes': - self.uses_tr1 = True - else: - self.uses_tr1 = False - def compatible_cpu(self, archinfo, options): arch_name = archinfo.basename @@ -423,9 +413,7 @@ class ModuleInfo(object): def compatible_os(self, os): return self.os == [] or os in self.os - def compatible_compiler(self, cc, with_tr1): - if self.uses_tr1 and with_tr1 not in ['boost', 'system']: - return False + def compatible_compiler(self, cc): return self.cc == [] or cc in self.cc def dependencies(self): @@ -538,8 +526,7 @@ class CompilerInfo(object): 'dll_import_flags': '', 'dll_export_flags': '', 'ar_command': None, - 'makefile_style': '', - 'compiler_has_tr1': False, + 'makefile_style': '' }) self.so_link_flags = force_to_dict(self.so_link_flags) @@ -617,19 +604,8 @@ class CompilerInfo(object): """ Return defines for build.h """ - def defines(self, with_tr1): - - def tr1_macro(): - if with_tr1: - if with_tr1 == 'boost': - return ['USE_BOOST_TR1'] - elif with_tr1 == 'system': - return ['USE_STD_TR1'] - elif self.compiler_has_tr1: - return ['USE_STD_TR1'] - return [] - - return ['BUILD_COMPILER_IS_' + self.macro_name] + tr1_macro() + def defines(self): + return ['BUILD_COMPILER_IS_' + self.macro_name] class OsInfo(object): def __init__(self, infofile): @@ -843,8 +819,7 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): 'target_os_defines': make_cpp_macros(osinfo.defines()), - 'target_compiler_defines': make_cpp_macros( - cc.defines(options.with_tr1)), + 'target_compiler_defines': make_cpp_macros(cc.defines()), 'target_cpu_defines': make_cpp_macros(arch.defines(options)), @@ -920,8 +895,7 @@ def choose_modules_to_use(modules, archinfo, options): cannot_use_because(modname, 'CPU incompatible') elif not module.compatible_os(options.os): cannot_use_because(modname, 'OS incompatible') - elif not module.compatible_compiler(options.compiler, - options.with_tr1): + elif not module.compatible_compiler(options.compiler): cannot_use_because(modname, 'compiler incompatible') else: @@ -1220,12 +1194,6 @@ def main(argv = None): logging.info('Setting -fpermissive to work around gcc bug') options.extra_flags = ' -fpermissive' - if options.with_tr1 == None: - if ccinfo[options.compiler].compiler_has_tr1: - options.with_tr1 = 'system' - else: - options.with_tr1 = 'none' - modules_to_use = choose_modules_to_use(modules, archinfo[options.arch], options) diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index 82c1a983d..d1b76edec 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -2,8 +2,6 @@ macro_name "GCC" binary_name "g++-4.5-20091112" -compiler_has_tr1 yes - compile_option "-c " output_to_option "-o " add_include_dir_option "-I" diff --git a/src/build-data/cc/icc.txt b/src/build-data/cc/icc.txt index b5cad542c..7187cae56 100644 --- a/src/build-data/cc/icc.txt +++ b/src/build-data/cc/icc.txt @@ -2,8 +2,6 @@ macro_name "INTEL" binary_name "icpc" -compiler_has_tr1 yes - compile_option "-c " output_to_option "-o " add_include_dir_option "-I" diff --git a/src/cert/cvc/info.txt b/src/cert/cvc/info.txt index bdd496614..ff7e04c07 100644 --- a/src/cert/cvc/info.txt +++ b/src/cert/cvc/info.txt @@ -1,7 +1,5 @@ define CARD_VERIFIABLE_CERTIFICATES -uses_tr1 yes - load_on auto diff --git a/src/math/gfpmath/info.txt b/src/math/gfpmath/info.txt index abbdb0a47..e1bf892c7 100644 --- a/src/math/gfpmath/info.txt +++ b/src/math/gfpmath/info.txt @@ -1,9 +1,7 @@ -uses_tr1 yes +define BIGINT_GFP load_on auto -define BIGINT_GFP - curve_gfp.cpp curve_gfp.h -- cgit v1.2.3 From 435965ac3b199d31b799ebefc012d928bc415621 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 17 Nov 2009 00:08:44 +0000 Subject: Use -pthread on all platforms. This is necessary to get functioning support for std::thread, and to ensure that std::mutex actually maps to a real mutex and not a no-op. Don't explicitly define _REENTRANT; -pthread will handle that if necessary. --- src/build-data/cc/gcc.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/build-data') diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index d1b76edec..0b1668908 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -8,7 +8,7 @@ add_include_dir_option "-I" add_lib_dir_option "-L" add_lib_option "-l" -lang_flags "-D_REENTRANT -ansi -Wno-long-long -std=c++0x" +lang_flags "-ansi -Wno-long-long -std=c++0x" warning_flags "-W -Wall" #warning_flags "-Wextra -Wall -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wno-unused-parameter" @@ -70,6 +70,8 @@ ppc64 -> "-mcpu=SUBMODEL" ppc # Note that the 'linking' bit means "use this for both compiling *and* linking" +all -> "-pthread" + amd64 -> "-m64" mips64 -> "-mabi=64" s390 -> "-m31" @@ -78,10 +80,6 @@ sparc32 -> "-m32 -mno-app-regs" sparc64 -> "-m64 -mno-app-regs" ppc64 -> "-m64" -# This should probably be used on most/all targets, but the docs are incomplete -openbsd -> "-pthread" -freebsd -> "-pthread" -dragonfly -> "-pthread" -netbsd -> "-pthread -D_NETBSD_SOURCE" +netbsd -> "-D_NETBSD_SOURCE" qnx -> "-fexceptions -D_QNX_SOURCE" -- cgit v1.2.3 From 2af8cfbaf23033250a6819be9f45f82bf03e898d Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 19 Nov 2009 17:20:46 +0000 Subject: Drop support for compilers that are no longer in active service, since there is no chance that C++0x support will be added to them at any point. --- src/build-data/cc/compaq.txt | 29 ----------------------------- src/build-data/cc/kai.txt | 30 ------------------------------ src/build-data/cc/mipspro.txt | 42 ------------------------------------------ src/build-data/cc/sgipro64.txt | 30 ------------------------------ 4 files changed, 131 deletions(-) delete mode 100644 src/build-data/cc/compaq.txt delete mode 100644 src/build-data/cc/kai.txt delete mode 100644 src/build-data/cc/mipspro.txt delete mode 100644 src/build-data/cc/sgipro64.txt (limited to 'src/build-data') diff --git a/src/build-data/cc/compaq.txt b/src/build-data/cc/compaq.txt deleted file mode 100644 index 9ad6514ab..000000000 --- a/src/build-data/cc/compaq.txt +++ /dev/null @@ -1,29 +0,0 @@ -macro_name "COMPAQ" - -binary_name "cxx" - -compile_option "-c " -output_to_option "-o " -add_include_dir_option "-I" -add_lib_dir_option "-L" -add_lib_option "-l" - -# -O3 and up seem to be unhappy with Botan -lib_opt_flags "-O2" -check_opt_flags "-O2" -debug_flags "-g" -no_debug_flags "" -lang_flags "-std ansi -D__USE_STD_IOSTREAM" - -dll_import_flags "" -dll_export_flags "" - -makefile_style unix - - -default -> "$(CXX) -shared -soname $(SONAME)" - - - -alpha -> "-arch=SUBMODEL" alpha- - diff --git a/src/build-data/cc/kai.txt b/src/build-data/cc/kai.txt deleted file mode 100644 index d0ff1c28a..000000000 --- a/src/build-data/cc/kai.txt +++ /dev/null @@ -1,30 +0,0 @@ -macro_name "KAI" - -binary_name "KCC" - -compile_option "-c " -output_to_option "-o " -add_include_dir_option "-I" -add_lib_dir_option "-L" -add_lib_option "-l" - -ar_command "KCC -o" - -lib_opt_flags "+K3 --inline_auto_space_time=65 --abstract_pointer" -check_opt_flags "+K3" -lang_flags "-D__KAI_STRICT" -debug_flags "-g" -no_debug_flags "" - -dll_import_flags "" -dll_export_flags "" - -makefile_style unix - - -default -> "$(CXX) --soname $(SONAME)" - - - -all -> "--one_per" - diff --git a/src/build-data/cc/mipspro.txt b/src/build-data/cc/mipspro.txt deleted file mode 100644 index c518f4c26..000000000 --- a/src/build-data/cc/mipspro.txt +++ /dev/null @@ -1,42 +0,0 @@ -macro_name "MIPSPRO" - -binary_name "CC" - -compile_option "-c " -output_to_option "-o " -add_include_dir_option "-I" -add_lib_dir_option "-L" -add_lib_option "-l" - -lib_opt_flags "-O3 -OPT:alias=TYPED" -check_opt_flags "-O3 -OPT:alias=TYPED" -debug_flags "-g3" -no_debug_flags "" -shared_flags "-KPIC" -lang_flags "-ansi -LANG:ansi-for-init-scope=ON" -# Disabled, because, while my code is fine, it warns about a lot of it's own -# headers -#warning_flags "-fullwarn" - -dll_import_flags "" -dll_export_flags "" - -makefile_style unix - - -default -> "$(CXX) -shared -Wl,-soname,$(SONAME)" - - - -mips32 -> "-mips1" -mips64 -> "-mips3" - -mips64-r5000 -> "-mips4 -r5000" -mips64-r8000 -> "-mips4 -r8000" -mips64-r10000 -> "-mips4 -r10000" - - - -mips32 -> "-n32" -mips64 -> "-64" - diff --git a/src/build-data/cc/sgipro64.txt b/src/build-data/cc/sgipro64.txt deleted file mode 100644 index 073f2fec0..000000000 --- a/src/build-data/cc/sgipro64.txt +++ /dev/null @@ -1,30 +0,0 @@ -macro_name "SGI_PRO64" - -binary_name "sgiCC" - -compile_option "-c " -output_to_option "-o " -add_include_dir_option "-I" -add_lib_dir_option "-L" -add_lib_option "-l" - -lib_opt_flags "-O3 -OPT:alias=TYPED" -check_opt_flags "-O3 -OPT:alias=TYPED" -debug_flags "-g3" -no_debug_flags "" -shared_flags "-KPIC" -lang_flags "-ansi -LANG:ansi-for-init-scope=ON" -warning_flags "-Wall -W" - -dll_import_flags "" -dll_export_flags "" - -makefile_style unix - - -default -> "$(CXX) -shared -Wl,-soname,$(SONAME)" - - - - - -- cgit v1.2.3 From 9559e323cb631af4e154f5fd30ff2927748817ed Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 1 Dec 2009 17:28:19 +0000 Subject: Instead of checking for Windows generically before using QueryPerformanceCounter, check a feature macro named BOTAN_OS_HAS_QUERY_PERF_COUNTER, and set the same via configure.py for Windows builds. --- src/build-data/os/windows.txt | 1 + src/entropy/hres_timer/hres_timer.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/build-data') diff --git a/src/build-data/os/windows.txt b/src/build-data/os/windows.txt index e72931c98..59e3ec072 100644 --- a/src/build-data/os/windows.txt +++ b/src/build-data/os/windows.txt @@ -12,6 +12,7 @@ install_cmd_exec "copy" win32_virtual_lock +win32_query_perf_counter diff --git a/src/entropy/hres_timer/hres_timer.cpp b/src/entropy/hres_timer/hres_timer.cpp index 0f75583ef..e6cc102ed 100644 --- a/src/entropy/hres_timer/hres_timer.cpp +++ b/src/entropy/hres_timer/hres_timer.cpp @@ -8,7 +8,7 @@ #include #include -#if defined(BOTAN_TARGET_OS_IS_WINDOWS) +#if defined(BOTAN_TARGET_OS_HAS_QUERY_PERF_COUNTER) #include #endif @@ -19,8 +19,7 @@ namespace Botan { */ void High_Resolution_Timestamp::poll(Entropy_Accumulator& accum) { - // If Windows, grab the Performance Counter (usually TSC or PIT) -#if defined(BOTAN_TARGET_OS_IS_WINDOWS) +#if defined(BOTAN_TARGET_OS_HAS_QUERY_PERF_COUNTER) LARGE_INTEGER tv; ::QueryPerformanceCounter(&tv); accum.add(tv.QuadPart, 0); -- cgit v1.2.3