• Stephen Warren's avatar
    kbuild: fixdep: support concatenated dep files · 2ab8a996
    Stephen Warren authored
    The current use-case for fixdep is: a source file is run through a single
    processing step, which creates a single dependency file as a side-effect,
    which fixdep transforms into the file used by the kernel build process.
    
    In order to transparently run the C pre-processor on device-tree files,
    we wish to run both gcc -E and dtc on a source file in a single rule.
    This generates two dependency files, which must be transformed together
    into the file used by the kernel build process. This change modifies
    fixdep so it can process the concatenation of multiple separate input
    dependency files, and produce a correct unified output.
    
    The code changes have the slight benefit of transforming the loop in
    parse_dep_file() into more of a lexer/tokenizer, with the loop body being
    more of a parser. Previously, some of this logic was mixed together
    before the loop. I also added some comments, which I hope are useful.
    
    Benchmarking shows that on a cross-compiled ARM tegra_defconfig build,
    there is less than 0.5 seconds speed decrease with this change, on top
    of a build time of ~2m24s. This is probably within the noise.
    Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
    Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
    2ab8a996
fixdep.c 11.4 KB