This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Creating GCC/libstdc++ toolchain to create most compatible binaries


Dear GCC gurus,
I have the following question: In my day to day job, we produce
scientific software that is frequently used by others. Our programs
are usually written in C++ and more often that not involve stuff like
boost and such. One problem we commonly face with users of our
software (which is always free software) is the involved build
process, which can be somewhat daunting (boost.m4 and all its
intricacies, anyone?) and most of our users are not versed in the way
of deep ./configure hacking and mucking around with all sorts of
CFLAGS and LDFLAGS and what have you not. Hence our desire to provide
binaries that are most compatible for linux systems out there. To
achieve this, I ideally have the following build setup in mind:

- Use an ancient x86_64 glibc setup, something like glibc 2.3 should do the job
- Use the most ancient libstdc++ still yielding a libstdc++.so.6 (i.e.
libstdc++ from GCC 3.4.0)
- Use the most advanced GCC which is 4.9.0 currently (without its
included libstdc++), to gain the most out of modern optimization
techniques
- Use the latest libraries (gmp, boost etc) and link these into the
final binary statically

Is this practically possible? I've tried using a CentOS 4.9 based
system and started bootstrapping the toolchain but GCC 4.9 fails with
--disable-libstdc++-v3 in the last step of comparing the stage2 and
stage3 object files. Let me say pre-emptively here: I know the tricks
with -Wl,-rpath,$ORIGIN and schlepping along GCC's provided
libstdc++.so. In such a case, I might as well just -static-libstdc++.
I'm really trying to create a binary that does not require any
dragging along or statically linking to libstdc++.

Are these ideas too far-fetched? Is libstdc++ too intertwined with GCC
to rip it out from a different version and mix them (the code in
question is C++98, so I guess the libstdc++ from GCC 3.4.0 should
suffice)?

I'm grateful any insights on how to produce the most universally
compatible binaries for end users

Regards
Jonas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]