From 782b8f055069067fda1b53dde5da35b3040a43f3 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 4 Jun 2009 18:47:38 +0200 Subject: [PATCH 1/2] Some portability fixes. include/Makefile.am: use @PERL@ to call scripts/dheadgen.pl - don't rely on #! /usr/bin/perl scripts/dheadgen.pl: use 2-arg open() for compatibility with older Perl versions storage/innobase/srv/srv0srv.c: Don't use C++-style comments in C code --- include/Makefile.am | 2 +- scripts/dheadgen.pl | 12 ++++++------ storage/innobase/srv/srv0srv.c | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index 214ef8862e9..dd6f53f7ca2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -87,7 +87,7 @@ probes_mysql_dtrace.h: $(DTRACEPROVIDER) endif probes_mysql_nodtrace.h: $(DTRACEPROVIDER) - $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@ + @PERL@ $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/scripts/dheadgen.pl b/scripts/dheadgen.pl index 5ead0f90a31..374b232a04e 100755 --- a/scripts/dheadgen.pl +++ b/scripts/dheadgen.pl @@ -267,23 +267,23 @@ usage() if ($infile !~ /(.+)\.d$/); # If the system has native support for DTrace, we'll use that binary instead. # if (-x '/usr/sbin/dtrace' && !$force) { - open(my $dt, '-|', "/usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") + open(DTRACE, "-| /usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") or die "can't invoke dtrace(1M)"; - while (<$dt>) { + while () { emit_dtrace($_); } - close($dt); + close(DTRACE); exit(0); } emit_prologue($infile); -open(my $d, '<', $infile) or die "couldn't open $infile"; -@lines = <$d>; -close($d); +open(D, "< $infile") or die "couldn't open $infile"; +@lines = ; +close(D); while (1) { my $nl = 0; diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index e0fe6f40197..21aafcfd7d7 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -422,28 +422,28 @@ FILE* srv_misc_tmpfile; ulint srv_main_thread_process_no = 0; ulint srv_main_thread_id = 0; -// The following count work done by srv_master_thread. +/* The following count work done by srv_master_thread. */ -// Iterations by the 'once per second' loop. +/* Iterations by the 'once per second' loop */ ulint srv_main_1_second_loops = 0; -// Calls to sleep by the 'once per second' loop. +/* Calls to sleep by the 'once per second' loop */ ulint srv_main_sleeps = 0; -// Iterations by the 'once per 10 seconds' loop. +/* Iterations by the 'once per 10 seconds' loop */ ulint srv_main_10_second_loops = 0; -// Iterations of the loop bounded by the 'background_loop' label. +/* Iterations of the loop bounded by the 'background_loop' label */ ulint srv_main_background_loops = 0; -// Iterations of the loop bounded by the 'flush_loop' label. +/* Iterations of the loop bounded by the 'flush_loop' label */ ulint srv_main_flush_loops = 0; -// Calls to log_buffer_flush_to_disk. +/* Calls to log_buffer_flush_to_disk */ ulint srv_sync_flush = 0; -// Calls to log_buffer_flush_maybe_sync. +/* Calls to log_buffer_flush_maybe_sync */ ulint srv_async_flush = 0; -// Number of microseconds threads wait because of -// innodb_thread_concurrency +/* Number of microseconds threads wait because of +innodb_thread_concurrency */ static ib_longlong srv_thread_wait_mics = 0; -// Number of microseconds for spinlock delay +/* Number of microseconds for spinlock delay */ static ib_longlong srv_timed_spin_delay = 0; /* From 76bcf79c6b64908dc1f8696f25204229084e3aad Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 5 Jun 2009 00:29:41 +0200 Subject: [PATCH 2/2] Apply fix for bug#45131, "Problems building on 32-bit linux". As described in the bug, the problem is not new in 5.4, but newly tickled. We need a register whose lower 8 bits can be accessed, and must request such from the assembler. Using a "q" constraint instead of "r" constraint accomplishes this. --- include/atomic/x86-gcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h index d79dadbf05e..726c98213fb 100644 --- a/include/atomic/x86-gcc.h +++ b/include/atomic/x86-gcc.h @@ -35,7 +35,7 @@ asm volatile (LOCK "; xadd %0, %1;" : "+r" (v) , "+m" (*a)) #endif #define make_atomic_swap_body(S) \ - asm volatile ("; xchg %0, %1;" : "+r" (v) , "+m" (*a)) + asm volatile ("; xchg %0, %1;" : "+q" (v) , "+m" (*a)) #define make_atomic_cas_body(S) \ asm volatile (LOCK "; cmpxchg %3, %0; setz %2;" \ : "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set))