LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-03-2008, 07:52 AM   #1
rickyforpower
LQ Newbie
 
Registered: Dec 2008
Posts: 1

Rep: Reputation: 0
How to compile apache2 to 32bit?


Hi all!

I'm trying to compile apache2 to 32bit instead of 64bit using configure command with
Code:
CFLAGS=-m32
parameter but I receive this error output:

...
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
...

In the config.log I cant' find any helpful information about the compiler's error.

This is the output of
Code:
uname -a
command:
Linux SDC09 2.6.9-11.ELsmp #1 SMP Fri May 20 18:25:30 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux

My machine runs Red Hat Enterprise Linux AS release 4 (Nahant Update 1)

Also I run configure:
Code:
./configure --prefix=/usr/local/share/apache --enable-module=so --enable-rule=SHARED_CORE --enable-proxy CFLAGS="-m32"
If I use CFLAGS="-m64" instead of CFLAGS="-m32" the configure doesn't generate errors.

Anyone can help me?

Last edited by rickyforpower; 12-03-2008 at 08:14 AM.
 
Old 12-03-2008, 09:57 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,812
Blog Entries: 1

Rep: Reputation: 259Reputation: 259Reputation: 259
The config.log will have a test program that failed, that's how it figured out that the C compiler can't create executables. Take a closer look at the config.log and post the appropriate section if your don't understand what you find.
 
Old 12-15-2008, 09:39 AM   #3
lu3ke
LQ Newbie
 
Registered: Dec 2008
Location: .uk
Distribution: Ubuntu 8, OpenSuSE 10
Posts: 4

Rep: Reputation: 0
Same issue

I am having the same issue... I am trying to compile a 32-bit version of Apache 1.3.41 on a 64-bit OS (Ubuntu Server 8.04.1), and it is failing. Specifically:

# ./configure --prefix=/apache --enable-module=so CFLAGS=-m32
Configuring for Apache, Version 1.3.41
+ using installation path layout: Apache (config.layout)
configure:Error: invalid option 'CFLAGS=-m32'


There does not appear to be a config.log created, as this error happens immediately. I have also tried a few variations on that CFLAG line, such as -m32-bit.

Am I doing something completely retarded?
 
Old 12-15-2008, 10:15 AM   #4
lu3ke
LQ Newbie
 
Registered: Dec 2008
Location: .uk
Distribution: Ubuntu 8, OpenSuSE 10
Posts: 4

Rep: Reputation: 0
Ok, I have, maybe, gotten a little bit further. Basically I gave up trying to set it as a commandline configure flag, an instead just set CFLAGS=-m32 as an environment variable..

Now, when I ran the configure line, I got:

# ./configure --prefix=/apache --enable-module=so
Configuring for Apache, Version 1.3.41
+ using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ using "tr [a-z] [A-Z]" to uppercase
+ checking for system header files
+ adding selected modules
+ using builtin Expat
+ checking sizeof various data types
+ doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

======== Error Output for sanity check ========
cd ..; gcc -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT -I./lib/expat-lite -m32 `./apaci` -o helpers/dummy helpers/dummy.c -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status
make: *** [dummy] Error 1
============= End of Error Report =============

Aborting!

So... My next step was to install the ia32-libs package, create a symbolic link so that it would find the 32-bit version of libm.so before the 64 bit version... That seems to have resolved that specific error, however now I get:
======== Error Output for sanity check ========
cd ..; gcc -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT -I./lib/expat-lite -m32 `./apaci` -L /home/lukeb -o helpers/dummy helpers/dummy.c -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status
make: *** [dummy] Error 1
============= End of Error Report =============

Aborting!

---

Basically, at this point I think I should just compile it on a 32-bit system and then install it on the 64-bit one. Does anyone forsee any problems deriving from such an approach?
 
Old 12-15-2008, 04:32 PM   #5
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
What are you trying to accomplish running a 32 bit app on a 64 bit server?

And no, it probably won't work to compile it somewhere and use it somewhere else. The executable is the last piece of the puzzle, you have to get all the library files in the right places, and it means a lot of work for presumably no benefit, but that depends on your answer to my initial question.

Peace,
JimBass
 
Old 12-16-2008, 03:55 AM   #6
lu3ke
LQ Newbie
 
Registered: Dec 2008
Location: .uk
Distribution: Ubuntu 8, OpenSuSE 10
Posts: 4

Rep: Reputation: 0
Yeah, I found that out last night... Apache compiled elsewhere seemed to install and run OK, however when it came to adding PHP and MYSQL? Couldn't even do a make install successfully.

Essentially, we have a legacy proprietary module that requires 32-bit Apache 1.3 and PHP 4. I am running Ubuntu Server 8.04.1, 64-bit.

This sounds like a gigantic headache any way we cut it, though.
 
Old 12-16-2008, 08:36 AM   #7
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
In that case, there's 2 easy/not so easy options that jump out. The first is probably the "truly best", but also costly and time consuming, and thats to contact the software authors and ask them to port it to 64 bit. That of course assumes that they are a company and not somebody who used to work at your office. Even if you get the port done successfully, you probably won't see any better behavior out of it.

The cheaper and probably much easier way to do things would be to install a virtual server inside your 64 bit server. VMware and Virtualbox are the names I see most often for virtualization, but they are far from the only ones. The same way so called "IT" people are happy they can run apache on a RHEL box inside of Windows server 2003, you could run a virtual 32bit Ubuntu inside your 64bit Ubuntu. It truly is 32 bit, so there's no compatibility issues. Apache 1 can be installed on the virtual machine, and with the addition of the kernel headers, make, and tools like that, you should have it working.

Peace,
JimBass
 
Old 12-16-2008, 10:23 AM   #8
lu3ke
LQ Newbie
 
Registered: Dec 2008
Location: .uk
Distribution: Ubuntu 8, OpenSuSE 10
Posts: 4

Rep: Reputation: 0
Yeah, I was afraid it was going to be something like that. It is, indeed, a module that was written by people who are long-departed from the company, and we do not even have the code anylonger, only the module itself. Such is life.

As for running it within a virtual machine (we usually use xen), the problem then becomes the allocation of system resources. The host OS is installed onto a 3TB RAID 5 array, and it is being built as a replacement for an older server that is desperately short of space. So, any virtual machine would need access to that huge disk space. I could do it through an NFS export mounted by the guest machine, but that seems like an extremely lumpy solution.

I think at this point I am going to pong it back at the developers/webd00dz and tell them to try to figure out some alternative.

Thanks for all your help, it is very much appreciated.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
possible to compile a 32bit kernel on a 64bit os? Shadowmeph Linux - General 5 10-02-2008 06:07 AM
compile error for apache2.0.61 and openssl-0.9.8h hophilip Linux - Server 2 07-27-2008 11:05 AM
How to compile 32bit .c .cc On 64bit x86_64 systems? Leo Park Linux - Software 4 01-09-2008 10:57 PM
How to compile source code as 32bit under 64bit OS. Brian1 Linux - Software 2 12-15-2007 02:35 PM
how to compile 32bit on amd64 anarhistu Linux - Newbie 1 01-30-2005 04:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration