Bug #58464 Build failure using Sun Studio on Solaris
Submitted: 24 Nov 2010 17:56 Modified: 15 Oct 2012 13:46
Reporter: Olav Sandstå Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.6.1 OS:Solaris
Assigned to: Assigned Account CPU Architecture:Any

[24 Nov 2010 17:56] Olav Sandstå
Description:
I get the following build error when building MySQL using the lastest source from mysql-trunk-bugfixing using Sun Studio compiler on OpenSolaris:

Linking CXX static library libsql.a
[ 81%] Built target sql
Scanning dependencies of target mysqld_dtrace_all
gmake[2]: *** No rule to make target `sql/z', needed by `sql/mysqld_dtrace_all.o'.  Stop.
gmake[1]: *** [sql/CMakeFiles/mysqld_dtrace_all.dir/all] Error 2
gmake: *** [all] Error 2

How to repeat:
1. Use the latest source from mysql-trunk-bugfixing

2. cmake . -DWITH_DEBUG=1

3. gmake

It might be necessary that the Sun Studio compiler is used
[24 Nov 2010 20:23] Olav Sandstå
The problem seems to be caused by an extra dependency that gets added to the
sql/CMakeFiles/mysqld_dtrace_all.dir/build.make file:

sql/mysqld_dtrace_all.o: sql/libsql.a
sql/mysqld_dtrace_all.o: mysys/libmysys.a
sql/mysqld_dtrace_all.o: storage/innobase/libinnobase.a
sql/mysqld_dtrace_all.o: sql/z
sql/mysqld_dtrace_all.o: storage/myisammrg/libmyisammrg.a
sql/mysqld_dtrace_all.o: storage/csv/libcsv.a
sql/mysqld_dtrace_all.o: storage/heap/libheap.a
sql/mysqld_dtrace_all.o: storage/myisam/libmyisam.a
sql/mysqld_dtrace_all.o: storage/perfschema/libperfschema.a
sql/mysqld_dtrace_all.o: sql/libpartition.a

The dependency on sql/z is wrong and likely caused by trying to include libz as a library to instrument.
[24 Nov 2010 20:25] Olav Sandstå
This problem occurred after the following change set was pushed into mysql-trunk-bugfixing:

magnus.blaudd@sun.com-20101116090554-noegxp3bpamy6rud

If I revert this I am again able to build on OpenSolaris.
[24 Nov 2010 20:49] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Can you repeat it if use make or dmake?
[24 Nov 2010 21:42] Olav Sandstå
Yes, I get the same error when running with make and dmake.

I think the build failure depends on whether you get the following dependency in the file sql/CMakeFiles/mysqld_dtrace_all.dir/build.make:

...
sql/mysqld_dtrace_all.o: storage/innobase/libinnobase.a
sql/mysqld_dtrace_all.o: sql/z
sql/mysqld_dtrace_all.o: storage/myisammrg/libmyisammrg.a
...

Do you have the dependency on sql/z in your file after running cmake? If not I think it is unlikely that you will get the build failure.
[24 Nov 2010 22:41] Sveta Smirnova
Olav,

hm... looks like not:

# Utility rule file for mysqld_dtrace_all.

sql/CMakeFiles/mysqld_dtrace_all: sql/mysqld_dtrace_all.o

sql/mysqld_dtrace_all.o: sql/libsql.a
sql/mysqld_dtrace_all.o: mysys/libmysys.a
sql/mysqld_dtrace_all.o: storage/csv/libcsv.a
sql/mysqld_dtrace_all.o: storage/heap/libheap.a
sql/mysqld_dtrace_all.o: storage/innobase/libinnobase.a
sql/mysqld_dtrace_all.o: storage/myisam/libmyisam.a
sql/mysqld_dtrace_all.o: storage/myisammrg/libmyisammrg.a
sql/mysqld_dtrace_all.o: storage/perfschema/libperfschema.a
sql/mysqld_dtrace_all.o: sql/libpartition.a

Will try on other Solaris box
[25 Nov 2010 8:56] Olav Sandstå
Hi Sveta,

Thanks for trying to verify this bug. Wlad has confirmed that this is a problem and has already made a fix for it. So I am setting this bug to verified.
[25 Nov 2010 9:02] Olav Sandstå
Wlad has made a fix for this problem, see the following patch:

http://lists.mysql.com/commits/124953
[25 Nov 2010 10:21] Olav Sandstå
The patch looks good and I have verified that it solves the build problem.
[25 Nov 2010 14:23] Olav Sandstå
Same issue observed running on Solaris 10 (so changing from being an OpenSolaris only issue).
[15 Oct 2012 13:46] Erlend Dahl
Fixed in recent versions of 5.5/5.6