Exemplo n.º 1
0
def get_link_args(unwind):
    platform_val = chpl_platform.get('target')
    osx = platform_val.startswith('darwin')

    # Mac OS X supports libunwind in the C library
    # it's not actually a special library.
    if osx:
        return []

    libs = []
    # Get the link arguments (e.g. -lunwind)
    if unwind == 'system':
        # Try using pkg-config to get the libraries to link
        # libunwind with.
        libs = third_party_utils.pkgconfig_get_link_args('libunwind',
                                                         system=True,
                                                         static=True)
    elif unwind == 'bundled':
        # the pkg-config file for libunwind is nice, but as of 1.1
        # it doesn't include -lzma when it probably should.
        # So try to get the libraries out of libunwind.la.
        libs = third_party_utils.default_get_link_args(
            'libunwind', libs=['libunwind.la', 'libunwind-x86_64.la'])

    # add -ldl so that we can call dladdr
    if "-ldl" not in libs:
        libs.append("-ldl")

    return libs
Exemplo n.º 2
0
def get_link_args(libfabric=get()):
    libs = []
    if libfabric == 'bundled':
        return third_party_utils.default_get_link_args('libfabric',
                                                       ucp=get_uniq_cfg_path(),
                                                       libs=['libfabric.la'],
                                                       add_L_opt=True)
    elif libfabric == 'system':
        # Allow overriding pkg-config via LIBFABRIC_DIR, for platforms
        # without pkg-config.
        libfab_dir_val = overrides.get('LIBFABRIC_DIR')
        if libfab_dir_val:
            libs.extend(['-L' + libfab_dir_val + '/lib',
                         '-Wl,-rpath,' + libfab_dir_val + '/lib',
                         '-lfabric'])
        else:
            # Try using pkg-config to get the libraries to link
            # libfabric with.
            pclibs = third_party_utils.pkgconfig_get_link_args('libfabric',
                                                               system=True)
            for pcl in pclibs:
                libs.append(pcl)
                if pcl.startswith('-L'):
                    libs.append(pcl.replace('-L', '-Wl,-rpath,', 1))

    return libs
def get_link_args(libfabric):
    libs = []
    if libfabric == 'system':
      # Try using pkg-config to get the libraries to link
      # libfabric with.
      pclibs = third_party_utils.pkgconfig_get_link_args(
                       'libfabric', system=True)
      for pcl in pclibs:
        libs.append(pcl)
        if pcl.startswith('-L'):
          libs.append(pcl.replace('-L', '-Wl,-rpath,', 1))
    elif libfabric == 'libfabric':
      error("CHPL_LIBFABRIC=libfabric is not yet supported", ValueError)

    return libs
Exemplo n.º 4
0
def get_link_args(libfabric):
    libs = []
    if libfabric == 'system':
        # Allow overriding pkg-config via LIBFABRIC_DIR, for platforms
        # without pkg-config.
        libfab_dir_val = overrides.get('LIBFABRIC_DIR')
        if libfab_dir_val:
            libs.extend(['-L' + libfab_dir_val + '/lib',
                         '-Wl,-rpath,' + libfab_dir_val + '/lib',
                         '-lfabric'])
        else:
            # Try using pkg-config to get the libraries to link
            # libfabric with.
            pclibs = third_party_utils.pkgconfig_get_link_args('libfabric',
                                                               system=True)
            for pcl in pclibs:
                libs.append(pcl)
                if pcl.startswith('-L'):
                    libs.append(pcl.replace('-L', '-Wl,-rpath,', 1))
    elif libfabric == 'libfabric':
        error("CHPL_LIBFABRIC=libfabric is not yet supported", ValueError)

    return libs
def get_link_args(unwind):
    platform_val = chpl_platform.get('target')
    osx = platform_val.startswith('darwin')

    # Mac OS X supports libunwind in the C library
    # it's not actually a special library.
    if osx:
      return []

    libs = []
    # Get the link arguments (e.g. -lunwind)
    if unwind == 'system':
      # Try using pkg-config to get the libraries to link
      # libunwind with.
      libs = third_party_utils.pkgconfig_get_link_args(
                       'libunwind', system=True, static=True)
    elif unwind == 'libunwind':
      # the pkg-config file for libunwind is nice, but as of 1.1
      # it doesn't include -lzma when it probably should.
      # So try to get the libraries out of libunwind.la.
      libs = third_party_utils.default_get_link_args(
                       'libunwind', libs=['libunwind.la'])

    return libs