* * *

Author Topic: Error when compile under Linux for SPARC: /usr/bin/ld: skipping incompatible .o  (Read 357 times)

IgorM

  • New member
  • *
  • Posts: 5
Hi!

When I compile my program on Linux for SPARC, I've got error:
[root@host1 fpc]# fpc hello.pas
Free Pascal Compiler version 3.0.2 [2017/05/07] for sparc
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for SPARC
Compiling hello.pas
Assembling hello
Linking hello
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld: skipping incompatible hello.o when searching for hello.o
/usr/bin/ld: skipping incompatible ./hello.o when searching for hello.o
/usr/bin/ld: cannot find hello.o
hello.pas(5,40) Error: Error while linking
hello.pas(5,40) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcsparc returned an error exitcode
[root@host1 fpc]#


Could you please advise - what is wrong?

Thanx!

Best Regards
Igor Melnikov

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5574
The format of .o that the compiler generates and that the linker wants don't match.

Wrong linker or compiler or wrong linker/compiler target.

Some linkers can accept multiple kinds of .o, but need parameters to switch (usually -m., which can be passed via the compiler using -k)

IgorM

  • New member
  • *
  • Posts: 5
Hi Marcov!

Thanx!
Object-file , generated by fpc is " ELF 64-bit":
[root@host1 fpc]# file hello.o
hello.o: ELF 64-bit MSB relocatable, SPARC V9, relaxed memory ordering, version 1 (SYSV), not stripped


When I sent to linker this target (elf64-sparc), the same error occur.
What target expect linker? - How verify full linker parameters generated by fpc ?
[root@host1 fpc]# fpc hello.pas -k-belf64-sparc
Free Pascal Compiler version 3.0.2 [2017/05/07] for sparc
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for SPARC
Compiling hello.pas
Assembling hello
Linking hello
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld: skipping incompatible hello.o when searching for hello.o
/usr/bin/ld: skipping incompatible ./hello.o when searching for hello.o
/usr/bin/ld: cannot find hello.o
hello.pas(5,40) Error: Error while linking
hello.pas(5,40) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcsparc returned an error exitcode


Thank you!

Best Regards
Igor Melnikov


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus