[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is it a good idea to link my program to statically compiled libc?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 24
Thread images: 7

File: glibc.png (22KB, 452x245px) Image search: [Google]
glibc.png
22KB, 452x245px
I would like to distribute my program knowing full well what it links to (no shared libraries), so I wouldn't get any head-aches later on. I successfully did it for SDL2, GL3W and Nuklear, but I'm not so sure what to do with libc. What do you think? Would there be any disadvantages
when linking libc statically? The advantage would be clear and obvious: my program would be 100% self-contained.
>>
>>60481120
The only reason DLLs still exist is to work around licenses.
>>
File: 1455371549184.jpg (158KB, 1280x1280px) Image search: [Google]
1455371549184.jpg
158KB, 1280x1280px
>>60481120
>not musl
disgusting
>>
>>60481146
But glibc exists under LGPL which allows linking to them. So I suppose you think that statically linking to glibc is a good idea?

Also, I think there are other reasons that do not interest me:
> free updates without breaking the ABI (security, bug fixes, optimizations)
> smaller binary distribution size
>>60481171
Does it work on Mac and Windows? How hard would it be to port to iOS and Android?
>>
>>60481171
What do you think about this?

http://midipix.org
>>
>>60481196
forget about it, it's GPL
>>
File: 1456170631711.jpg (138KB, 720x720px) Image search: [Google]
1456170631711.jpg
138KB, 720x720px
>>60481196
>implying i know shit
Looks really good.
It's always good when it's easier to write for multi-platform
>>
File: 1494180645346.png (430KB, 680x680px) Image search: [Google]
1494180645346.png
430KB, 680x680px
>>60481227
That's a good thing, right?
>>
>>60481243
My program is closed-source commercial proprietary software.
>>
File: 1492224325484.jpg (78KB, 637x613px) Image search: [Google]
1492224325484.jpg
78KB, 637x613px
>>60481254
No one will never know...
>>
>>60481271
Fuck, I might risk it.
>>
File: 1461348951235.jpg (69KB, 520x678px) Image search: [Google]
1461348951235.jpg
69KB, 520x678px
>>60481283
>>
>>60481283
>only people who would care are freetards
>freetards don't run proprietary software
>>
File: 1471056793551.jpg (19KB, 300x219px) Image search: [Google]
1471056793551.jpg
19KB, 300x219px
>>60481283
Stallman will personally break into your home and rape you.
>>
>>60481120
musl libc
>>
>>60481283
dynamically linking libc.so is nearly required by all features taking indirectly advantage of libdl.so or of ld.so -i.e. using dynamic linking-, in particular the NSS related functions (like getpwent and getaddrinfo and many others (nsswitch.conf & nss).

Plus, dynamically linking libc is much more efficient because the RAM is nearly shared by all processes using libc.so and the executable size is smaller; and most importantly, upgrading libc.so is easier.

So don't be a faggot and steal stallman's baby.
>>
>>60481146
>Interchangeable components
>Can be independently updated
>Reduces redundant copies of code (at least on Linux systems)
>Runtime linking
>Easier/faster development
No, that's not the only reason.
>>
>>60481283
Stallman runs all proprietary software in a virtual machine under Windows and runs them through a disassembler. He's memorized all the ASM for every GPL program and library. If he even sees any semblance of similar syscalls, he will shut your ass down with a C&D, forcing you to GPL your program.
>>
>>60481842
>Interchangeable components that shouldn't be interchanged because it leads to defects and vulnerabilities
>Can be independently updated, but shouldn't for reason #1
>Reduces redundant copies of code (at least on Linux systems) but blows up net size, since each program comes with a different or even modified version and the compiler can't remove unused stuff
>Runtime linking/Easier/faster development but the mechanisms are that fragile, compiler dependent and shitty that most software goes back to scripting extensions and ipc mechanisms
>>
>>60481120

You can't link glibc statically for a variety of reasons which include how it was architectured. You will have a ton of headaches if you try to use glibc.

Use musl instead. Has a more friendly license for what you want to do.
>>
>>60481120
Link statically.
>>
>>60481120
You can just distribute it along the binary and have a start script which tells it to use the copy in the current directory and not the system.
>>
>>60481842
>Interchangeable components

From: Rob Pike <[email protected]>
Subject: mmap and shared libraries
Date: Wed, 5 Nov 2008 17:23:54 -0800

When Sun reported on their first implementation of shared libraries,
the paper they presented (I think it was at Usenix) concluded that
shared libraries made things bigger and slower, that they were a net
loss, and in fact that they didn't save much disk space either. The
test case was Xlib, the benefit negative. But the customer expects us
to do them so we'll ship it.

So yes, every major operating system implements them but that does not
mean they are a good idea. Plan 9 was designed to ignore at least
some of the received wisdom.
>>
>>60483952
When Jerry is right, he is right.
Thread posts: 24
Thread images: 7


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.