File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,29 @@ find_program(CMAKE_READELF ${CROSS_COMPILE}readelf PATH ${TOOLCHAIN_HOME} NO_
1414find_program (CMAKE_GDB ${CROSS_COMPILE} gdb PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
1515find_program (CMAKE_NM ${CROSS_COMPILE} nm PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
1616
17+ # x86_64 should pick up a proper cross compiler if one is provided,
18+ # but falling back to using the host toolchain is a very sane behavior
19+ # too.
20+ if (CONFIG_X86_64)
21+ if (CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND )
22+ find_program (CMAKE_C_COMPILER gcc )
23+ find_program (CMAKE_OBJCOPY objcopy)
24+ find_program (CMAKE_OBJDUMP objdump)
25+ find_program (CMAKE_AR ar )
26+ find_program (CMAKE_RANLILB ranlib )
27+ find_program (CMAKE_READELF readelf)
28+ find_program (CMAKE_GDB gdb )
29+ endif ()
30+
31+ # When building in x32 mode with a host compiler, there is no libgcc
32+ # shipped (because it's an x86_64 compiler, not x32). That's
33+ # actually non-fatal, as no known features we hit in existing code
34+ # actually require the library. But I can't find an exaustive list
35+ # of exactly what can break, so this is fragile. Long term we
36+ # really need to be blessing a proper cross toolchain.
37+ set (no_libgcc Y)
38+ endif ()
39+
1740if (CONFIG_CPLUSPLUS)
1841 set (cplusplus_compiler ${CROSS_COMPILE} ${C++})
1942else ()
You can’t perform that action at this time.
0 commit comments