0

I have a simple C "Hello world" program, compiled using GCC toolchain for mips74-kc running a Linux S/O (kernel 3.10.36)

#include <stdio.h>

int main() {
    printf("Hello world\n");
    return 0;
}

The program is compiled on a x64-86 Ubuntu machine, as I don't have GCC available on the MIPS machine. I compile the program with the static linking flag.

mips-linux-gnu-gcc --verbose -static -march=74kc main.c -o main

When I launch the program on the MIPS processor, the program holds and never returns, consuming 100 % of the CPU.

Does anyone have a clue on why this could happen?

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Jamaslab
  • 61
  • 6
  • Its not exactly a duplicate, but look at this question and in particular the first answer... https://stackoverflow.com/questions/4175450/is-there-a-way-to-use-gcc-to-convert-c-to-mips – tom Mar 24 '18 at 10:42
  • @tom : That is not what he is saying. he is running a cross-compiler on Ubuntu on an x86 development host. He does not have a native compiler running on the embedded target - this is normal - to use cross-development for embedded targets. – Clifford Mar 24 '18 at 14:35
  • All you need is to have GDBServer running on the embedded target, then you can debug remotely running GDB from the development host. I would not go much further with embedded Linux development until you have an debugging solution - then you can answer your own question. – Clifford Mar 24 '18 at 14:38
  • @Clifford - oh,,, ok, then yes I was pretty naive about it --- thanks for the correction - that comment is deleted, but is the other one relevant with the link? – tom Mar 24 '18 at 14:41
  • I cannot install gdbserver on the embedded target as it is not connected to internet. Are there already compiled gdbserver? I would compile it myself but I would probably compile it wrong. – Jamaslab Mar 24 '18 at 16:36

0 Answers0