Bug #1872 Configure script does not apply LDFLAGS in 64bit env
Submitted: 18 Nov 2003 7:37 Modified: 20 Mar 2004 9:16
Reporter: Matt Davis Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:mysql-4.0.16 OS:Linux (RH Enterprise Linux for POWER)
Assigned to: CPU Architecture:Any

[18 Nov 2003 7:37] Matt Davis
Description:
Instructions in the configure --help section suggest that CFLAGS and LDFLAGS will be considered during the scripted configuration.  In order to compile 64 bit on Linux on POWER with a 64bit gcc toolchain, the -m64 flag must be passed to gcc and ld.  With $CFLAGS=-m64 and $LDFLAGS=-m64, only the CFLAGS env variable is applied.  The result is that the makefiles do not append the -m64 flag to the linker commands, and the linker cannot generate 64bit binaries from the objects created by the compiler.

How to repeat:
export $CFLAGS=-m64
export $LDFLAGS=-m64
./configure
make

When the linker commands begin, error messages will be generated, e.g.:

/usr/bin/ld: warning: powerpc:common64 architecture of input file `my_seek.lo' is incompatible with powerpc:common output

Suggested fix:
Configure script needs to be examined and repaired to consider LDFLAGS.
[1 Dec 2003 15:04] Dean Ellis
Have you tried passing this via the configure options --with-mysqld-ldflags, --with-client-ldflags and --with-lib-ccflags?

If that passes correctly, I would like to change this to a feature request.

Thank you.
[1 Dec 2003 15:44] Sergei Golubchik
your "how to repeat" is broken. Is it *exactly* what you typed in the shell ?

The correct syntax is

export CFLAGS=-m64
export LDFLAGS=-m64

note the absense of the dollar sign.
[20 Mar 2004 9:16] Sergei Golubchik
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.