SConscript (9226:66a418aaf850) SConscript (9227:c208c904ab13)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 929 unchanged lines hidden (view full) ---

938
939# Start out with the linker flags common to all linkers, i.e. -pg for
940# prof, and -lprofiler for perf. The -lprofile flag is surrounded by
941# no-as-needed and as-needed as the binutils linker is too clever and
942# simply doesn't link to the library otherwise.
943ldflags = {'debug' : [], 'opt' : [], 'fast' : [], 'prof' : ['-pg'],
944 'perf' : ['-Wl,--no-as-needed', '-lprofiler', '-Wl,--as-needed']}
945
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 929 unchanged lines hidden (view full) ---

938
939# Start out with the linker flags common to all linkers, i.e. -pg for
940# prof, and -lprofiler for perf. The -lprofile flag is surrounded by
941# no-as-needed and as-needed as the binutils linker is too clever and
942# simply doesn't link to the library otherwise.
943ldflags = {'debug' : [], 'opt' : [], 'fast' : [], 'prof' : ['-pg'],
944 'perf' : ['-Wl,--no-as-needed', '-lprofiler', '-Wl,--as-needed']}
945
946# For Link Time Optimization, the optimisation flags used to compile
947# individual files are decoupled from those used at link time
948# (i.e. you can compile with -O3 and perform LTO with -O0), so we need
949# to also update the linker flags based on the target.
946if env['GCC']:
947 if sys.platform == 'sunos5':
948 ccflags['debug'] += ['-gstabs+']
949 else:
950 ccflags['debug'] += ['-ggdb3']
951 ldflags['debug'] += ['-O0']
950if env['GCC']:
951 if sys.platform == 'sunos5':
952 ccflags['debug'] += ['-gstabs+']
953 else:
954 ccflags['debug'] += ['-ggdb3']
955 ldflags['debug'] += ['-O0']
952 # opt, fast, prof and perf all share the same cc flags
956 # opt, fast, prof and perf all share the same cc flags, also add
957 # the optimization to the ldflags as LTO defers the optimization
958 # to link time
953 for target in ['opt', 'fast', 'prof', 'perf']:
954 ccflags[target] += ['-O3']
959 for target in ['opt', 'fast', 'prof', 'perf']:
960 ccflags[target] += ['-O3']
961 ldflags[target] += ['-O3']
962
963 ccflags['fast'] += env['LTO_CCFLAGS']
964 ldflags['fast'] += env['LTO_LDFLAGS']
965
955elif env['SUNCC']:
956 ccflags['debug'] += ['-g0']
957 ccflags['opt'] += ['-O']
958 for target in ['fast', 'prof', 'perf']:
959 ccflags[target] += ['-fast']
960elif env['ICC']:
961 ccflags['debug'] += ['-g', '-O0']
962 ccflags['opt'] += ['-O']

--- 71 unchanged lines hidden ---
966elif env['SUNCC']:
967 ccflags['debug'] += ['-g0']
968 ccflags['opt'] += ['-O']
969 for target in ['fast', 'prof', 'perf']:
970 ccflags[target] += ['-fast']
971elif env['ICC']:
972 ccflags['debug'] += ['-g', '-O0']
973 ccflags['opt'] += ['-O']

--- 71 unchanged lines hidden ---