After seeing your change adding the md5sum for freebsd I tried a build on
freebsd 7.0-RELEASE on x86_64.
I don't see the jlong/void* problems as they are both 64-bit on my machine.
However, it is common in classlib to fix this by doing a double cast although
it is more common to use the classlib defines (IDATA) or (UDATA) than size_t.
I have an almost identical fix for the hysl.c issue but I made one additional
change which I have committed as r691931 to keep the iconv and mbtowc code
consistent.
I fixed the hysock issue with r691184 and r691191 since I came across this
on another platform a short while ago.
I "fixed" the signal issues with the unrelated r691267.
I also needed the following changes which I assume are freebsd6/7 differences.
I'm sure the second is fine but can you check to see if these cause problems
on your 6.3 system?
Index: modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
===================================================================
--- modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c (revision
691923)
+++ modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c (working copy)
@@ -95,14 +95,20 @@
jboolean result = 0;
IDATA m_addr = (IDATA)addr;
int page_size = getPageSize();
- char* vec = NULL;
+#if defined(FREEBSD)
+#define HY_VEC_T char
+#else
+#define HY_VEC_T unsigned char
+#endif
+ HY_VEC_T* vec = NULL;
int page_count = 0;
int align_offset = m_addr%page_size;//addr should align with the
boundary of a page.
m_addr -= align_offset;
size += align_offset;
page_count = (size+page_size-1)/page_size;
- vec = (char *) hymem_allocate_memory(page_count*sizeof(char));
- if(mincore((void *)m_addr, size , (unsigned char *)vec)==0) //or else
there is error about the mincore and return false;
+ vec = (HY_VEC_T *) hymem_allocate_memory(page_count*sizeof(char));
+ if(mincore((void *)m_addr, size, vec)==0) //or else there is error
about the mincore and return false;
+#undef HY_VEC_T
{
int i;
for(i=0 ;i<page_count;i++)
Index: modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c
===================================================================
--- modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c
(revision 691923)
+++ modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c
(working copy)
@@ -37,7 +37,7 @@
{
unsigned long free;
unsigned long total;
- int len = sizeof(free);
+ size_t len = sizeof(free);
if (sysctlbyname("vm.stats.vm.v_free_count", &free, &len, NULL, 0) == -1) {
return FALSE;
Additionally, I needed to compile new versions of the icu dependencies for
freebsd7 that will conflict with the 6.3 versions. I think we can handle
the conflict by using the hy.platform defines used to handle the
libstdc++5/libstdc++6 conflict on linux.
I have a few vm fixes too. I'll try to commit these later today.
After building, when I try to run HelloWorld, I have significant problems
with pthread related code. Using libthr.so I get a hang early in the
startup. If I force the use of libkse.so with /etc/libmap.conf then I
get further but it hangs during shutdown. I'll post more details of these
when I get some spare time to look at them again.
I assume you'll see similar problems.
Regards,
Mark.
In message <[EMAIL PROTECTED]>,
"Ilya Berezhniuk" writes:
>
> Hi all,
>
> I prepared a patch to fix Harmony build on my FreeBSD 6.3 machine.
>
> Could anyone of classlib gurus review and approve Classlib part of
> this patch [1], as I'm not familiar with Classlib coding rules?
>
> Most of the problems were caused by casting jlong to void*, because
> sizes of these types are different, and -Werror was specified.
> In the patch I used double casting like (void*)(size_t)(jlong value).
>
> [1] https://issues.apache.org/jira/browse/HARMONY-5967
>
> --
> Ilya.
>