Side-by-side Configuration on Linux/ELF

One of the best/worst Microsoft software innovations (great for compatibility; terrible for efficiency) has been Windows’ Side by Side Configuration. This allows, among other things, for different components of a program to have multiple versions of the C/C++ runtime libraries loaded into the same process.

This has always impressed me because of the excellent backwards compatibility that it affords. For example, you can run an ancient program that links against very old C/C++ runtimes, and link it against or dynamically inject a new DLL that depends on a new C/C++ runtime, and all the separate instances of the runtimes will coexist simultaneously within the address space and will be called by the assembly that references them.

On Linux, however, binaries for which the source is not available tend to “rot” over time — rather quickly. The reason is that most interesting programs eventually have to link back into libraries that are installed in your system directories (/usr/lib, etc). But since the C/C++ runtimes and the system libraries frequently change ABI, your program just stops working when you upgrade your distro.

This can also be caused, for example, by software with “backends” that eventually link to your system libraries. An example is OpenGL, which due to the variety and volatility of the implementations, cannot be provided by binary distributions. They simply must depend on the system’s OpenGL implementation.

But if your system OpenGL links against libstdc++, you could potentially be dead in the water. What happens is that the old executable loads its local copy of libstdc++, and the OpenGL shared library loads the system’s copy of libstdc++. The two conflict, and one of them refuses to load, and usually this means that OpenGL refuses to work and the program comes crashing down.

For a “mere” application developer, is something like WinSxS achievable on Linux without major architectural changes to the ELF binary format and Linux kernel ABI? Or is this something that would have to be built into the system libraries at compile-time and deployed over a long period of time by making changes to ELF, glibc, libstdc++, compilers, and so on?

This may be foreign to Windows developers, but the solution is to provide the source, and recompile when the ABI changes. You don’t even need to provide all the source, just compile a wrapper on the interfaces that are likely to change, and link it with a binary holding the proprietary stuff. Think of it as creating your own stable ABI. Nvidia has been successfully following this model forever. There are tools like DKMS that help make the recompilation process essentially invisible to the user.

If your product is popular enough, the community will even help you maintain the wrapper when the API changes. For example, I ran community patches for Nvidia’s driver before their official updates for kernel 2.6 were released.

Admittedly not as easy as just having your own library files for everything, but then again, for most applications it is as simple as that. The wrapper solution is only necessary for a subset of software that’s fairly low level.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật