install gcc-3.4.6 in slackware-current
hi everbody..
i'm currently on slackware-current (thanks to eric's mirror-slackware-current script ;)).. anyways, i need to compile qemu & kqemu, which doesn't work with the current gcc (4.x). my question is - will there be any problems (existing file overwritten, etc) if i do installpkg gcc-3.x from pasture? will the existing toolchain still be in 'one piece'? i plan to removepkg once i'm done with compiling those two packages :) thanks. |
If those are the only two you need, why can't you just sort out the errors ? Maybe post them ... they are usually trivial ... I mean easy to fix. I know I used gcc-4.x for a while (on FC5), and I had to sort out a lot of problems ... but I sorted out every one :D ... of course, a little experience with C and C++ helps :), but usually the compiler just tells you what to fix and how to fix it (believe it or not).
|
It shouldn't be a problem, since gcc is designed to allow several versions to coexist. If you installed gcc-4.1.2 over your old gcc, as I did, you can just: "cd /usr/bin; ln -sf gcc-3.4.6 gcc".
|
If you only need the qemu and kqemu packages you can install them from Alien's repository.
|
Quote:
I was actually worried about breaking the original toolchain if I install (and later remove) gcc-3.4.6 ... I guess I can just reinstall 4.1.2 if that happens.. :cry: |
Installing the regular Slackware package for older gcc *will* overwrite somw newer files. This is because Slackware is meant to use just one compiler and installs binaries in /usr.
However, you can re-compile gcc-3.4 using a separate prefix and then create a wrapper for it to put in /usr/bin. |
Quote:
|
Quote:
|
I use several alternative compilers, usually placing them in /opt, but usr/gcc-3.4.6 would be just as safe.
Here's the wrapper I use to run gcc-3.3.6: #!/bin/sh PATH=/opt/gcc-3.3.6/bin:$PATH export PATH=/opt/gcc-3.3.6/lib/gcc-lib/i486-slackware-linux/3.3.6:$PATH # export LD_LIBRARY_PATH=/opt/gcc-3.3.6/lib exec "$@" I name this script GCC336 and place it in /usr/bin. Then to use it instead of the regular compiler just type: GCC336 make |
Quote:
|
Too many files to name. Bad idea installing both side by side unless you use a different prefix for one of them. Installing 3.4.6 from pasture would effectively destroy your gcc-4 install.
I use 4.2 in /usr and 3.4.6 in /opt. Gnashley has the right of it with making a wrapper script. However, you wouldn't want to append to your PATH on a global basis (such as in /etc/profile.d or /etc/profile) because it'll look in the first PATH directory you specify and use that. So if I put Gnashley's script in /etc/profile.d and just compiled something with "make", it'll use 3.4.6.... What I do is similar to a wrapper script. I make an alias in /etc/bashrc.. Code:
alias gcc346='CC=/opt/gcc-3.4.6/bin/gcc' Or, if I'm calling a build script, "gcc346 foobar.SlackBuild" Also, appending to your library PATH is unecessary because each seperate instance of gcc knows where to find it's own libs, which is why that bit is commented out in Gnashley's script. Here is a build script if anyone is interested.. I like to make monolithic gcc packages instead of busting it up. Code:
#!/bin/sh |
Alternatively you can install my gcc34 "compatibility" package from here: http://www.slackware.com/~alien/slackbuilds/gcc34/
It installs happily alongside the gcc4 that ships with Slackware-current, and it will not overwrite a thing. The compile of QEMU will pick up this gcc34 and build a good package. All the other software keeps compiling with the standard gcc4. I have had several people reporting success in using this gcc34 package. Read the SlackBuild for more information on how you can call the gcc34 binary if you need it. Eric |
Quote:
|
I just install the wrapper into /usr/bin for simplicity -it allows me to distribute a safely installable package that doesn't require you to edit/create any config files, such as .bashrc, etc.
I include the LD_LIBRARY_PATH, but commented out, in case a user needs it. I've found a few situations where it was needed, such as when compiling with gcc-2.95.3(for programs that link to the gcclib) or mingW32 or other cross-compiler. |
One more thing, have you tried the cvs snapshots of qemu ... maybe they got it working with the newer gcc ... they should have after all this time it has been out.
|
All times are GMT -5. The time now is 03:48 PM. |