I have a website algebra.com. It is served by Apache on Ubuntu 14.04, ruing behind nginx.
One element of it is "mimetex.cgi" (which I save as rendertex.cgi), a C program that compiles into a Linux executable. Its job is to display a GIF containing a depiction of a TeX formula.
The problem is that mimetex.cgi IS properly executed on 32 bit servers, and is NOT executed and retued as a piece of data (entire executable binary code is sent via HTTP) on 64 bit servers.
I compile this executable as part of my makefiles.
The compilation is done on each server, it is not a binary in CVS, it is compiled invididually.
Compilation is done with the following command:
cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi
Here's some information about the resulting binary:
# ldd mimetex.cgi
linux-vdso.so.1 => (0x00007ffdff590000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f364f5d7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f364f212000)
/lib64/ld-linux-x86-64.so.2 (0x000055624731d000)
# file mimetex.cgi
mimetex.cgi: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=675e22e4d0167f2a2512b04c9a04b64a35eef6e4, not stripped
Here are the relevant parts of the Apache configuration:
<Files *.cgi>
SetHandler cgi-script
Options ExecCGI
#optional
PerlSendHeader On
</Files>
Everything looks legit and I caot figure out, why this executable is executed on 32 bit (when compiled on 32 bit) and is instead sent as a whole on 64 bit systems, when compiled on those same systems.
Any ideas? Thanks
