diff --git a/src/system/libroot/os/arch/x86_common/stack_trace.cpp b/src/system/libroot/os/arch/generic/stack_trace.cpp similarity index 90% rename from src/system/libroot/os/arch/x86_common/stack_trace.cpp rename to src/system/libroot/os/arch/generic/stack_trace.cpp index 48b82ae0df..41ac99693c 100644 --- a/src/system/libroot/os/arch/x86_common/stack_trace.cpp +++ b/src/system/libroot/os/arch/generic/stack_trace.cpp @@ -6,8 +6,10 @@ * Michael Lotz, mmlr@mlotz.ch */ +#include #include +#ifdef STACK_GROWS_DOWNWARDS /*! Captures a stack trace (the return addresses) of the current thread. \param returnAddresses The array the return address shall be written to. @@ -45,3 +47,9 @@ __arch_get_stack_trace(addr_t* returnAddresses, int32 maxCount, return count; } + +#else + +#error Implementation needed for upwards growing stacks + +#endif diff --git a/src/system/libroot/os/arch/ppc/Jamfile b/src/system/libroot/os/arch/ppc/Jamfile index cdbf5725e0..88711765a2 100644 --- a/src/system/libroot/os/arch/ppc/Jamfile +++ b/src/system/libroot/os/arch/ppc/Jamfile @@ -17,7 +17,6 @@ for architectureObject in [ MultiArchSubDirSetup ppc ] { byteorder.S compatibility.c # only here until the places where those functions # are used are fixed - stack_trace.cpp stack_frame.c # systeminfo.c system_time.c @@ -27,6 +26,7 @@ for architectureObject in [ MultiArchSubDirSetup ppc ] { tls.c generic_system_time_nsecs.cpp + stack_trace.cpp ; } } diff --git a/src/system/libroot/os/arch/sparc/Jamfile b/src/system/libroot/os/arch/sparc/Jamfile index 43d9ed6aff..65fadaea06 100644 --- a/src/system/libroot/os/arch/sparc/Jamfile +++ b/src/system/libroot/os/arch/sparc/Jamfile @@ -27,6 +27,7 @@ for architectureObject in [ MultiArchSubDirSetup sparc ] { generic_atomic.cpp generic_system_time_nsecs.cpp + stack_trace.cpp ; } } diff --git a/src/system/libroot/os/arch/x86/Jamfile b/src/system/libroot/os/arch/x86/Jamfile index 98821562b8..8fda6b8ff5 100644 --- a/src/system/libroot/os/arch/x86/Jamfile +++ b/src/system/libroot/os/arch/x86/Jamfile @@ -17,8 +17,6 @@ for architectureObject in [ MultiArchSubDirSetup x86 x86_gcc2 ] { ; } - SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) x86_common ] ; - MergeObject <$(architecture)>os_arch_$(TARGET_ARCH).o : atomic.S byteorder.S @@ -31,7 +29,6 @@ for architectureObject in [ MultiArchSubDirSetup x86 x86_gcc2 ] { $(compatibilitySources) - # sources from x86_common stack_trace.cpp ; } diff --git a/src/system/libroot/os/arch/x86_64/Jamfile b/src/system/libroot/os/arch/x86_64/Jamfile index 86e96d19f4..e4670b3638 100644 --- a/src/system/libroot/os/arch/x86_64/Jamfile +++ b/src/system/libroot/os/arch/x86_64/Jamfile @@ -12,7 +12,6 @@ for architectureObject in [ MultiArchSubDirSetup x86_64 ] { SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] - [ FDirName $(SUBDIR) $(DOTDOT) x86_common ] ; MergeObject <$(architecture)>os_arch_$(TARGET_ARCH).o : @@ -24,11 +23,9 @@ for architectureObject in [ MultiArchSubDirSetup x86_64 ] { time.cpp tls.cpp - # sources from x86_common - stack_trace.cpp - # sources from generic generic_atomic.cpp + stack_trace.cpp ; } }