diff -Nuar oprofile-0.9.8-orig/libdb/db_manage.c oprofile-0.9.8/libdb/db_manage.c
--- oprofile-0.9.8-orig/libdb/db_manage.c	2012-08-28 14:28:00.000000000 -0400
+++ oprofile-0.9.8/libdb/db_manage.c	2012-08-28 14:28:14.000000000 -0400
@@ -73,8 +73,16 @@
 	if (ftruncate(data->fd, new_file_size))
 		return 1;
 
+#ifdef __CYGWIN__
+	if (munmap(data->base_memory, old_file_size)) {
+		return 1;
+	}
+	new_map = mmap(data->base_memory, new_file_size,
+		(PROT_READ | PROT_WRITE), MAP_SHARED, data->fd, 0);
+#else
 	new_map = mremap(data->base_memory,
 			 old_file_size, new_file_size, MREMAP_MAYMOVE);
+#endif
 
 	if (new_map == MAP_FAILED)
 		return 1;
diff -Nuar oprofile-0.9.8-orig/libop/op_sample_file.h oprofile-0.9.8/libop/op_sample_file.h
--- oprofile-0.9.8-orig/libop/op_sample_file.h	2012-08-28 14:28:00.000000000 -0400
+++ oprofile-0.9.8/libop/op_sample_file.h	2012-08-28 14:28:14.000000000 -0400
@@ -17,6 +17,10 @@
 #include <stdint.h>
 #include <time.h>
 
+#ifdef __CYGWIN__
+#pragma pack(push, 2)
+#endif
+
 /* header of the sample files */
 struct opd_header {
 	u8 magic[4];
@@ -39,4 +43,8 @@
 	u32 reserved1[1];
 };
 
+#ifdef __CYGWIN__
+#pragma pack(pop)
+#endif
+
 #endif /* OP_SAMPLE_FILE_H */
diff -Nuar oprofile-0.9.8-orig/libpp/diff_container.cpp oprofile-0.9.8/libpp/diff_container.cpp
--- oprofile-0.9.8-orig/libpp/diff_container.cpp	2012-08-28 14:28:00.000000000 -0400
+++ oprofile-0.9.8/libpp/diff_container.cpp	2012-08-28 14:28:14.000000000 -0400
@@ -18,6 +18,10 @@
 
 #include <cmath>
 
+#ifdef __CYGWIN__
+#define INFINITY infinity()
+#endif
+
 using namespace std;
 
 
diff -Nuar oprofile-0.9.8-orig/libpp/format_output.cpp oprofile-0.9.8/libpp/format_output.cpp
--- oprofile-0.9.8-orig/libpp/format_output.cpp	2012-08-28 14:28:00.000000000 -0400
+++ oprofile-0.9.8/libpp/format_output.cpp	2012-08-28 14:28:14.000000000 -0400
@@ -20,6 +20,10 @@
 #include <iostream>
 #include <cmath>
 
+#ifdef __CYGWIN__
+#define INFINITY infinity()
+#endif
+
 #include "string_manip.h"
 #include "string_filter.h"
 
