ld linker question: the –whole-archive option

There are legitimate uses of –whole-archive when linking executable with static libraries. One example is building C++ code, where global instances “register” themselves in their constructors (warning: untested code): handlers.h typedef void (*handler)(const char *data); void register_handler(const char *protocol, handler h); handler get_handler(const char *protocol); handlers.cc (part of libhandlers.a) typedef map<const char*, handler> HandlerMap; HandlerMap … Read more

Why does GCC create a shared object instead of an executable binary according to file?

What am I doing wrong? Nothing. It sounds like your GCC is configured to build -pie binaries by default. These binaries really are shared libraries (of type ET_DYN), except they run just like a normal executable would. So your should just run your binary, and (if it works) not worry about it. Or you could … Read more

File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass?

If you want to remove the support for any architecture, for example, ARMv7-s in your case, use menu Project -> Build Settings -> remove the architecture from “valid architectures”. You can use this as a temporary solution until the library has been updated. You have to remove the architecture from your main project, not from … Read more