only build dump_syms_mac for x86 hosts

The dump_syms_mac tool only works for the system it is being built for
(it doesn't support running on ELFs for a diff target), and it builds
only for x86 currently.

If you look at the mac header:
	src/third_party/mac_headers/mach/machine/vm_types.h
it will #error for non x86/arm systems, and the arm header is not in
our source tree.

Tweak the build so it's only compiled when targetting x86 systems.

BUG=chromium:579384
TEST=`make check` pass
R=ted.mielczarek@gmail.com

Review URL: https://codereview.chromium.org/1645673002 .
This commit is contained in:
Mike Frysinger 2016-01-27 16:45:21 -05:00
parent bc44efdc27
commit 3f736ce086
4 changed files with 62 additions and 27 deletions

View file

@ -347,9 +347,12 @@ bin_PROGRAMS += \
src/tools/linux/dump_syms/dump_syms \
src/tools/linux/md2core/minidump-2-core \
src/tools/linux/symupload/minidump_upload \
src/tools/linux/symupload/sym_upload \
src/tools/linux/symupload/sym_upload
if X86_HOST
bin_PROGRAMS += \
src/tools/mac/dump_syms/dump_syms_mac
endif
endif
endif LINUX_HOST

View file

@ -143,9 +143,10 @@ host_triplet = @host@
# Build as PIC on Linux, for linux_client_unittest_shlib
@LINUX_HOST_TRUE@am__append_3 = -fPIC
@LINUX_HOST_TRUE@am__append_4 = -fPIC
bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \
$(am__EXEEXT_8)
bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) \
$(am__EXEEXT_5)
check_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \
$(am__EXEEXT_9)
EXTRA_PROGRAMS = $(am__EXEEXT_1)
@DISABLE_PROCESSOR_FALSE@am__append_5 = src/libbreakpad.a
@DISABLE_PROCESSOR_FALSE@am__append_6 = breakpad.pc
@ -168,10 +169,12 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload
@DISABLE_PROCESSOR_FALSE@am__append_14 = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_14 = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac
@DISABLE_PROCESSOR_FALSE@am__append_15 = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest \
@ -200,33 +203,33 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1)
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest
@LINUX_HOST_TRUE@am__append_15 = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
@LINUX_HOST_TRUE@am__append_16 = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
@LINUX_HOST_TRUE@am__append_17 = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
@LINUX_HOST_TRUE@am__append_18 = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_18 = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_19 = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest
@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_19 = \
@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_20 = \
@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_20 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_21 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext.S
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_21 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_22 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext_unittest.cc
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_22 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_23 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog -lm
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_23 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_24 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog
noinst_PROGRAMS =
@ -550,9 +553,9 @@ src_third_party_libdisasm_libdisasm_a_OBJECTS = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
@DISABLE_PROCESSOR_FALSE@am__EXEEXT_5 = src/common/test_assembler_unittest$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload$(EXEEXT)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_5 = src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
@DISABLE_PROCESSOR_FALSE@am__EXEEXT_6 = src/common/test_assembler_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest$(EXEEXT) \
@ -579,11 +582,11 @@ src_third_party_libdisasm_libdisasm_a_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT)
@LINUX_HOST_TRUE@am__EXEEXT_6 = src/client/linux/linux_client_unittest$(EXEEXT)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_7 = src/common/dumper_unittest$(EXEEXT) \
@LINUX_HOST_TRUE@am__EXEEXT_7 = src/client/linux/linux_client_unittest$(EXEEXT)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_8 = src/common/dumper_unittest$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)
@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_8 = src/processor/stackwalker_selftest$(EXEEXT)
@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_9 = src/processor/stackwalker_selftest$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_src_client_linux_linux_client_unittest_OBJECTS =
src_client_linux_linux_client_unittest_OBJECTS = \
@ -1993,7 +1996,7 @@ pkgconfig_DATA = $(am__append_6) $(am__append_9)
check_LIBRARIES = src/testing/libtesting.a
noinst_LIBRARIES = $(am__append_7)
lib_LIBRARIES = $(am__append_5) $(am__append_8)
CLEANFILES = $(am__append_16)
CLEANFILES = $(am__append_17)
@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \
@SYSTEM_TEST_LIBS_FALSE@ src/testing/gtest/src/gtest-all.cc \
@SYSTEM_TEST_LIBS_FALSE@ src/testing/gtest/src/gtest_main.cc \
@ -2218,15 +2221,15 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@LINUX_HOST_TRUE@ src/processor/minidump.cc \
@LINUX_HOST_TRUE@ src/processor/pathname_stripper.cc \
@LINUX_HOST_TRUE@ src/processor/proc_maps_linux.cc \
@LINUX_HOST_TRUE@ $(am__append_20) \
@LINUX_HOST_TRUE@ $(am__append_21) \
@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer_unittest.cc \
@LINUX_HOST_TRUE@ $(am__append_21)
@LINUX_HOST_TRUE@ $(am__append_22)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDFLAGS = \
@LINUX_HOST_TRUE@ -shared -Wl,-h,linux_client_unittest_shlib \
@LINUX_HOST_TRUE@ $(am__append_22)
@LINUX_HOST_TRUE@ $(am__append_23)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDADD = \
@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_client.o \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.o \
@ -2258,7 +2261,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES =
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \
@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' $(am__append_23)
@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' $(am__append_24)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDADD = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib \
@LINUX_HOST_TRUE@ $(TEST_LIBS)

21
configure vendored
View file

@ -640,6 +640,8 @@ DISABLE_TOOLS_FALSE
DISABLE_TOOLS_TRUE
DISABLE_PROCESSOR_FALSE
DISABLE_PROCESSOR_TRUE
X86_HOST_FALSE
X86_HOST_TRUE
ANDROID_HOST_FALSE
ANDROID_HOST_TRUE
LINUX_HOST_FALSE
@ -7425,6 +7427,21 @@ else
fi
# Some tools (like mac ones) only support x86 currently.
case $host_cpu in
i?86|x86_64)
X86_HOST=true
;;
esac
if test x$X86_HOST = xtrue; then
X86_HOST_TRUE=
X86_HOST_FALSE='#'
else
X86_HOST_TRUE='#'
X86_HOST_FALSE=
fi
# Check whether --enable-processor was given.
if test "${enable_processor+set}" = set; then :
enableval=$enable_processor; case "${enableval}" in
@ -7893,6 +7910,10 @@ if test -z "${ANDROID_HOST_TRUE}" && test -z "${ANDROID_HOST_FALSE}"; then
as_fn_error $? "conditional \"ANDROID_HOST\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${X86_HOST_TRUE}" && test -z "${X86_HOST_FALSE}"; then
as_fn_error $? "conditional \"X86_HOST\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DISABLE_PROCESSOR_TRUE}" && test -z "${DISABLE_PROCESSOR_FALSE}"; then
as_fn_error $? "conditional \"DISABLE_PROCESSOR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View file

@ -95,6 +95,14 @@ case $host in
esac
AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = 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)
AC_ARG_ENABLE(processor,
AS_HELP_STRING([--disable-processor],
[Don't build processor library]