Bug 98617

Summary: mysql41-server 4.1.20 compile problem on sparc64
Product: Ports & Packages Reporter: Michael Scheidell <scheidell>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Michael Scheidell 2006-06-07 13:50:10 UTC
critical security update for mysql41-server 4.1.20 won't compile on sun sparc box

Making all in myisam
if cc -DMAP_TO_USE_RAID -I. -I. -I.. -I../include -I../include     -DDBUG_OFF -O -pipe   -O3 -fno-omit-frame-pointer -fno-gcse -MT ft_nlq_search.o -MD -MP -MF ".deps/ft_nlq_search.Tpo" -c -o ft_nlq_search.o ft_nlq_search.c;  then mv -f ".deps/ft_nlq_search.Tpo" ".deps/ft_nlq_search.Po"; else rm -f ".deps/ft_nlq_search.Tpo"; exit 1; fi
{standard input}: Assembler messages:
{standard input}:217: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
*** Error code 1

Stop in /usr/ports/databases/mysql41-server/work/mysql-4.1.20/myisam.

How-To-Repeat: cd /usr/ports/databases/mysql41-server
make BUILD_OPTIMIZED=yes BUILD_STATIC=yes

or
make BUILD_STATIC=yes

or just:
make
Comment 1 Pav Lucistnik freebsd_committer freebsd_triage 2006-06-07 19:42:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer
Comment 2 Michael Scheidell 2006-06-07 20:04:46 UTC
More information:

Make clean THEN make BUILD_STATIC works.

It appears its the BUILD_OPTIMIZED which makes -O3 option to cc.

This causes problems.

googles for other issues with sparc64 show  same thing with a lot of 
other ports.

Some prs seem to be closed, some still open.

I have yet to find one with a real answer.

I find that If I cc into that directory
/usr/ports/databases/mysql41-server/work/mysql-4.1.20/myisam


and compile THAT ONE OBJECT BY HAND,  using -O2 and ont -O3 everything 
else works fine.
cc -DMAP_TO_USE_RAID -I. -I. -I.. -I../include -I../include -DDBUG_OFF 
-O -pipe -O2 -fno-omit-frame-pointer -fno-gcse -MT ft_nlq_search.o -MD 
-MP -MF ".deps/ft_nlq_search.Tpo" -c -o ft_nlq_search.o ft_nlq_search.c

everything else compiles fine with -O3 (only that ONE piece of code)
Making all in myisam
if cc -DMAP_TO_USE_RAID -I. -I. -I.. -I../include -I../include     
-DDBUG_OFF -O -pipe   -O3 -fno-omit-frame-pointer -fno-gcse -MT sort.o 
-MD -MP -MF ".deps/sort.Tpo" -c -o sort.o sort.c;  then mv -f 
".deps/sort.Tpo" ".deps/sort.Po"; else rm -f ".deps/sort.Tpo"; exit 1; fi


this patch COULD be applied to Makefile: (or we could figure out what is 
wrong, and patch the source for sparc64 only)
Any sparc guru's, chime in:

--- Makefile.orig       Wed Jun  7 14:47:27 2006
+++ Makefile    Wed Jun  7 14:52:48 2006
@@ -90,7 +90,11 @@
 CXX=           ${CC}
 .endif
 .if defined(BUILD_OPTIMIZED)
+.if ${ARCH} != "i386"
 CFLAGS+=       -O2 -fno-omit-frame-pointer
+.else
+CFLAGS+=       -O3 -fno-omit-frame-pointer
+.endif
 .if ${OSVERSION} > 500000 || (defined(USE_GCC) && (${USE_GCC} == 3.0 || 
${USE_GCC} == 3.1 || ${USE_GCC} == 3.2 || ${USE_GCC} == 3.3))
 CFLAGS+=       -fno-gcse
 .endif


-- 
Michael Scheidell, CTO
SECNAP Network Security / www.secnap.com
scheidell@secnap.net  / 1+561-999-5000, x 1131
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2006-06-08 06:54:37 UTC
State Changed
From-To: open->closed

Simply do not use BUILD_OPTIMIZED. -O2 is already the default.
Comment 4 Michael Scheidell 2006-06-08 12:01:51 UTC
They why does it let you do that?

why would it hurt to add that patch?

don't you think it would help users? 

is there some problem with that patch?

If you think maybe make file should check for BUILD_OPTIMIZED and ARCH = sparc64 and fail, would that be acceptable?
 there ie already a test for USE_MYSQL that failes.