def architecture_flag(compiler, arch):
    """
    returns flags specific to the target architecture and compiler
    """
    if not compiler or not arch:
        return ""

    if str(compiler) in ['gcc', 'apple-clang', 'clang', 'sun-cc']:
        if str(arch) in ['x86_64', 'sparcv9']:
            return '-m64'
        elif str(arch) in ['x86', 'sparc']:
            return '-m32'
    return ""