Ask A Question
 
gromit
Fresh Boarder
Blog Posts: 0
Forum Posts: 8
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #1
hi,

i can't believe i'm the first person to try to do this, but i'm having a lot of trouble... I have an old pentium-mmx running as a little server, and a beefy athlon workstation, both on debian woody (mostly testing). I want to compile apache with php support on the athlon box, with the resulting package to be installed on the server.

I understand I have to build gcc as a cross compiler. Although I've waded through lots of documentation, it's not clear whether a straight debian source package install of gcc would let me do this. How would I specify options which would eventually get passed to 'configure' to build gcc???

I think I have three options once I have a cross compiler up and running: please can someone tell me which I should follow?

1) Use debian source packages. apt-get source for what I want to build, then somehow (how??) pass info to the dpkg builder to tell it the target architecture. Would this mean setting enivironment vars and/or hacking debian/rules? Anyhow, pentium-mmx is distinctly not an option, and even i586 as a host doesn't seem to appear anywhere...

2) Get the original source code for apache2, etc.. and use configure directly, setting the appropriate target architecture and host. Then fake a debian package to satisfy the dependencies on the server.

The third option is to make do with the i386 standard binaries which would save me loads of debian package upgrade niggles in the future, and a lot of time and tears now.

dpkg-cross does seem like the ticket, BUT how on earth do I get it to do pentium-mmx and i586? Also, if I want to use -O6, or anything other than -O2 which it seems to default to, how is this done?

Any help appreciated - my considerable man/faq/howto patience has run out...

Thanks, Jack
Answer
laju
Fresh Boarder
Blog Posts: 0
Forum Posts: 14
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #2
Sure it would, once you changed it completely.

Depends on the debian rules file. I would just straightout ask the maintainer. It's his build.

If you really want to do it the hard way, I'd .. no , I wouldn't even think about it. I'd ask the maintainer. Debugging his extract of the tar and so on will be just hard.
Answer
ejtaal
Fresh Boarder
Blog Posts: 0
Forum Posts: 13
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #3
No you don't. The Athlon and PentiumMMX are both Intel x86 architecture chips. Just use the standard installation of GCC if you wish to compile on the Athlon for the Pentium, making sure to set optimization flags appropriately. For example, use -mcpu=586 and/or -march=pentium.

You only need a cross-compiler if you're going across CPU
Answer
Arligoth
Fresh Boarder
Blog Posts: 0
Forum Posts: 7
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #4
Debian provides a 'toolchain-source' package specifically for the purpose of building cross-compilers (and suitable binutils packages, too). It comes with documentation and some scripts to automate the making of Debian cross-compiler packages.

However, since the OP said he wants to compile on Athlon for Pentium, I fail to see the need for a cross-compiler.
Answer
Howard
Fresh Boarder
Blog Posts: 0
Forum Posts: 11
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #5
So do I.
Answer
irochka
Fresh Boarder
Blog Posts: 0
Forum Posts: 11
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #6
JW> hi, JW> JW> JW> i can't believe i'm the first person to try to do this, but i'm having a JW> lot of trouble... I have an old pentium-mmx running as a little JW> server, and a beefy athlon workstation, both on debian woody (mostly JW> testing). I want to compile apache with php support on the athlon box, JW> with the resulting package to be installed on the server. JW> JW> I understand I have to build gcc as a cross compiler. Although I've JW> waded through lots of documentation, it's not clear whether a straight JW> debian source package install of gcc would let me do this. How would I JW> specify options which would eventually get passed to 'configure' to JW> build gcc???

No, you don't need a cross compiler. Linux on the pentium-mmx and Linux on the athlon workstation are effectivly the same target and host as far as GCC is concerned.

JW> JW> I think I have three options once I have a cross compiler up and JW> running: please can someone tell me which I should follow? JW> JW> 1) Use debian source packages. apt-get source for what I want to build, JW> then somehow (how??) pass info to the dpkg builder to tell it the target JW> architecture. Would this mean setting enivironment vars and/or hacking JW> debian/rules? Anyhow, pentium-mmx is distinctly not an option, and even JW> i586 as a host doesn't seem to appear anywhere...

The pentium-mmx is a i586. All 'Pentiums' short of Pentium Pros and PII, PIII, P4 and Celeron are '586s. You can compile for either a i586 target (or for a i386 target). Actually, there is not really much reason to do anything more than compile with -O2.

JW> JW> 2) Get the original source code for apache2, etc.. and use configure JW> directly, setting the appropriate target architecture and host. Then JW> fake a debian package to satisfy the dependencies on the server. JW> JW> The third option is to make do with the i386 standard binaries which JW> would save me loads of debian package upgrade niggles in the future, and JW> a lot of time and tears now.

There is no reason NOT to do just this. About the *only* packages most people (other than the anal-retentive speed freaks) really bother to compile with processor specific optimizations are the kernel itself and the glibc paackage. I have a PIII server running RedHat 7.3. Only the kernel and glibc were installed from the i686 RPMs. *Everything* else is installed from the i386 RPMs. Things work just fine. Apache is not really a CPU intensive program
Answer
blueice
Fresh Boarder
Blog Posts: 0
Forum Posts: 8
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #7
JS> > JS> > hi, JS> > JS> > i can't believe i'm the first person to try to do this, but i'm having a JS> > lot of trouble... I have an old pentium-mmx running as a little JS> > server, and a beefy athlon workstation, both on debian woody (mostly JS> > testing). I want to compile apache with php support on the athlon box, JS> > with the resulting package to be installed on the server. JS> > JS> > I understand I have to build gcc as a cross compiler. JS> JS> No you don't. The Athlon and PentiumMMX are both Intel x86 architecture JS> chips. Just use the standard installation of GCC if you wish to compile JS> on the Athlon for the Pentium, making sure to set optimization flags JS> appropriately. For example, use -mcpu=586 and/or -march=pentium. JS> JS> You only need a cross-compiler if you're going across CPU JS> architectures
Answer
Bhaumik Shukla
Fresh Boarder
Blog Posts: 0
Forum Posts: 13
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #8
Thanks for all your help, posters.

I didn't appreciate that cross-compilation was for going between architectures only, and isn't appropriate for different targets within the arch.

I still need to recompile apache to get php working anyway (tell me if I'm wrong), so i might as well use the appropriate target when compiling.

My kernel is indeed penitum-mmx compiled, and I will do glibc and leave it at that. Not wanting to be an anally retentive speed freak - my other computer is a cray...

Thanks,

Jack Wasey
Answer
Angel-xan
Fresh Boarder
Blog Posts: 0
Forum Posts: 15
Rating: 0ApplaudCriticize
Posted 2 Months, 1 Week ago #9
You said you're using Debian, right?

apt-get install apache php4

Done. You may want php4-doc, too.
Answer

Spread the Word!

Four out of five users would recommend us to a friend. Shouldn't you?
Link to Us    Tell a Friend

Related Posts:

The Content on this site is provided for general information purposes only. Your use of the Content, or any part thereof, is made solely at Your own risk and responsibility. By entering this site you declare you read and agreed to its Terms, Rules & Privacy.
Copyright © 2006 - 2010 My Linux Gang