Build fixes.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3987 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2022-09-24 21:10:23 +00:00
parent eadda41518
commit 775f00c69c
4 changed files with 72 additions and 30 deletions

View File

@ -43,13 +43,14 @@ APP_OBJS := $(call get_objs,APP_SOURCES)
$(APP_OBJS): CFLAGS += \
-Ideps/base64c/include \
-Ideps/crypt_blowfish \
-Ideps/quickjs \
-Ideps/sqlite \
-Ideps/libuv/include \
-Ideps/xopt \
-Ideps/libbacktrace \
-Ideps/libsodium \
-Ideps/libsodium/src/libsodium/include \
-Ideps/libuv/include \
-Ideps/quickjs \
-Ideps/sqlite \
-Ideps/valgrind \
-Ideps/xopt \
-Werror
BASE64C_SOURCES := deps/base64c/src/base64c.c
@ -242,36 +243,21 @@ LIBBACKTRACE_SOURCES := \
deps/libbacktrace/atomic.c \
deps/libbacktrace/backtrace.c \
deps/libbacktrace/dwarf.c \
deps/libbacktrace/elf.c \
deps/libbacktrace/fileline.c \
deps/libbacktrace/mmap.c \
deps/libbacktrace/mmapio.c \
deps/libbacktrace/posix.c \
deps/libbacktrace/print.c \
deps/libbacktrace/simple.c \
deps/libbacktrace/sort.c \
deps/libbacktrace/state.c
#deps/libbacktrace/unknown.c
#deps/libbacktrace/read.c \
#deps/libbacktrace/nounwind.c \
#deps/libbacktrace/instrumented_alloc.c \
#deps/libbacktrace/pecoff.c \
#deps/libbacktrace/xcoff.c
#deps/libbacktrace/macho.c \
#deps/libbacktrace/alloc.c \
#deps/libbacktrace/allocfail.c
#deps/libbacktrace/btest.c
#deps/libbacktrace/edtest.c
#deps/libbacktrace/edtest2.c
#deps/libbacktrace/mtest.c
#deps/libbacktrace/stest.c
#deps/libbacktrace/test_format.c
#deps/libbacktrace/testlib.c
#deps/libbacktrace/ttest.c
#deps/libbacktrace/unittest.c
#deps/libbacktrace/xztest.c
#deps/libbacktrace/ztest.c
LIBBACKTRACE_SOURCES_unix := \
deps/libbacktrace/elf.c \
deps/libbacktrace/mmap.c \
deps/libbacktrace/mmapio.c \
deps/libbacktrace/posix.c
LIBBACKTRACE_SOURCES_win := \
deps/libbacktrace/alloc.c \
deps/libbacktrace/pecoff.c \
deps/libbacktrace/posix.c \
deps/libbacktrace/read.c
LIBBACKTRACE_OBJS := $(call get_objs,LIBBACKTRACE_SOURCES)
$(LIBBACKTRACE_OBJS): CFLAGS += \
-Ideps/libbacktrace_config \

View File

53
deps/libbacktrace_config/config.h vendored Normal file
View File

@ -0,0 +1,53 @@
#define BACKTRACE_ELF_SIZE 64
#define BACKTRACE_XCOFF_SIZE unused
#define HAVE_ATOMIC_FUNCTIONS 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_DECL_GETPAGESIZE 1
#define HAVE_DECL_STRNLEN 1
#define HAVE_DLFCN_H 1
#define HAVE_DL_ITERATE_PHDR 1
#if defined(__linux__)
#define HAVE_FCNTL 1
#endif
#define HAVE_GETIPINFO 1
#define HAVE_INTTYPES_H 1
#define HAVE_LINK_H 1
#define HAVE_LSTAT 1
#define HAVE_MEMORY_H 1
#define HAVE_READLINK 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYNC_FUNCTIONS 1
#define HAVE_SYS_MMAN_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define LT_OBJDIR ".libs/"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "package-unused"
#define PACKAGE_STRING "package-unused version-unused"
#define PACKAGE_TARNAME "libbacktrace"
#define PACKAGE_URL ""
#define PACKAGE_VERSION "version-unused"
#define STDC_HEADERS 1
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
#pragma once

View File

@ -1148,7 +1148,10 @@ JSValue tf_task_allocate_promise(tf_task_t* task, promiseid_t* out_promise)
uint32_t stack_hash = fnv32a((const void*)stack, (int)length, 0);
int count = 0;
void* buffer[32];
#ifndef _WIN32
#ifdef _WIN32
count = CaptureStackBackTrace(0, sizeof(buffer) / sizeof(*buffer), buffer, NULL);
stack_hash = fnv32a((const void*)buffer, sizeof(void*) * count, stack_hash);
#else
count = backtrace(buffer, sizeof(buffer) / sizeof(*buffer));
stack_hash = fnv32a((const void*)buffer, sizeof(void*) * count, stack_hash);
#endif