[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 0/3] hivex: Improve OS X support

On 09/06/2011 03:52 AM, Alex Nelson wrote:
> This patch series improves, but does not complete, OS X support for
> hivex.  There are several outstanding issues before hivexml and hivexsh
> can run:
> * hivexsh uses open_memstream, which doesn't exist in OS X as near as I
> can see.  Unfortunately, I'm inexperienced with autoconf, so I'm not
> sure how to employ AC_CHECK_FUNCS([open_memstream]) to conditionally add
> 'sh' to the Makefile.am's SUBDIRS.
> * The check for libxml fails, because PKG_CHECK_CONFIG doesn't exist on
> OS X.  I think it would be better to use AC_CHECK_FUNCS on some of the
> libxml functions, but again, I'm not too hot with autoconf and automake.
> * hivexml has the following run-time failure:
> dyld: lazy symbol binding failed: Symbol not found: _iconv_open
> Referenced from: /Users/alex/local/src/hivex/lib/.libs/libhivex.0.dylib
> Expected in: flat namespace
> dyld: Symbol not found: _iconv_open
> Referenced from: /Users/alex/local/src/hivex/lib/.libs/libhivex.0.dylib
> Expected in: flat namespace
> Trace/BPT trap: 5
> I have the vague idea of how to address the first two, but not the last.
> I would appreciate any help on these.  Gillen, you said earlier this
> weekend you had taken a stab at compiling things in OS X.  Did you have
> to take these steps, too?
> --Alex
> Alex Nelson (3):
>   Mac OS X: Detect bindtextdomain
>   Mac OS X: setlocale function requires locale.h
>   Mac OS X: Run glibtoolize in absence of libtoolize
>  bootstrap     |    2 +-
>  configure.ac  |    3 +++
>  sh/hivexsh.c  |    3 +++
>  xml/hivexml.c |    3 +++
>  4 files changed, 10 insertions(+), 1 deletions(-)

I was only interested in the lib itself, so I can't speak for the tools.

I can confirm that libxml2 is not found due to the lack of pkg-config.

Additionally, as explained in my last mail, I had to patch
lib/byte_conversions.h as shown below.

About your "Symbol not found: _iconv_open" problem, this hit to me too
when I linked against hivex. It's due to a missing -liconv on platforms
where this is needed.

Unix _IS_ user friendly - it's just
selective about who its friends are!

diff --git a/lib/byte_conversions.h b/lib/byte_conversions.h
index aa4ffe6..2e4cafe 100644
--- a/lib/byte_conversions.h
+++ b/lib/byte_conversions.h
@@ -22,16 +22,16 @@
 #ifndef be32toh
-#define be32toh(x) __bswap_32 (x)
+#define be32toh(x) bswap_32 (x)
 #ifndef htobe32
-#define htobe32(x) __bswap_32 (x)
+#define htobe32(x) bswap_32 (x)
 #ifndef be64toh
-#define be64toh(x) __bswap_64 (x)
+#define be64toh(x) bswap_64 (x)
 #ifndef htobe64
-#define htobe64(x) __bswap_64 (x)
+#define htobe64(x) bswap_64 (x)
 #ifndef le16toh
 #define le16toh(x) (x)
@@ -65,22 +65,22 @@
 #define htobe64(x) (x)
 #ifndef le16toh
-#define le16toh(x) __bswap_16 (x)
+#define le16toh(x) bswap_16 (x)
 #ifndef htole16
-#define htole16(x) __bswap_16 (x)
+#define htole16(x) bswap_16 (x)
 #ifndef le32toh
-#define le32toh(x) __bswap_32 (x)
+#define le32toh(x) bswap_32 (x)
 #ifndef htole32
-#define htole32(x) __bswap_32 (x)
+#define htole32(x) bswap_32 (x)
 #ifndef le64toh
-#define le64toh(x) __bswap_64 (x)
+#define le64toh(x) bswap_64 (x)
 #ifndef htole64
-#define htole64(x) __bswap_64 (x)
+#define htole64(x) bswap_64 (x)
 #endif /* __BYTE_ORDER == __BIG_ENDIAN */

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]