Skip to content

Commit

Permalink
YT-19210: expose YQL shared library for YT.
Browse files Browse the repository at this point in the history
After this, a new target libyqlplugin.so appears. in open-source cmake build.
Diff in open-source YDB repo looks like the following: https://paste.yandex-team.ru/f302bdb4-7ef2-4362-91c7-6ca45f329264
  • Loading branch information
zlobober committed Jul 28, 2023
1 parent 528e321 commit 73b89de
Show file tree
Hide file tree
Showing 2,127 changed files with 377,412 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.darwin-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ add_subdirectory(tools)
add_subdirectory(contrib)
add_subdirectory(library)
add_subdirectory(util)
add_subdirectory(ydb)
add_subdirectory(yt)
add_subdirectory(certs)
add_subdirectory(ydb)
3 changes: 2 additions & 1 deletion CMakeLists.linux-aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ add_subdirectory(tools)
add_subdirectory(contrib)
add_subdirectory(library)
add_subdirectory(util)
add_subdirectory(ydb)
add_subdirectory(yt)
add_subdirectory(certs)
add_subdirectory(ydb)
3 changes: 2 additions & 1 deletion CMakeLists.linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ add_subdirectory(tools)
add_subdirectory(contrib)
add_subdirectory(library)
add_subdirectory(util)
add_subdirectory(ydb)
add_subdirectory(yt)
add_subdirectory(certs)
add_subdirectory(ydb)
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ include(cmake/conan.cmake)
include(cmake/global_flags.cmake)
include(cmake/llvm-tools.cmake)
include(cmake/protobuf.cmake)
include(cmake/shared_libs.cmake)
include(cmake/global_vars.cmake)

if (CMAKE_CROSSCOMPILING)
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.windows-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ add_subdirectory(tools)
add_subdirectory(contrib)
add_subdirectory(util)
add_subdirectory(library)
add_subdirectory(ydb)
add_subdirectory(yt)
add_subdirectory(certs)
add_subdirectory(ydb)
9 changes: 9 additions & 0 deletions cmake/shared_libs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_custom_target(all-shared-libs)

function(add_shared_library Tgt)
add_library(${Tgt} SHARED ${ARGN})
add_dependencies(all-shared-libs ${Tgt})
if (NOT CMAKE_POSITION_INDEPENDENT_CODE)
set_property(TARGET ${Tgt} PROPERTY EXCLUDE_FROM_ALL On)
endif()
endfunction()
1 change: 1 addition & 0 deletions contrib/libs/CMakeLists.darwin-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ add_subdirectory(tbb)
add_subdirectory(tcmalloc)
add_subdirectory(utf8proc)
add_subdirectory(xxhash)
add_subdirectory(yajl)
add_subdirectory(yaml-cpp)
add_subdirectory(zstd)
add_subdirectory(zstd06)
1 change: 1 addition & 0 deletions contrib/libs/CMakeLists.linux-aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ add_subdirectory(tbb)
add_subdirectory(tcmalloc)
add_subdirectory(utf8proc)
add_subdirectory(xxhash)
add_subdirectory(yajl)
add_subdirectory(yaml-cpp)
add_subdirectory(zstd)
add_subdirectory(zstd06)
1 change: 1 addition & 0 deletions contrib/libs/CMakeLists.linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ add_subdirectory(tbb)
add_subdirectory(tcmalloc)
add_subdirectory(utf8proc)
add_subdirectory(xxhash)
add_subdirectory(yajl)
add_subdirectory(yaml-cpp)
add_subdirectory(zstd)
add_subdirectory(zstd06)
1 change: 1 addition & 0 deletions contrib/libs/CMakeLists.windows-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ add_subdirectory(tbb)
add_subdirectory(tcmalloc)
add_subdirectory(utf8proc)
add_subdirectory(xxhash)
add_subdirectory(yajl)
add_subdirectory(yaml-cpp)
add_subdirectory(zstd)
add_subdirectory(zstd06)
29 changes: 29 additions & 0 deletions contrib/libs/backtrace/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2012-2016 Free Software Foundation, Inc.

# 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.
36 changes: 36 additions & 0 deletions contrib/libs/backtrace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# libbacktrace
A C library that may be linked into a C/C++ program to produce symbolic backtraces

Initially written by Ian Lance Taylor <[email protected]>.

This is version 1.0.
It is likely that this will always be version 1.0.

The libbacktrace library may be linked into a program or library and
used to produce symbolic backtraces.
Sample uses would be to print a detailed backtrace when an error
occurs or to gather detailed profiling information.
In general the functions provided by this library are async-signal-safe,
meaning that they may be safely called from a signal handler.

The libbacktrace library is provided under a BSD license.
See the source files for the exact license text.

The public functions are declared and documented in the header file
backtrace.h, which should be #include'd by a user of the library.

Building libbacktrace will generate a file backtrace-supported.h,
which a user of the library may use to determine whether backtraces
will work.
See the source file backtrace-supported.h.in for the macros that it
defines.

As of October 2020, libbacktrace supports ELF, PE/COFF, Mach-O, and
XCOFF executables with DWARF debugging information.
In other words, it supports GNU/Linux, *BSD, macOS, Windows, and AIX.
The library is written to make it straightforward to add support for
other object file and debugging formats.

The library relies on the C++ unwind API defined at
https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
This API is provided by GCC and clang.
113 changes: 113 additions & 0 deletions contrib/libs/backtrace/atomic.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/* atomic.c -- Support for atomic functions if not present.
Copyright (C) 2013-2021 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. */

#include "config.h"

#include <sys/types.h>

#include "backtrace.h"
#include "backtrace-supported.h"
#include "internal.h"

/* This file holds implementations of the atomic functions that are
used if the host compiler has the sync functions but not the atomic
functions, as is true of versions of GCC before 4.7. */

#if !defined (HAVE_ATOMIC_FUNCTIONS) && defined (HAVE_SYNC_FUNCTIONS)

/* Do an atomic load of a pointer. */

void *
backtrace_atomic_load_pointer (void *arg)
{
void **pp;
void *p;

pp = (void **) arg;
p = *pp;
while (!__sync_bool_compare_and_swap (pp, p, p))
p = *pp;
return p;
}

/* Do an atomic load of an int. */

int
backtrace_atomic_load_int (int *p)
{
int i;

i = *p;
while (!__sync_bool_compare_and_swap (p, i, i))
i = *p;
return i;
}

/* Do an atomic store of a pointer. */

void
backtrace_atomic_store_pointer (void *arg, void *p)
{
void **pp;
void *old;

pp = (void **) arg;
old = *pp;
while (!__sync_bool_compare_and_swap (pp, old, p))
old = *pp;
}

/* Do an atomic store of a size_t value. */

void
backtrace_atomic_store_size_t (size_t *p, size_t v)
{
size_t old;

old = *p;
while (!__sync_bool_compare_and_swap (p, old, v))
old = *p;
}

/* Do an atomic store of a int value. */

void
backtrace_atomic_store_int (int *p, int v)
{
size_t old;

old = *p;
while (!__sync_bool_compare_and_swap (p, old, v))
old = *p;
}

#endif
66 changes: 66 additions & 0 deletions contrib/libs/backtrace/backtrace-supported.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* backtrace-supported.h.in -- Whether stack backtrace is supported.
Copyright (C) 2012-2021 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 1

/* 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
Loading

0 comments on commit 73b89de

Please sign in to comment.