From 24f7f455d4d4d77808703dd475180014186f6526 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 22 Jan 2025 23:06:32 +0000 Subject: [PATCH] chore: Initial macos support in bazel build. --- .bazelrc | 16 +- .github/workflows/ci.yml | 11 ++ .restyled.yaml | 5 +- c-toxcore | 2 +- third_party/libbacktrace.BUILD | 6 +- third_party/libbacktrace/BUILD.bazel | 27 +++ .../linux-arm64/backtrace-supported.h | 66 +++++++ third_party/libbacktrace/linux-arm64/config.h | 186 ++++++++++++++++++ .../linux-x86_64/backtrace-supported.h | 66 +++++++ .../libbacktrace/linux-x86_64/config.h | 186 ++++++++++++++++++ .../macos-arm64/backtrace-supported.h | 66 +++++++ third_party/libbacktrace/macos-arm64/config.h | 186 ++++++++++++++++++ .../windows-x86_64/backtrace-supported.h | 66 +++++++ .../libbacktrace/windows-x86_64/config.h | 186 ++++++++++++++++++ third_party/libsodium.BUILD | 30 +-- .../config/{arm64.h => linux-arm64.h} | 0 third_party/libsodium/config/macos-arm64.h | 75 +++++++ tools/config/BUILD.bazel | 17 ++ 18 files changed, 1171 insertions(+), 26 deletions(-) create mode 100644 third_party/libbacktrace/BUILD.bazel create mode 100755 third_party/libbacktrace/linux-arm64/backtrace-supported.h create mode 100755 third_party/libbacktrace/linux-arm64/config.h create mode 100755 third_party/libbacktrace/linux-x86_64/backtrace-supported.h create mode 100755 third_party/libbacktrace/linux-x86_64/config.h create mode 100755 third_party/libbacktrace/macos-arm64/backtrace-supported.h create mode 100755 third_party/libbacktrace/macos-arm64/config.h create mode 100755 third_party/libbacktrace/windows-x86_64/backtrace-supported.h create mode 100755 third_party/libbacktrace/windows-x86_64/config.h rename third_party/libsodium/config/{arm64.h => linux-arm64.h} (100%) create mode 100755 third_party/libsodium/config/macos-arm64.h diff --git a/.bazelrc b/.bazelrc index bc4983dd..7bb3ae76 100644 --- a/.bazelrc +++ b/.bazelrc @@ -34,7 +34,6 @@ build --features=layering_check build --experimental_inmemory_dotd_files build --experimental_inmemory_jdeps_files -build --experimental_omitfp build --experimental_remotable_source_manifests build --experimental_remote_merkle_tree_cache build --experimental_remote_require_cached @@ -114,11 +113,12 @@ build:remote-exec --remote_download_outputs=all # Flags for systems with GNU linker or compatible. -build --host_linkopt='-fPIE' -build --host_linkopt='-Wl,-z,defs' -build --linkopt='-Wl,-z,noexecstack' -build --host_linkopt='-Wl,-z,noexecstack' -build --host_linkopt='-Wl,--warn-execstack' +build:linux --experimental_omitfp +build:linux --host_linkopt='-fPIE' +build:linux --host_linkopt='-Wl,-z,defs' +build:linux --linkopt='-Wl,-z,noexecstack' +build:linux --host_linkopt='-Wl,-z,noexecstack' +build:linux --host_linkopt='-Wl,--warn-execstack' #build:local --linkopt='-Wl,--fatal-warnings' #build:local --host_linkopt='-Wl,--fatal-warnings' @@ -557,6 +557,7 @@ build --per_file_copt='external[:/]@-Wno-unused-macros' build --per_file_copt='external[:/]@-Wno-unused-template' build --per_file_copt='external[:/]@-Wno-weak-vtables' build --per_file_copt='external[:/]@-Wno-zero-as-null-pointer-constant' +build --per_file_copt='external/benchmark[:/]@-Wno-unused-member-function' build --per_file_copt='external/boringssl[:/]@-Wno-c11-extensions' build --per_file_copt='external/boringssl[:/]@-Wno-cast-function-type' build --per_file_copt='external/boringssl[:/]@-Wno-extra-semi' @@ -619,6 +620,8 @@ build --per_file_copt='external/ffmpeg[:/]@-Wno-unused-const-variable' build --per_file_copt='external/ffmpeg[:/]@-Wno-unused-function' build --per_file_copt='external/ffmpeg[:/]@-Wno-unused' build --per_file_copt='external/libbacktrace[:/]@-Wno-atomic-implicit-seq-cst' +build --per_file_copt='external/libbacktrace[:/]@-Wno-pedantic' +build --per_file_copt='external/libbacktrace[:/]@-Wno-unused-but-set-variable' build --per_file_copt='external/libcap[:/]@-Wno-gnu-zero-variadic-macro-arguments' build --per_file_copt='external/libcap[:/]@-Wno-sign-compare' build --per_file_copt='external/libcap[:/]@-Wno-tautological-unsigned-enum-zero-compare' @@ -631,6 +634,7 @@ build --per_file_copt='external/libidn2[:/]@-Wno-pedantic' build --per_file_copt='external/libidn2[:/]@-Wno-sign-compare' build --per_file_copt='external/libidn2[:/]@-Wno-unused-const-variable' build --per_file_copt='external/libqrencode[:/]@-Wno-tautological-unsigned-enum-zero-compare' +build --per_file_copt='external/libsodium[:/]@-Wno-vector-conversion' build --per_file_copt='external/libsodium[:/]@-Wno-unknown-pragmas' build --per_file_copt='external/libsodium[:/]@-Wno-unused-but-set-variable' build --per_file_copt='external/libsodium[:/]@-Wno-unused-function' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 521aa1c6..20917d5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,6 +117,17 @@ jobs: nix-shell -p patchelf --run "patchelf --version" bazel test --config=local --config=remote -- //... -//jvm-toxcore-c/... -//third_party/... + macos: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install Nix + run: sh <(curl -L https://nixos.org/nix/install) --yes + - name: Build + run: bazel test --config=remote //c-toxcore/toxcore/... + mypy: runs-on: ubuntu-22.04 steps: diff --git a/.restyled.yaml b/.restyled.yaml index c42ef595..c4b99bc9 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -4,9 +4,10 @@ exclude: - "third_party/ffmpeg/**/*.[ch]" - "third_party/haskell/alex/templates/*.hs" - "third_party/haskell/happy/templates/*" - - "third_party/libsodium/version.h" - - "third_party/libzmq/**/*.hpp" + - "third_party/libbacktrace/**/*.h" + - "third_party/libsodium/**/*.h" - "third_party/libvpx/**/*.h" - "third_party/libvpx/**/*.mk" + - "third_party/libzmq/**/*.hpp" - "third_party/ncurses/src/**/*" - "third_party/opus/**/*.h" diff --git a/c-toxcore b/c-toxcore index f276b397..463eeae1 160000 --- a/c-toxcore +++ b/c-toxcore @@ -1 +1 @@ -Subproject commit f276b397226074b89a6bedb14a87c3a87487e8ed +Subproject commit 463eeae1144e5b8549e3c425f1497e04b7e8c173 diff --git a/third_party/libbacktrace.BUILD b/third_party/libbacktrace.BUILD index 55f4b8f8..4f51231a 100644 --- a/third_party/libbacktrace.BUILD +++ b/third_party/libbacktrace.BUILD @@ -20,7 +20,7 @@ genrule( ], cmd = """ SRCDIR="$$(dirname $(location configure))" - "$$SRCDIR/configure" CC="$(CC)" CXX="$(CC)" AR="$(AR)" \ + "$$SRCDIR/configure" CC="$(CC)" AR="$(AR)" LD="$(CC)" \ || (cat config.log && false) sed -i -e 's/#define BACKTRACE_ELF_SIZE unused/#define BACKTRACE_ELF_SIZE 64/' config.h @@ -37,8 +37,6 @@ cc_library( "atomic.c", "backtrace.c", "backtrace.h", - "backtrace-supported.h", - "config.h", "dwarf.c", "elf.c", "fileline.c", @@ -49,6 +47,8 @@ cc_library( "read.c", "sort.c", "state.c", + "@toktok//third_party/libbacktrace:config", ], + copts = ["-I$(GENDIR)/third_party/libbacktrace"], visibility = ["//visibility:public"], ) diff --git a/third_party/libbacktrace/BUILD.bazel b/third_party/libbacktrace/BUILD.bazel new file mode 100644 index 00000000..19e10077 --- /dev/null +++ b/third_party/libbacktrace/BUILD.bazel @@ -0,0 +1,27 @@ +genrule( + name = "config", + srcs = select({ + "@toktok//tools/config:linux-arm64": [ + "linux-arm64/backtrace-supported.h", + "linux-arm64/config.h", + ], + "@toktok//tools/config:linux-x86_64": [ + "linux-x86_64/backtrace-supported.h", + "linux-x86_64/config.h", + ], + "@toktok//tools/config:macos-arm64": [ + "macos-arm64/backtrace-supported.h", + "macos-arm64/config.h", + ], + "@toktok//tools/config:windows-x86_64": [ + "windows-x86_64/backtrace-supported.h", + "windows-x86_64/config.h", + ], + }), + outs = [ + "config.h", + "backtrace-supported.h", + ], + cmd = "cp $(SRCS) $$(dirname $(location config.h))", + visibility = ["@libbacktrace//:__pkg__"], +) diff --git a/third_party/libbacktrace/linux-arm64/backtrace-supported.h b/third_party/libbacktrace/linux-arm64/backtrace-supported.h new file mode 100755 index 00000000..76cc9525 --- /dev/null +++ b/third_party/libbacktrace/linux-arm64/backtrace-supported.h @@ -0,0 +1,66 @@ +/* backtrace-supported.h.in -- Whether stack backtrace is supported. + Copyright (C) 2012-2024 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Google. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3) The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. */ + +/* The file backtrace-supported.h.in is used by configure to generate + the file backtrace-supported.h. The file backtrace-supported.h may + be #include'd to see whether the backtrace library will be able to + get a backtrace and produce symbolic information. */ + + +/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library + should work, 0 if it will not. Libraries may #include this to make + other arrangements. */ + +#define BACKTRACE_SUPPORTED 0 + +/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace + library will call malloc as it works, 0 if it will call mmap + instead. This may be used to determine whether it is safe to call + the backtrace functions from a signal handler. In general this + only applies to calls like backtrace and backtrace_pcinfo. It does + not apply to backtrace_simple, which never calls malloc. It does + not apply to backtrace_print, which always calls fprintf and + therefore malloc. */ + +#define BACKTRACE_USES_MALLOC 0 + +/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace + library is configured with threading support, 0 if not. If this is + 0, the threaded parameter to backtrace_create_state must be passed + as 0. */ + +#define BACKTRACE_SUPPORTS_THREADS 1 + +/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo + will work for variables. It will always work for functions. */ + +#define BACKTRACE_SUPPORTS_DATA 1 diff --git a/third_party/libbacktrace/linux-arm64/config.h b/third_party/libbacktrace/linux-arm64/config.h new file mode 100755 index 00000000..a290cf69 --- /dev/null +++ b/third_party/libbacktrace/linux-arm64/config.h @@ -0,0 +1,186 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* ELF size: 32 or 64 */ +#define BACKTRACE_ELF_SIZE 64 + +/* XCOFF size: 32 or 64 */ +#define BACKTRACE_XCOFF_SIZE unused + +/* Define to 1 if you have the __atomic functions */ +#define HAVE_ATOMIC_FUNCTIONS 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you + don't. */ +#define HAVE_DECL_GETPAGESIZE 1 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you + don't. */ +#define HAVE_DECL__PGMPTR 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if dl_iterate_phdr is available. */ +#define HAVE_DL_ITERATE_PHDR 1 + +/* Define to 1 if you have the fcntl function */ +#define HAVE_FCNTL 1 + +/* Define if getexecname is available. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define if _Unwind_GetIPInfo is available. */ +#define HAVE_GETIPINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in . + */ +/* #undef HAVE_KERN_PROC */ + +/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in + . */ +/* #undef HAVE_KERN_PROC_ARGS */ + +/* Define if -llzma is available. */ +/* #undef HAVE_LIBLZMA */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINK_H 1 + +/* Define if AIX loadquery is available. */ +/* #undef HAVE_LOADQUERY */ + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `readlink' function. */ +#define HAVE_READLINK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the __sync functions */ +#define HAVE_SYNC_FUNCTIONS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LDR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LINK_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TLHELP32_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define if -lz is available. */ +/* #undef HAVE_ZLIB */ + +/* Define if -lzstd is available. */ +/* #undef HAVE_ZSTD */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "package-unused" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "package-unused version-unused" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libbacktrace" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-unused" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/third_party/libbacktrace/linux-x86_64/backtrace-supported.h b/third_party/libbacktrace/linux-x86_64/backtrace-supported.h new file mode 100755 index 00000000..76cc9525 --- /dev/null +++ b/third_party/libbacktrace/linux-x86_64/backtrace-supported.h @@ -0,0 +1,66 @@ +/* backtrace-supported.h.in -- Whether stack backtrace is supported. + Copyright (C) 2012-2024 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Google. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3) The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. */ + +/* The file backtrace-supported.h.in is used by configure to generate + the file backtrace-supported.h. The file backtrace-supported.h may + be #include'd to see whether the backtrace library will be able to + get a backtrace and produce symbolic information. */ + + +/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library + should work, 0 if it will not. Libraries may #include this to make + other arrangements. */ + +#define BACKTRACE_SUPPORTED 0 + +/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace + library will call malloc as it works, 0 if it will call mmap + instead. This may be used to determine whether it is safe to call + the backtrace functions from a signal handler. In general this + only applies to calls like backtrace and backtrace_pcinfo. It does + not apply to backtrace_simple, which never calls malloc. It does + not apply to backtrace_print, which always calls fprintf and + therefore malloc. */ + +#define BACKTRACE_USES_MALLOC 0 + +/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace + library is configured with threading support, 0 if not. If this is + 0, the threaded parameter to backtrace_create_state must be passed + as 0. */ + +#define BACKTRACE_SUPPORTS_THREADS 1 + +/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo + will work for variables. It will always work for functions. */ + +#define BACKTRACE_SUPPORTS_DATA 1 diff --git a/third_party/libbacktrace/linux-x86_64/config.h b/third_party/libbacktrace/linux-x86_64/config.h new file mode 100755 index 00000000..a290cf69 --- /dev/null +++ b/third_party/libbacktrace/linux-x86_64/config.h @@ -0,0 +1,186 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* ELF size: 32 or 64 */ +#define BACKTRACE_ELF_SIZE 64 + +/* XCOFF size: 32 or 64 */ +#define BACKTRACE_XCOFF_SIZE unused + +/* Define to 1 if you have the __atomic functions */ +#define HAVE_ATOMIC_FUNCTIONS 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you + don't. */ +#define HAVE_DECL_GETPAGESIZE 1 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you + don't. */ +#define HAVE_DECL__PGMPTR 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if dl_iterate_phdr is available. */ +#define HAVE_DL_ITERATE_PHDR 1 + +/* Define to 1 if you have the fcntl function */ +#define HAVE_FCNTL 1 + +/* Define if getexecname is available. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define if _Unwind_GetIPInfo is available. */ +#define HAVE_GETIPINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in . + */ +/* #undef HAVE_KERN_PROC */ + +/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in + . */ +/* #undef HAVE_KERN_PROC_ARGS */ + +/* Define if -llzma is available. */ +/* #undef HAVE_LIBLZMA */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINK_H 1 + +/* Define if AIX loadquery is available. */ +/* #undef HAVE_LOADQUERY */ + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `readlink' function. */ +#define HAVE_READLINK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the __sync functions */ +#define HAVE_SYNC_FUNCTIONS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LDR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LINK_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TLHELP32_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define if -lz is available. */ +/* #undef HAVE_ZLIB */ + +/* Define if -lzstd is available. */ +/* #undef HAVE_ZSTD */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "package-unused" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "package-unused version-unused" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libbacktrace" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-unused" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/third_party/libbacktrace/macos-arm64/backtrace-supported.h b/third_party/libbacktrace/macos-arm64/backtrace-supported.h new file mode 100755 index 00000000..29280af5 --- /dev/null +++ b/third_party/libbacktrace/macos-arm64/backtrace-supported.h @@ -0,0 +1,66 @@ +/* backtrace-supported.h.in -- Whether stack backtrace is supported. + Copyright (C) 2012-2024 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Google. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3) The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. */ + +/* The file backtrace-supported.h.in is used by configure to generate + the file backtrace-supported.h. The file backtrace-supported.h may + be #include'd to see whether the backtrace library will be able to + get a backtrace and produce symbolic information. */ + + +/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library + should work, 0 if it will not. Libraries may #include this to make + other arrangements. */ + +#define BACKTRACE_SUPPORTED 0 + +/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace + library will call malloc as it works, 0 if it will call mmap + instead. This may be used to determine whether it is safe to call + the backtrace functions from a signal handler. In general this + only applies to calls like backtrace and backtrace_pcinfo. It does + not apply to backtrace_simple, which never calls malloc. It does + not apply to backtrace_print, which always calls fprintf and + therefore malloc. */ + +#define BACKTRACE_USES_MALLOC 1 + +/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace + library is configured with threading support, 0 if not. If this is + 0, the threaded parameter to backtrace_create_state must be passed + as 0. */ + +#define BACKTRACE_SUPPORTS_THREADS 0 + +/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo + will work for variables. It will always work for functions. */ + +#define BACKTRACE_SUPPORTS_DATA 1 diff --git a/third_party/libbacktrace/macos-arm64/config.h b/third_party/libbacktrace/macos-arm64/config.h new file mode 100755 index 00000000..b73b43fe --- /dev/null +++ b/third_party/libbacktrace/macos-arm64/config.h @@ -0,0 +1,186 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* ELF size: 32 or 64 */ +#define BACKTRACE_ELF_SIZE 64 + +/* XCOFF size: 32 or 64 */ +#define BACKTRACE_XCOFF_SIZE unused + +/* Define to 1 if you have the __atomic functions */ +/* #undef HAVE_ATOMIC_FUNCTIONS */ + +/* Define to 1 if you have the `clock_gettime' function. */ +/* #undef HAVE_CLOCK_GETTIME */ + +/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you + don't. */ +#define HAVE_DECL_GETPAGESIZE 1 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you + don't. */ +#define HAVE_DECL__PGMPTR 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if dl_iterate_phdr is available. */ +/* #undef HAVE_DL_ITERATE_PHDR */ + +/* Define to 1 if you have the fcntl function */ +/* #undef HAVE_FCNTL */ + +/* Define if getexecname is available. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define if _Unwind_GetIPInfo is available. */ +/* #undef HAVE_GETIPINFO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in . + */ +/* #undef HAVE_KERN_PROC */ + +/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in + . */ +/* #undef HAVE_KERN_PROC_ARGS */ + +/* Define if -llzma is available. */ +/* #undef HAVE_LIBLZMA */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINK_H */ + +/* Define if AIX loadquery is available. */ +/* #undef HAVE_LOADQUERY */ + +/* Define to 1 if you have the `lstat' function. */ +/* #undef HAVE_LSTAT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MACH_O_DYLD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `readlink' function. */ +/* #undef HAVE_READLINK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the __sync functions */ +/* #undef HAVE_SYNC_FUNCTIONS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LDR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LINK_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TLHELP32_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define if -lz is available. */ +/* #undef HAVE_ZLIB */ + +/* Define if -lzstd is available. */ +/* #undef HAVE_ZSTD */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "package-unused" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "package-unused version-unused" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libbacktrace" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-unused" + +/* Define to 1 if you have the ANSI C header files. */ +/* #undef STDC_HEADERS */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/third_party/libbacktrace/windows-x86_64/backtrace-supported.h b/third_party/libbacktrace/windows-x86_64/backtrace-supported.h new file mode 100755 index 00000000..cb0ed29b --- /dev/null +++ b/third_party/libbacktrace/windows-x86_64/backtrace-supported.h @@ -0,0 +1,66 @@ +/* backtrace-supported.h.in -- Whether stack backtrace is supported. + Copyright (C) 2012-2024 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Google. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3) The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. */ + +/* The file backtrace-supported.h.in is used by configure to generate + the file backtrace-supported.h. The file backtrace-supported.h may + be #include'd to see whether the backtrace library will be able to + get a backtrace and produce symbolic information. */ + + +/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library + should work, 0 if it will not. Libraries may #include this to make + other arrangements. */ + +#define BACKTRACE_SUPPORTED 0 + +/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace + library will call malloc as it works, 0 if it will call mmap + instead. This may be used to determine whether it is safe to call + the backtrace functions from a signal handler. In general this + only applies to calls like backtrace and backtrace_pcinfo. It does + not apply to backtrace_simple, which never calls malloc. It does + not apply to backtrace_print, which always calls fprintf and + therefore malloc. */ + +#define BACKTRACE_USES_MALLOC 1 + +/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace + library is configured with threading support, 0 if not. If this is + 0, the threaded parameter to backtrace_create_state must be passed + as 0. */ + +#define BACKTRACE_SUPPORTS_THREADS 1 + +/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo + will work for variables. It will always work for functions. */ + +#define BACKTRACE_SUPPORTS_DATA 1 diff --git a/third_party/libbacktrace/windows-x86_64/config.h b/third_party/libbacktrace/windows-x86_64/config.h new file mode 100755 index 00000000..00cd8a46 --- /dev/null +++ b/third_party/libbacktrace/windows-x86_64/config.h @@ -0,0 +1,186 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* ELF size: 32 or 64 */ +#define BACKTRACE_ELF_SIZE 64 + +/* XCOFF size: 32 or 64 */ +#define BACKTRACE_XCOFF_SIZE unused + +/* Define to 1 if you have the __atomic functions */ +#define HAVE_ATOMIC_FUNCTIONS 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +/* #undef HAVE_CLOCK_GETTIME */ + +/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you + don't. */ +#define HAVE_DECL_GETPAGESIZE 0 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you + don't. */ +#define HAVE_DECL__PGMPTR 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if dl_iterate_phdr is available. */ +/* #undef HAVE_DL_ITERATE_PHDR */ + +/* Define to 1 if you have the fcntl function */ +/* #undef HAVE_FCNTL */ + +/* Define if getexecname is available. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define if _Unwind_GetIPInfo is available. */ +#define HAVE_GETIPINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in . + */ +/* #undef HAVE_KERN_PROC */ + +/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in + . */ +/* #undef HAVE_KERN_PROC_ARGS */ + +/* Define if -llzma is available. */ +/* #undef HAVE_LIBLZMA */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINK_H */ + +/* Define if AIX loadquery is available. */ +/* #undef HAVE_LOADQUERY */ + +/* Define to 1 if you have the `lstat' function. */ +/* #undef HAVE_LSTAT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `readlink' function. */ +/* #undef HAVE_READLINK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the __sync functions */ +#define HAVE_SYNC_FUNCTIONS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LDR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LINK_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TLHELP32_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WINDOWS_H 1 + +/* Define if -lz is available. */ +/* #undef HAVE_ZLIB */ + +/* Define if -lzstd is available. */ +/* #undef HAVE_ZSTD */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "package-unused" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "package-unused version-unused" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libbacktrace" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-unused" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/third_party/libsodium.BUILD b/third_party/libsodium.BUILD index 03b1c68e..60b355c7 100644 --- a/third_party/libsodium.BUILD +++ b/third_party/libsodium.BUILD @@ -17,19 +17,19 @@ genrule( "src/sodium_config.h", ], cmd = """ - BASE=`pwd` - export PATH="$$PATH:$$BASE/$$(dirname $(location @autoconf//:autoconf))" - export PATH="$$PATH:$$BASE/$$(dirname $(location @automake//:aclocal))" - export PATH="$$PATH:$$BASE/$$(dirname $(location @diffutils//:cmp))" - export PATH="$$PATH:$$BASE/$$(dirname $(location @libtool//:libtoolize))" - export PATH="$$PATH:$$BASE/$$(dirname $(location @m4))" - cd "$$(dirname $(location configure.ac))" - autoreconf -fi - ./configure CC="$(CC)" MAKE="$$BASE/$(location @gnumake)" || (cat config.log && false) - cd - - find . -name sodium_config.h - cp "$$(dirname $(location configure.ac))/src/libsodium/include/sodium/version.h" "$(location src/libsodium/include/sodium/version.h)" - grep '^DEFS = ' $$(dirname $(location configure.ac))/Makefile $(location src/libsodium/include/sodium/version.h) \\ + export PATH="$$PATH:$$PWD/$$(dirname $(location @autoconf//:autoconf))" + export PATH="$$PATH:$$PWD/$$(dirname $(location @automake//:aclocal))" + export PATH="$$PATH:$$PWD/$$(dirname $(location @diffutils//:cmp))" + export PATH="$$PATH:$$PWD/$$(dirname $(location @gnumake))" + export PATH="$$PATH:$$PWD/$$(dirname $(location @libtool//:libtoolize))" + export PATH="$$PATH:$$PWD/$$(dirname $(location @m4))" + + SRCDIR="$$(dirname $(location configure.ac))" + autoreconf -fi -I "$$PWD/$$(dirname $(location @libtool//:libtool.m4))" "$$SRCDIR" + "$$SRCDIR/configure" CC="$(CC)" || (cat config.log && false) + + cp "src/libsodium/include/sodium/version.h" "$(location src/libsodium/include/sodium/version.h)" + grep '^DEFS = ' Makefile $(location src/libsodium/include/sodium/version.h) \\ | grep -E -o -- '-D([^ ]|\\\\ )+' \\ | sed -e 's/^-D/#define /;s/=/ /;s/\\\\//g' \\ > "$(location src/sodium_config.h)" @@ -42,6 +42,7 @@ genrule( "@automake//:aclocal", "@diffutils//:cmp", "@gnumake", + "@libtool//:libtool.m4", "@libtool//:libtoolize", "@m4", ], @@ -76,8 +77,9 @@ SRCS_X86_64 = [ alias( name = "config", actual = select({ - "@toktok//tools/config:arm64": "@toktok//third_party/libsodium:config/arm64.h", + "@toktok//tools/config:linux-arm64": "@toktok//third_party/libsodium:config/linux-arm64.h", "@toktok//tools/config:linux-x86_64": "@toktok//third_party/libsodium:config/linux-x86_64.h", + "@toktok//tools/config:macos-arm64": "@toktok//third_party/libsodium:config/macos-arm64.h", "@toktok//tools/config:windows-x86_64": "@toktok//third_party/libsodium:config/windows-x86_64.h", }), ) diff --git a/third_party/libsodium/config/arm64.h b/third_party/libsodium/config/linux-arm64.h similarity index 100% rename from third_party/libsodium/config/arm64.h rename to third_party/libsodium/config/linux-arm64.h diff --git a/third_party/libsodium/config/macos-arm64.h b/third_party/libsodium/config/macos-arm64.h new file mode 100755 index 00000000..f82d9dad --- /dev/null +++ b/third_party/libsodium/config/macos-arm64.h @@ -0,0 +1,75 @@ +#define PACKAGE_NAME "libsodium" +#define PACKAGE_TARNAME "libsodium" +#define PACKAGE_VERSION "1.0.20" +#define PACKAGE_STRING "libsodium 1.0.20" +#define PACKAGE_BUGREPORT "https://github.com/jedisct1/libsodium/issues" +#define PACKAGE_URL "https://libsodium.org" +#define PACKAGE "libsodium" +#define VERSION "1.0.20" +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_WCHAR_H 1 +#define STDC_HEADERS 1 +#define _ALL_SOURCE 1 +#define _DARWIN_C_SOURCE 1 +#define _GNU_SOURCE 1 +#define _HPUX_ALT_XOPEN_SOCKET_API 1 +#define _NETBSD_SOURCE 1 +#define _OPENBSD_SOURCE 1 +#define _POSIX_PTHREAD_SEMANTICS 1 +#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1 +#define __STDC_WANT_IEC_60559_BFP_EXT__ 1 +#define __STDC_WANT_IEC_60559_DFP_EXT__ 1 +#define __STDC_WANT_IEC_60559_EXT__ 1 +#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 +#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 +#define __STDC_WANT_LIB_EXT2__ 1 +#define __STDC_WANT_MATH_SPEC_FUNCS__ 1 +#define _TANDEM_SOURCE 1 +#define __EXTENSIONS__ 1 +#define HAVE_PTHREAD_PRIO_INHERIT 1 +#define HAVE_PTHREAD 1 +#define HAVE_C_VARARRAYS 1 +#define HAVE_CATCHABLE_SEGV 1 +#define HAVE_CATCHABLE_ABRT 1 +#define TLS _Thread_local +#define HAVE_DLFCN_H 1 +#define LT_OBJDIR ".libs/" +#define HAVE_ARMCRYPTO 1 +#define HAVE_SYS_MMAN_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_RANDOM_H 1 +#define HAVE_COMMONCRYPTO_COMMONRANDOM_H 1 +#define HAVE_CET_H 1 +#define NATIVE_LITTLE_ENDIAN 1 +#define HAVE_INLINE_ASM 1 +#define HAVE_TI_MODE 1 +#define ASM_HIDE_SYMBOL .private_extern +#define HAVE_WEAK_SYMBOLS 1 +#define HAVE_ATOMIC_OPS 1 +#define HAVE_C11_MEMORY_FENCES 1 +#define HAVE_GCC_MEMORY_FENCES 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_ALLOCA 1 +#define HAVE_ARC4RANDOM 1 +#define HAVE_ARC4RANDOM_BUF 1 +#define HAVE_MMAP 1 +#define HAVE_MLOCK 1 +#define HAVE_MADVISE 1 +#define HAVE_MPROTECT 1 +#define HAVE_RAISE 1 +#define HAVE_SYSCONF 1 +#define HAVE_GETENTROPY 1 +#define HAVE_GETPID 1 +#define HAVE_POSIX_MEMALIGN 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_CLOCK_GETTIME 1 +#define HAVE_MEMSET_S 1 +#define CONFIGURED 1 diff --git a/tools/config/BUILD.bazel b/tools/config/BUILD.bazel index 52991485..20549d33 100644 --- a/tools/config/BUILD.bazel +++ b/tools/config/BUILD.bazel @@ -10,9 +10,17 @@ config_setting( visibility = ["//visibility:public"], ) +config_setting( + name = "macos", + constraint_values = ["@platforms//os:osx"], + visibility = ["//visibility:public"], +) + +# deprecated config_setting( name = "osx", constraint_values = ["@platforms//os:osx"], + # deprecated = True, visibility = ["//visibility:public"], ) @@ -34,6 +42,15 @@ config_setting( visibility = ["//visibility:public"], ) +config_setting( + name = "macos-arm64", + constraint_values = [ + "@platforms//os:osx", + "@platforms//cpu:arm64", + ], + visibility = ["//visibility:public"], +) + config_setting( name = "linux-arm64", constraint_values = [