Bug #45811 DTrace: build failure when building a 32-bit binary on a 64-bit machine
Submitted: 28 Jun 20:36 Modified: 27 Nov 10:30
Reporter: Alexey Kopytov
Status: Need Feedback
Category:Server: Compiling Severity:S3 (Non-critical)
Version:5.4.2-beta OS:Sun Solaris
Assigned to: Target Version:5.4+
Tags: DTrace
Triage: Triaged: D2 (Serious)

[28 Jun 20:36] Alexey Kopytov
Description:
When building a 32-bit server binary on a 64-bit Solaris machine, the build fails due to
64-bit code being generated by 'dtrace -G'. Build log:

gmake[2]: Entering directory `/export/home/kaa/src/mysql-5.4.2-beta/sql'
providers=`(for i in . ../mysys ../storage/archive ../storage/blackhole ../storage/csv
../storage/example ../storage/federated ../storage/heap ../storage/innobase
../storage/myisammrg ../storage/myisam ../storage/ndb; do cat $i/dtrace_providers
2>/dev/null; done) | tr " " "\n" | sort | uniq | sed -e '/^$/d' -e 's/^/-s /'`; \
        objects=`for i in . ../mysys ../storage/archive ../storage/blackhole
../storage/csv ../storage/example ../storage/federated ../storage/heap
../storage/innobase ../storage/myisammrg ../storage/myisam ../storage/ndb; do f=\`cat
$i/dtrace_files 2>/dev/null\`; for j in $f; do test -f $i/$j && echo "$i/$j "; done;
done`; \
        dtrace  -G $providers $objects -o probes_all.o
dtrace: failed to link script probes_mysql.d: incorrect ELF class for object file:
./filesort.o
gmake[2]: *** [probes_all.o] Error 1

How to repeat:
The configure line used:

./configure  '--prefix=/usr/local/mysql' '--enable-assembler'
'--with-extra-charsets=complex' '--enable-thread-safe-client' '--with-big-tables' 
'--with-debug=full' '--with-ssl' '--with-plugins=max' '--with-embedded-server'
'--with-error-inject' '--with-experimental-collations' '--enable-local-infile' 'CC=gcc'
'CFLAGS=-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts
-Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused-function -Wunused-label
-Wunused-value -Wunused-variable -Wunused-parameter -mtune=i386 -DUNIV_MUST_NOT_INLINE
-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS  -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX'
'CXX=gcc' 'CXXFLAGS=-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W
-Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused-function
-Wunused-label -Wunused-value -Wunused-variable -Wreorder -Wctor-dtor-privacy
-Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -mtune=i386
-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS  -DSAFEMALLOC
-DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX' --with-libedit
[3 Aug 14:12] Philip Stoev
Horst, kinly please test this on Azalea and Summit and report if it is fixed. If it is,
then please close this bug, otherwise set it back to Verified and unassign yourself.
[12 Oct 13:25] Alexey Kopytov
Still reproducible on mysql-next-mr on a Solaris 10 machine. Not reproducible on
OpenSolaris anymore.
[27 Nov 10:30] Daniel Fischer
We have Solaris 10 sparc32 builds in pushbuild for mysql-next-mr and the build works
there. Please provide more details about environment and compiler used.