May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 08/05/2011 12:59, Nick Sabalausky wrote:
> "Nick Sabalausky"<a@a.a> wrote in message
> news:iq2g72$ngp$1@digitalmars.com...
>>
>> Aggghhhh!!! God damnnit, I officially fucking hate linux now... (not that
>> I'm a win, mac or bsd fan, but whatever...)
>>
>> I temporarily gave up trying to actually get ahold of an old distro, so I
>> tried the other angles (not counting just simply *wishing* it was like win
>> and I could just copy the damn binary over to another linux box...nooo,
>> that would be too simple for a unix-style system):
>>
>> I got my web host to switch me to a server that has 32-bit libs installed
>> (a pain in and of itself because I had to coordinate with a client to find
>> a convenient downtime, and then I ended up needing to change my domain's
>> DNS entires, so now my whole domain's down for a couple days)...And it
>> make no difference. So I guess in my particular case it wasn't a
>> 32-bit/64-bit issue at all (or maybe there still would have been that
>> problem too, I dunno).
>>
>> So I went to try uClibc:
>>
>> I started my Linux box...and it decides to hang mid-startup. So I reboot
>> and at least this time the dumb thing finishes booting (I had problems
>> with linux randomly breaking for no apperent reason ten years ago with
>> Mandrake and Red Hat. I can't believe it's still happening now).
>>
>> Anyway, at the uClibc site, I saw the "simple steps" here:
>> http://uclibc.org/toolchains.html and thought "Uhh, hell no, not if I
>> don't have to" and went to the link for the pre-built verison instead. The
>> link was broken. Then the page says those are really old versions anyway.
>> Great :/
>>
>> So I go through the steps: I get to the part where I download buildroot.
>> Copy/paste the link over to my linux box...and discover that Synergy+ has
>> suddenly decided it no longer feels like offering the "shared clipboard"
>> feature that always worked before.
>>
>> Ok, so I type the URL into my linux box manually, download buildroot,
>> unpack it...so far so good...and follow the instruction to run "make
>> menuconfig"...BARF. It fails with some error about ncurses being missing,
>> and that I should get ncurses-devel. "sudo apt-get install ncurses-devel":
>> Can't find package. "sudo apt-get install ncurses": Can't find package.
>> "sudo apt-get install fuck-shit-cock": Can't find package.
>>
>> Google "ncurses deb package". Actually found it. Download. Run...You ready
>> for this? Here's the message: "Error: A later version is already
>> installed." SERIOUSLY?!
>>
>> This is the point where I would normally say "fuck this shit", but the
>> thought of continuing to use PHP (even if it is via Haxe) is enough to
>> keep me bashing my head against this wall. Next stop: See if I can get
>> ahold of *some* version of CentOS and see if using that in a VM will
>> manage to work. (And rip Kubuntu off my Linux box and see if I can replace
>> it with Debian+XFCE. How is it possible that GNOME and KDE were both
>> fairly ok ten years ago, at least as far as I can remember, but the latest
>> versions of both are complete shit? And then there's that iOS garbage that
>> Ubuntu is moving to now (The one main thing I've always disliked about
>> Ubuntu is their incompresensible Apple-envy, which only seems to be
>> increasing). And fuck, the latest KDE actually makes the Win7 UI seem good
>> (at least the Win7 UI actually *works* and has some semblance of
>> consistency, even as obnoxious as it is), and I could have sworn that KDE
>> never used to be so completely broken before. Or broken at all, for that
>> matter. Which is too bad, because Dolphin actually shows some promise...at
>> least when it isn't doing the
>> random-horizontal-scrolling-for-no-apparent-reason dance.)
>>
>
> Yay! I've just had some success! I managed to find this:
>
> http://vault.centos.org/
>
> Which has all the CentOS ISOs. (You'd think I would have had an easier time
> finding that URL...)
>
> I downloaded 4.2 (picked pretty much at random), installed it in VirtualBox,
> compiled a trivial test C program in the included GCC, uploaded that to the
> server, and it worked! :)
>
> Next step: Install DMD on this CentOS VM and try for a D cgi...
>
> And then later, I may try 4.7, see if that'll work for me too. And I still
> have another web host I need to get CGI working on (although that one has
> some pretty bad support, so I'm a little nervous about that). But it's
> looking good so far. Finegrs crossed...
>
> I'd be nice to not have to use a VM to compile, of course. But as long as I
> can I have some way to do my server-side web stuff in D, and *completely*
> sidestep the entire PHP runtime, then it'll certainly still be well worth
> it.
>
>
It should work,but again is depends what your target platform is. It's quite important that - Even on windows. At the company I am now contracting for we compile the software agents using visual studio 2003 because later versions do not let the agent work with windows 98. This is not just a Linux phenomenon.
Centos 4 is fairly new, and it's possible that your hosting providers use older, even unsupported versions of distributions. Centos 3 might have been a wiser bet. In any case centos 4.7 is a point release of 4.0 and as such there should be no breaking libc changes.
|
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 2011-04-29 22:02, Nick Sabalausky wrote: > I'm having a rediculously hard time trying to find a CentOS 3 installation > disc image (or any other version before 5.6). This is the closest I've been > able to find: Have a look at this: http://vault.centos.org/ -- /Jacob Carlborg |
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 2011-05-08 19:50, Jacob Carlborg wrote: > On 2011-04-29 22:02, Nick Sabalausky wrote: >> I'm having a rediculously hard time trying to find a CentOS 3 >> installation >> disc image (or any other version before 5.6). This is the closest I've >> been >> able to find: > > Have a look at this: http://vault.centos.org/ I see now that you've already found this link, never mind. -- /Jacob Carlborg |
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | Nick Sabalausky wrote:
> Actually, I did have to remove the HTTP status code output from my little hello world cgi test in forder for Apache to not throw up a 500.
HTTP status is normally done with a Status: header in cgi. (Actually writing the line works too but only with certain settings.)
writefln("Status: 200 OK"); // note: optional; 200 OK is assumed
writefln("Content-Type: text/plain");
writefln(); // blank line ends headers
writefln("Hello, world!");
---
I just saw this thread, but when I do my cgi apps, I actually
recompile them right on the live server. If that's an option
for you, it's a bit of a pain to set up, but it's less painful
than dealing with Linux's generally retarded library/bits situation.
|
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | "Adam D. Ruppe" <destructionator@gmail.com> wrote in message news:iq6osh$25di$1@digitalmars.com... > Nick Sabalausky wrote: >> Actually, I did have to remove the HTTP status code output from my little hello world cgi test in forder for Apache to not throw up a 500. > > HTTP status is normally done with a Status: header in cgi. (Actually writing the line works too but only with certain settings.) > > writefln("Status: 200 OK"); // note: optional; 200 OK is assumed > writefln("Content-Type: text/plain"); > writefln(); // blank line ends headers > writefln("Hello, world!"); > Ahh, sweet. Didn't know about that "Status:" thing. Or maybe I did and forgot... ;) BTW, another thing I just learned (posting here in case anyone reads this and has similar problems) is that on some servers, like mine, the permissions on the executable have to be set to *not* be writable by group or world, or Apache will just throw a 500. Apperently there's a whole list of conditions that have to be met here: http://httpd.apache.org/docs/current/suexec.html When I first compiled the app on my local CentOS VM, gcc set the binary's permissions to 775, which were preserved by ftp, and then I could run it on the server through ssh, but not through Apache/HTTP. Changing them to 755 fixed it. > I just saw this thread, but when I do my cgi apps, I actually > recompile them right on the live server. If that's an option > for you, it's a bit of a pain to set up, but it's less painful > than dealing with Linux's generally retarded library/bits situation. Yea, that would definitely a better way to go. Unfortunately I normally have to deal with shared hosts, so the stuff I can actually do on the server is usually very limited. On this particular server, I know I can't run gcc. (At least not the system's gcc anyway. Maybe there's some way to have a portable install of gcc? But knowing gcc, if there is a way, I'm sure it would be a royal pain.) DMD *is* a portable install, which is nice, but on linux it still needs gcc to link. And then on the other server I need to use, I don't think ssh is even available. |
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Spacen Jasset | "Spacen Jasset" <spacenjasset@yahoo.co.uk> wrote in message news:iq69q1$1ack$1@digitalmars.com... > > It should work,but again is depends what your target platform is. It's quite important that - Even on windows. At the company I am now contracting for we compile the software agents using visual studio 2003 because later versions do not let the agent work with windows 98. This is not just a Linux phenomenon. > But at least you can still compile *on* XP+ and get the result to work on 98. And fairly easily (ie: Just use VS 2003). That sort of thing *might* be true on Linux as well, but it seems to be either difficult or really obscure. For instance, no one here seems to know: http://ubuntuforums.org/showthread.php?t=1740277 Plus, there's the fact that Linux has not just different versions, but many different distros, too. And the distros apperently tend to be somewhat divergent in different things. (But again, it's not like I'm saying "Windows kicks Linux's ass" or anything like that.) > In any case centos 4.7 is a point release of 4.0 and as such there should be no breaking libc changes. > Ah! Thanks, that's good to know. In fact, I was specifically wondering about that, but I wasn't certain and didn't want to assume. |
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | "Jacob Carlborg" <doob@me.com> wrote in message news:iq6llk$20ch$1@digitalmars.com... > On 2011-05-08 19:50, Jacob Carlborg wrote: >> On 2011-04-29 22:02, Nick Sabalausky wrote: >>> I'm having a rediculously hard time trying to find a CentOS 3 >>> installation >>> disc image (or any other version before 5.6). This is the closest I've >>> been >>> able to find: >> >> Have a look at this: http://vault.centos.org/ > > I see now that you've already found this link, never mind. > Missed it by *that* much. ;) |
May 08, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 08/05/2011 20:42, Nick Sabalausky wrote:
> "Spacen Jasset"<spacenjasset@yahoo.co.uk> wrote in message
> news:iq69q1$1ack$1@digitalmars.com...
>>
>> It should work,but again is depends what your target platform is. It's
>> quite important that - Even on windows. At the company I am now
>> contracting for we compile the software agents using visual studio 2003
>> because later versions do not let the agent work with windows 98. This is
>> not just a Linux phenomenon.
>>
>
> But at least you can still compile *on* XP+ and get the result to work on
> 98. And fairly easily (ie: Just use VS 2003). That sort of thing *might* be
> true on Linux as well, but it seems to be either difficult or really
> obscure. For instance, no one here seems to know:
>
> http://ubuntuforums.org/showthread.php?t=1740277
>
> Plus, there's the fact that Linux has not just different versions, but many
> different distros, too. And the distros apperently tend to be somewhat
> divergent in different things.
>
> (But again, it's not like I'm saying "Windows kicks Linux's ass" or anything
> like that.)
>
>> In any case centos 4.7 is a point release of 4.0 and as such there should
>> be no breaking libc changes.
>>
>
> Ah! Thanks, that's good to know. In fact, I was specifically wondering about
> that, but I wasn't certain and didn't want to assume.
>
>
>
Yes, what you say it true. The most important thing usually is the glibc version. In terms of distributions, yes they all have different libraries installed, which can be a pain. For expat, we do infact statically link that, and boost, and zlib. - but you can ship dlls instead in that case, again of course, using some voodoo magic, RPATH linker setting.
It was the case back in the day, that to install something on unix systems, you would compile it, and in fact, sys admins would not install binaries...
If you get stuck again, or need assistance, then you can look me up on linkedin, facebook and send me a message. "Jason Spashett"
|
May 09, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Spacen Jasset | "Spacen Jasset" <spacenjasset@yahoo.co.uk> wrote in message news:iq69q1$1ack$1@digitalmars.com... > It should work,but again is depends what your target platform is. It's quite important that - Even on windows. At the company I am now contracting for we compile the software agents using visual studio 2003 because later versions do not let the agent work with windows 98. This is not just a Linux phenomenon. > > Centos 4 is fairly new, and it's possible that your hosting providers use older, even unsupported versions of distributions. Centos 3 might have been a wiser bet. In any case centos 4.7 is a point release of 4.0 and as such there should be no breaking libc changes. > I noticed the 4.7+ installers have an option for i586, but there seems to be a lot of conflicting info about whether the non-i586 install is i386 or i686. Any idea? I've heard that CentOS 5 is i686 despite claiming to be i386, but I can't find any concrete info about whether that's true of 4.x as well. |
May 09, 2011 Re: Linux: How to statically link against system libs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | "Nick Sabalausky" <a@a.a> wrote in message news:iq6159$q3q$1@digitalmars.com... > "Nick Sabalausky" <a@a.a> wrote in message news:iq60qt$pm0$1@digitalmars.com... >> >> I downloaded 4.2 (picked pretty much at random), installed it in VirtualBox, compiled a trivial test C program in the included GCC, uploaded that to the server, and it worked! :) >> > > Actually, I did have to remove the HTTP status code output from my little hello world cgi test in forder for Apache to not throw up a 500. That kind of surprised me, actually. But maybe it just means it's been far too long since I've done CGI... *shrug* > If anyone's curious, I did get a basic D cgi app to work, too (ie, Compiling on CentOS 4.2 in a VM and uploading to my shared host server), but I had to: 1. Recompile DMD (Because the precompiled DMD would immediately quit with a "Floating point exception" message, even if called with zero args). 2. Remove "-L--no-warn-search-mismatch" (Because otherwise, when it tried to link, the GCC in CentOS 4.2 would error out and complain that wasn't a valid switch.) As a little bonus, the C test app I compiled in the CentOS 4.2 VM also ran fine on my physical Kubuntu 10.04 box. Although the D one segfaulted. No big deal deal though, it's easy enough to compile on that box. The only problem I'm having now (aside from the fact that I haven't attempted to deal with the other shared host server yet - the debian one from the horrible ipower company), is that CentOS 4.2 (or maybe it's just KDE) runs so slow in a VM that it frequently doesn't recognize when I let go of a key and so then it goes off doing crazy shit. :/ Or it'll swap my key presses if I type too fast. At one point I had a hell of a time just getting it to let me type in "cd dmd" correctly. (I don't think it's entirely because of my computer though. XP runs just fine in a VM for me, even with only 192MB RAM allocated to it instead of the 512MB given to CentOS 4.2) So I'm going to try putting CentOS 4.9 in a VM and replacing KDE with XFCE. And I'll also have VirtualBox enable 3D accel and see if maybe then the "VirtualBox Guest Additions" package will be able to use OpenGL. |
Copyright © 1999-2021 by the D Language Foundation