single binary with c++11 for deb6,7,8

Need help with C, C++, perl, python, etc?

single binary with c++11 for deb6,7,8

Postby ashish_behl » 2015-06-05 11:05

Hello all,
I know this is the most common question and has been asked many times, but I have not been able to agree with any answer that I have read till now.

The problem that I face is that I want to
1. Use latest c++ features
2. Deliver a single binary to the customer for all supported Debian versions (6, 7, 8 ).
I can only think of compiling the latest gcc/c++ on Debian 6, link libstdc++ and libgcc statically and test across the systems.
But this approach fails if the binary compiled also loads some dynamic libraries at runtime.

Can you all please guide me to an appropriate solution to handle this situation? (Compile once, run everywhere, with latest c++)

Ashish
ashish_behl
 
Posts: 2
Joined: 2015-06-05 10:57

Re: single binary with c++11 for deb6,7,8

Postby マーズ maazu » 2015-06-06 12:40

You did not specify which architecture, like 32-bit or 64-bit arch. Also note the ABI changes from c++03 to c++11 will mean it is impossible to distribute a single binary for deb6-8.
マーズ maazu
 
Posts: 23
Joined: 2015-05-04 05:13
Location: kuala lumpur

Re: single binary with c++11 for deb6,7,8

Postby ashish_behl » 2015-06-08 06:56

Thanks a lot for your answer.

Its for both 32, 64 bit architectures, but I plan to have seperate binaries for both architectures anyway.
Is it not possible to compile a new GCC version on the deb6 (e.g. gcc-4.9.2) and then, compile my code with this new gcc, link with static libstdc++ and libgcc? Would it be a problem with static linking approach, if I also have some libraries that are loaded at run time by my binary?

Regards,
Ashish
ashish_behl
 
Posts: 2
Joined: 2015-06-05 10:57

Re: single binary with c++11 for deb6,7,8

Postby マーズ maazu » 2015-06-08 09:03

ashish_behl wrote:Thanks a lot for your answer.

Its for both 32, 64 bit architectures, but I plan to have seperate binaries for both architectures anyway.
Is it not possible to compile a new GCC version on the deb6 (e.g. gcc-4.9.2) and then, compile my code with this new gcc, link with static libstdc++ and libgcc? Would it be a problem with static linking approach, if I also have some libraries that are loaded at run time by my binary?

Regards,
Ashish


Slightly off topic here, the reason why Fedora 22 is kinda chaotic right now is because of the transition from gcc-4.9.x to gcc-5.1.x which involves a new (A)bstract (B)inary (I)nterface. Lot's of breakages. People confused and migrating to other distributions.

Just checked https://gcc.gnu.org/onlinedocs/libstdc+ ... l/abi.html, (A) stands for Application.
マーズ maazu
 
Posts: 23
Joined: 2015-05-04 05:13
Location: kuala lumpur


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable