Error when compile under Linux for SPARC: /usr/bin/ld: skipping incompatible .o lazarus / 66-Unix ---------------------------------------------------------------------- IgorM · 2017-06-13 11:53 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 · 2017-06-13 12:01 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 · 2017-06-13 13:01 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 ---------------------------------------------------------------------- MarkMLl · 2022-06-15 13:22 This thread died of natural causes, but since it's the one turned up by search engines I thought it worth tacking a comment onto it. However since SPARC as a target seems to have very little life left in it this is more in the spirit of wrapping up loose ends than anything else. I commented incorrectly to this that I thought I'd seen this on a SPARC (i.e. 32-bit) platform, and was suspicious that it was something to do with an attempt to move a compiler built on Debian 8 or 9 ("Lenny" or "Stretch", circa 2015 or 2017 respectively) to Debian 10 ("Buster", 2019) possibly the result of an incompatible linker version. However I later realised that the Debian 10 system was, in fact, SPARC64 and that my problems stemmed at least in part from trying to run a 32-bit compiler on it. I've not explored to what extent this can be worked around with Debian's multiarch libraries, since the tenuous nature of Debian's support for the SPARC64 port introduces far too many potential points of failure for comfort. Hence I think the first thing to suspect when seeing this sort of issue from a trivial program Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 0 1>markMLl@sunfire:~$ fpc test.pasFree Pascal Compiler version 3.0.4 [2017/11/10] for sparcCopyright (c) 1993-2017 by Florian Klaempfl and othersTarget OS: Linux for SPARCCompiling test.pasAssembling testLinking test/usr/bin/ld: warning: link.res contains output sections; did you forget -T?/usr/bin/ld: skipping incompatible test.o when searching for test.o/usr/bin/ld: skipping incompatible ./test.o when searching for test.o/usr/bin/ld: cannot find test.otest.pas(6) Error: Error while linkingtest.pas(6) Fatal: There were 1 errors compiling module, stoppingFatal: Compilation abortedError: /usr/local/bin/ppcsparc returned an error exitcode  is a mismatch between a 64-bit OS and a version of FPC generating 32-bit code, i.e. as repeatedly experienced by people on the x86 and x86_64 platforms. Having said which, 32-bit SPARC FPC 3.2.2 installed from Sourceforge appears to work with Debian 10 SPARC to an extent that it compiles simple programs to a runnable state. It is not, however, able to build anything complex like the Lazarus IDE. MarkMLl