• Vineet Gupta's avatar
    ARC: build: Better way to detect ISA compatible toolchain · 20d78037
    Vineet Gupta authored
    ARC architecture has 2 instruction sets: ARCompact/ARCv2.
    While same gcc supports compiling for either (using appropriate toggles),
    we can't use the same toolchain to build kernel because libgcc needs
    to be unique and the toolchian (uClibc based) is not multilibed.
    
    uClibc toolchain is convenient since it allows all userspace and
    kernel to be built with a single install for an ISA.
    
    This however means 2 gnu installs (with same triplet prefix) are needed
    for building for 2 ISA and need to be in PATH.
    As developers we keep switching the builds, but would occassionally fail
    to update the PATH leading to usage of wrong tools. And this would only
    show up at the end of kernel build when linking incompatible libgcc.
    
    So the initial solution was to have gcc define a special preprocessor macro
    DEFAULT_CPU_xxx which is unique for default toolchain configuration.
    Claudiu proposed using grep for an existing preprocessor macro which is
    again uniquely defined per ISA.
    
    Cc: Michal Marek <mmarek@suse.cz>
    Suggested-by: default avatarClaudiu Zissulescu <claziss@synopsys.com>
    Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
    20d78037
arcregs.h 9.44 KB