Closed stsp closed 3 years ago
Must say I've never tried stripping a static library, I think it's more convenient to do so after linking.
What I gather from a quick google search is that this is normal behaviour, and you need a flag such as -g
or -x
or --strip-unneeded
to make strip less aggressive and preserve the archive index.
Thanks! --strip-unneeded indeed does the trick. However, I am also getting this, both with and w/o any strip:
$ i586-pc-msdosdjgpp-ranlib libgcc.a
i586-pc-msdosdjgpp-ranlib: /usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so: wrong ELF class: ELFCLASS32
What can that be?
When you have any bfd plugins installed, binutils tools will try to use those first to read the input files. If the plugin can't read the file then it will use the built-in reader. I didn't know cross tools would use plugins from the global /usr/lib
directory though.
If it causes any issues you can set BINUTILS_CONFIGURE_OPTIONS=--disable-plugins
before running the build script. Maybe this flag should be set by default.
Thank you! Building now on COPR to see if it works. May I suppose this can also fix my problem with OBS build? Doesn't sound very likely...
Worth a try I guess, but that's likely an unrelated issue.
Ah, if this would be that simple... OBS is the most difficult build system I've ever seen. I need to write an xml build recipes, and they provide some "services" to integrate with git on github. But these services work quite poor, for example I don't know how to force the service to purge its cache and re-fetch from github... But I'll ask for the help elsewhere. runlib and strip problems are all solved, thank you!
Using i586-pc-msdosdjgpp-strip on a static lib, for example on /usr/lib/gcc/i586-pc-msdosdjgpp/9.2.0/libgcc.a results into this error upon linking later: