Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
ashish_behl
Posts: 2
Joined: 2015-06-05 10:57

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

#1 Post by ashish_behl »

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

マーズ maazu
Posts: 23
Joined: 2015-05-04 05:13
Location: kuala lumpur

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

#2 Post by マーズ maazu »

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.

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

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

#3 Post by ashish_behl »

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

マーズ maazu
Posts: 23
Joined: 2015-05-04 05:13
Location: kuala lumpur

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

#4 Post by マーズ maazu »

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.

Post Reply