Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ bin_PROGRAMS += \
check_PROGRAMS += \
src/common/dumper_unittest

bin_PROGRAMS += \
src/tools/mac/dump_syms/dump_syms_mac

check_PROGRAMS += \
src/common/mac/macho_reader_unittest

if LINUX_HOST

if ENABLE_UPLOAD_TOOLS
Expand All @@ -315,9 +321,6 @@ bin_PROGRAMS += \
src/tools/linux/pid2md/pid2md \
src/tools/linux/md2core/minidump-2-core

bin_PROGRAMS += \
src/tools/mac/dump_syms/dump_syms_mac

if HAVE_MEMFD_CREATE
libexec_PROGRAMS += \
src/tools/linux/core_handler/core_handler
Expand All @@ -326,9 +329,6 @@ endif
check_PROGRAMS += \
src/tools/linux/md2core/minidump_2_core_unittest

check_PROGRAMS += \
src/common/mac/macho_reader_unittest

endif LINUX_HOST

endif !DISABLE_TOOLS
Expand Down Expand Up @@ -788,8 +788,12 @@ src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \
src/common/mac/macho_walker.cc \
src/common/mac/macho_walker.h \
src/tools/mac/dump_syms/dump_syms_tool.cc
src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \
-I$(top_srcdir)/src/third_party/mac_headers \
src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS =
if !MACOS_BUILD
src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS += \
-I$(top_srcdir)/src/third_party/mac_headers
endif
src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS += \
$(RUSTC_DEMANGLE_CFLAGS) \
-DHAVE_MACH_O_NLIST_H
src_tools_mac_dump_syms_dump_syms_mac_LDADD= \
Expand Down Expand Up @@ -912,8 +916,12 @@ src_common_mac_macho_reader_unittest_SOURCES = \
src/common/mac/macho_walker.cc \
src/common/tests/file_utils.cc
src_common_mac_macho_reader_unittest_CPPFLAGS = \
$(AM_CPPFLAGS) $(TEST_CFLAGS) \
-I$(top_srcdir)/src/third_party/mac_headers \
$(AM_CPPFLAGS) $(TEST_CFLAGS)
if !MACOS_BUILD
src_common_mac_macho_reader_unittest_CPPFLAGS += \
-I$(top_srcdir)/src/third_party/mac_headers
endif
src_common_mac_macho_reader_unittest_CPPFLAGS += \
-DHAVE_MACH_O_NLIST_H \
$(PTHREAD_CFLAGS)
src_common_mac_macho_reader_unittest_LDADD = \
Expand Down
13 changes: 5 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,17 @@ esac
AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue)

case $build_os in
darwin*)
MACOS_BUILD=true
;;
mingw* | msys* | cygwin*)
WINDOWS_BUILD=true
;;
esac

AM_CONDITIONAL(WINE_HOST, test x$WINDOWS_HOST = xtrue -a x$WINDOWS_BUILD != xtrue)
AM_CONDITIONAL(MACOS_BUILD, test x$MACOS_BUILD = xtrue)

# Some tools (like mac ones) only support x86 currently.
case $host_cpu in
i?86|x86_64)
X86_HOST=true
;;
esac
AM_CONDITIONAL(X86_HOST, test x$X86_HOST = xtrue)
AM_CONDITIONAL(WINE_HOST, test x$WINDOWS_HOST = xtrue -a x$WINDOWS_BUILD != xtrue)

AC_ARG_ENABLE(processor,
AS_HELP_STRING([--disable-processor],
Expand Down
9 changes: 8 additions & 1 deletion src/common/mac/byteswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,19 @@ static inline int16_t ByteSwap(int16_t v) { return OSSwapInt16(v); }
static inline int32_t ByteSwap(int32_t v) { return OSSwapInt32(v); }
static inline int64_t ByteSwap(int64_t v) { return OSSwapInt64(v); }

#elif defined(__linux__)
#else
// For NXByteOrder
#include <architecture/byte_order.h>
#include <stdint.h>
#if defined(__MINGW32__) || defined(__MINGW64__)
#include <stdlib.h>
#define bswap_16(x) __builtin_bswap16(x)
#define bswap_32(x) __builtin_bswap32(x)
#define bswap_64(x) __builtin_bswap64(x)
#else
#include <endian.h>
#include_next <byteswap.h>
#endif

static inline uint16_t ByteSwap(uint16_t v) { return bswap_16(v); }
static inline uint32_t ByteSwap(uint32_t v) { return bswap_32(v); }
Expand Down
2 changes: 2 additions & 0 deletions src/common/mac/macho_walker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include <config.h> // Must come first
#endif

#include "compat/linux.h"

#include <assert.h>
#include <fcntl.h>
#include <mach-o/fat.h>
Expand Down