"skipping incompatible ... when searching for -lgcc"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have compiled gcc 9.2.0 for x86_64 and armhf and installed it into
custom directory (later referred to as ver1). After that I have build
.deb files for each of them (later referred to as as ver2).

My problem *was* that ver1 successfully compiled simple hello world
program, whereas ver2 did not. It displayed the following error:

/opt/ZS/deps/lib/gcc/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld:
skipping incompatible
/opt/ZS/deps/lib/gcc/arm-linux-gnueabihf/9/libgcc.a when searching for
-lgcc
/opt/ZS/deps/lib/gcc/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld:
cannot find -lgcc
/opt/ZS/deps/lib/gcc/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld:
skipping incompatible
/opt/ZS/deps/lib/gcc/arm-linux-gnueabihf/9/libgcc.a when searching for
-lgcc
/opt/ZS/deps/lib/gcc/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld:
cannot find -lgcc

What I found out was that almost all files in aforementioned libgcc.a
archive were identical, except for _thumb1_case_sqi.o (single file, I
even checked with sha256sum that it was the only file that differed).

I later discovered that this error was caused by debuild command,
which was unable to properly strip objects in archive. There were some
errors regarding strip's inability to strip them since command used
was meant for x86_64 (or amd64 as it is called on Debian) and objects
were for armhf. In the end it seems that it was enough to instruct
debuild not to strip the following archives: libgcc.a, libgcc_eh.a and
libgcov.a. After I did it I were able to install everything, compile
few sample programs and later on quite a few larger projects without
any problems.

But in the end my question is:

How does gcc decides that file is not compatible? If strip was unable
to strip most object files, why was this single file stripped? It also
seems that only data stripped was original build directory and
additional stuff that causes build to be nondeterministic. Other
answer could be that archive format itself contains data that was
removed and this caused archive to be incompatible, not single object
in it. In the end I simply want to know what makes archive
"compatible" (i.e. usable) for the compiler.

Or maybe this question should be asked on binutils group?

Thanks in advance,
--
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux