Changeset 86aad6f in mainline for tools/autotool.py


Ignore:
Timestamp:
2018-11-10T19:54:04Z (6 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc01214
Parents:
c88d91e8 (diff), 279188c0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Vojtech Horky <vojtech.horky@…> (2018-11-10 19:54:04)
git-committer:
GitHub <noreply@…> (2018-11-10 19:54:04)
Message:

Add missing libs to image.iso (PR #55)

Add crt*.o files and libgcc.a to the generated image when CONFIG_DEVEL_FILES is set so we can compile again inside HelenOS.

The change is rather big because it has to find libgcc.a which is somewhere in $CROSS_PREFIX.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    rc88d91e8 r86aad6f  
    320320        check_app([common['GCC'], "--version"], "GNU GCC", details)
    321321
     322def check_libgcc(common):
     323        sys.stderr.write("Checking for libgcc.a ... ")
     324        libgcc_path = None
     325        proc = subprocess.Popen([ common['GCC'], "-print-search-dirs" ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
     326        for line in proc.stdout:
     327                line = line.decode('utf-8').strip('\n')
     328                parts = line.split()
     329                if parts[0] == "install:":
     330                        p = parts[1] + "libgcc.a"
     331                        if os.path.isfile(p):
     332                                libgcc_path = p
     333        proc.wait()
     334
     335        if libgcc_path is None:
     336                sys.stderr.write("failed\n")
     337                print_error(["Unable to find gcc library (libgcc.a).",
     338                                        "",
     339                                        "Please ensure that you have installed the",
     340                                        "toolchain properly."])
     341
     342        sys.stderr.write("ok\n")
     343        common['LIBGCC_PATH'] = libgcc_path
     344
     345
    322346def check_binutils(path, prefix, common, details):
    323347        "Check for binutils toolchain"
     
    576600                cc_autogen = None
    577601
     602                # We always need to check for GCC as we
     603                # need libgcc
     604                check_gcc(path, prefix, common, PACKAGE_CROSS)
     605
    578606                # Compiler
    579607                if (config['COMPILER'] == "gcc_cross"):
    580                         check_gcc(path, prefix, common, PACKAGE_CROSS)
    581608                        check_binutils(path, prefix, common, PACKAGE_CROSS)
    582609
     
    601628                        if (config['INTEGRATED_AS'] == "no"):
    602629                                common['CC'] += " -no-integrated-as"
     630
     631                # Find full path to libgcc
     632                check_libgcc(common)
    603633
    604634                # Platform-specific utilities
Note: See TracChangeset for help on using the changeset viewer.