[patch] fix build on s390-linux

Matthias Klose doko at ubuntu.com
Mon Jul 11 02:47:02 PDT 2011


hotspot makes some assumptions about size_t, depending on the architecture
(32bit/64bit), which doesn't work on s390 (32bit).

$ cat foo.cc
#include <cstddef>

template<class T> inline T MAX2(T a, T b)           { return (a > b) ? a : b; }

void foo()
{
        unsigned int i = 0;
        unsigned long l = 1;
        size_t r = 1, st = 2;

        r = MAX2(i, l);   // error on x86_64       s390
        r = MAX2(i, st);  // error on x86_64  x86  s390
        r = MAX2(l, st);  // error on         x86
}

on x86_64:
foo.cc:11:22: error: no matching function for call to 'MAX2(unsigned int&, long
unsigned int&)'
foo.cc:12:23: error: no matching function for call to 'MAX2(unsigned int&, size_t&)'

on x86:
foo.cc:12:23: error: no matching function for call to 'MAX2(unsigned int&, long
unsigned int&)'
foo.cc:13:24: error: no matching function for call to 'MAX2(unsigned int&, size_t&)'

on s390:
foo.cc:11:15: error: no matching function for call to ‘MAX2(unsigned int&, long
unsigned int&)’
foo.cc:12:16: error: no matching function for call to ‘MAX2(unsigned int&, size_t&)’

the fix is to add casts to size_t, as already done in other places.

  Matthias

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hotspot-s390.diff
Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110711/9652f382/hotspot-s390.diff 


More information about the distro-pkg-dev mailing list