Skip to content

Having trouble in building with cross-compiler #532

@jongwonjlee

Description

@jongwonjlee

Hi, I appreciate your hard work! I'm now trying to create BLIS static library for a target microcontroller (NXP MPC5748G, having 32bit PowerPC architecture on which code built by GCC is mounted) through the corresponding cross compiler with its specialized C standard library called EWL, but I'm in trouble while building the code.

Prerequisite:

  • having the corresponding GCC cross-compiler (powerpc-eabivle-gcc) for the target device on the host machine in the directory of `${HOME}/NXP/S32DS_Power_v2.1/S32DS/build_tools/powerpc-eabivle-4_9/bin/'
  • having the corresponding standard C libraries (EWL) for the target device on the host machine in the directory of `${HOME}/NXP/S32DS_Power_v2.1/S32DS/build_tools/e200_ewl2/'

What I tried was:

  • Go into config/generic/ and populate make_defs.mk with details / flags on the target cross compiler. (I attach the make_defs.mk file I used.)
  • Run command ./configure CC=${HOME}/NXP/S32DS_Power_v2.1/S32DS/build_tools/powerpc-eabivle-4_9/bin/powerpc-eabivle-gcc --disable-shared --disable-threading --disable-system --enable-verbose-make generic to genrate Makefile.
  • As make -j encounters "Cannot determine operating system" error, I go into include/generic/blis.h file, comment two blocks causing the error, and explicitly define #define BLIS_OS_GNU 1 (I attach the modified header file I used.)
  • Run make -j, but it shows warning statements pertaining to using fprintf. (I attach the build logs (containing standard statements and warnings separately) as well.)

Anyway, it ends up creating the static library file libblis.a. But when I try to link it with the BLIS tutorial code, it throws similar errors as mentioned above; this is not so surprising as the library file has been built 'incomplete'.

As the system root (where the standard C libraries are located) has been set properly to be ${HOME}/NXP/S32DS_Power_v2.1/S32DS/build_tools/e200_ewl2/' and stdio` is in there, I believe that it wouldn't cause such issues but it didn't. This problem has eaten up to much time and effort so far. It would be really appreciated if anyone knows a silver bullet to get around such an issue. Otherwise, it would be also great if somebody can suggest a possible direction I should take. Thanks in advance!

files mentioned above

files.zip

Checklist (with documentation of solutions):

  • Define appropriate OS macro.
    • Maybe BLIS_OS_NONE?
  • Select cross-compiler
    • Specify CC during configure.
  • system_root/flags for EWL
  • Platform-specific flags (in config directory)
  • Platform-specific flags (CFLAGS at configure time)
  • fprintf
    • Needs platform-specific macro (which one(s)?)
  • Linker problems

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions