Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hashtable backend
Browse files Browse the repository at this point in the history
Replace the ad-hoc arrays used to handle symbols with a hash table
imprementation provided by `tommyds` [1], in hopes of improving overall
performance of the relocation phase.

* Add `tommyds` submodule, and integrate it with building and
  (hopefully) CI
* Split `symbols` files into `symbols_lib` and `symbols_comp` for more
  modularity
* Replace symbol storage in `symbols_*.h` with `tommyds` hashtable
  implementations

[1] https://www.tommyds.it/doc/index.html
0152la committed Sep 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e9fccef commit d183b75
Showing 14 changed files with 307 additions and 185 deletions.
7 changes: 5 additions & 2 deletions .buildbot.sh
Original file line number Diff line number Diff line change
@@ -15,14 +15,17 @@ ${CLANG_FORMAT_BIN} --dry-run -Werror ${CLANG_FORMAT_SOURCES[*]}
# Update submodules
git submodule update --init

# Apply lua patch
# Apply `lua` patch
lua_dir="$src_dir/third-party/lua"
patch -d $lua_dir -i ../lua.patch

# Apply toml patch
# Apply `toml` patch
toml_dir="$src_dir/third-party/tomlc99"
patch -d $toml_dir -i ../tomlc99.patch

# Link `tommyds` Makefile appropriately
ln -s ./third-party/tommyds-makefile ./third-party/tommyds/tommyds/Makefile

# Prepare python virtual env
export PATH=$PATH:$HOME/.local/bin
pip3 install --break-system-packages fabric
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -4,3 +4,6 @@
[submodule "third-party/tomlc99"]
path = third-party/tomlc99
url = https://github.com/cktan/tomlc99
[submodule "third-party/tommyds"]
path = third-party/tommyds
url = [email protected]:amadvance/tommyds.git
23 changes: 22 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -48,13 +48,34 @@ add_custom_target(
toml
DEPENDS ${TOML_LIB_PATH}
)
add_library(tomllib SHARED IMPORTED)
add_library(tomllib STATIC IMPORTED)
add_dependencies(tomllib toml)
set_target_properties(tomllib
PROPERTIES
IMPORTED_LOCATION ${TOML_LIB_PATH}
)

# Build tommyds
set(TOMMYDS_DIR ${CMAKE_SOURCE_DIR}/third-party/tommyds/tommyds)
set(TOMMYDS_LIB ${CMAKE_SOURCE_DIR}/third-party/tommyds/tommyds/libtommyds.a)

add_custom_command(
OUTPUT ${TOMMYDS_LIB}
COMMAND make
WORKING_DIRECTORY ${TOMMYDS_DIR}
)

add_custom_target(
tommyds
DEPENDS ${TOMMYDS_LIB}
)
add_library(tommydslib STATIC IMPORTED)
add_dependencies(tommydslib tommyds)
set_target_properties(tommydslib
PROPERTIES
IMPORTED_LOCATION ${TOMMYDS_LIB}
)

# Build sources
add_subdirectory(${SRC_DIR})

3 changes: 2 additions & 1 deletion include/compartment.h
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@
#include <sys/stat.h>
#include <unistd.h>

#include "symbols.h"
// TODO consider re-organizing
#include "symbols_comp.h"

#include "cheriintrin.h"

66 changes: 4 additions & 62 deletions include/symbols.h
Original file line number Diff line number Diff line change
@@ -4,71 +4,13 @@
#include <err.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct simple_lds_list
{
struct LibDependencySymbol **data;
size_t data_count;
};
#include "tommy.h"

struct simple_cs_list
{
struct CompSymbol **data;
size_t data_count;
};

typedef struct simple_lds_list lib_symbol_list;
typedef struct LibDependencySymbol lib_symbol;

typedef struct simple_cs_list comp_symbol_list;
typedef struct CompSymbol comp_symbol;

/* Struct representing a symbol entry of a dependency library
*/
struct LibDependencySymbol
{
char *sym_name;
void *sym_offset;
unsigned short sym_type;
unsigned short sym_bind;
uint16_t sym_shndx;
};

/* Struct representing a wrapper around a LibDependencySymbol, in order to
* facilitate compartment-level searching
*/
struct CompSymbol
{
struct LibDependencySymbol *sym_ref;
size_t sym_lib_idx;
};

comp_symbol_list *
comp_syms_init();
void
comp_syms_clean(comp_symbol_list *);
void
comp_syms_clean_deep(comp_symbol_list *);
void
comp_syms_insert(comp_symbol *, comp_symbol_list *);
comp_symbol *
comp_syms_search(const char *, const comp_symbol_list *);
comp_symbol_list *
comp_syms_find_all(const char *, const comp_symbol_list *);

lib_symbol_list *
lib_syms_init();
void
lib_syms_clean(lib_symbol_list *);
void
lib_syms_clean_deep(lib_symbol_list *);
void
lib_syms_insert(lib_symbol *, lib_symbol_list *);
lib_symbol *
lib_syms_search(const char *, const lib_symbol_list *);
lib_symbol_list *
lib_syms_find_all(const char *, const lib_symbol_list *);
#define HASHTABLE_MAX_SZ 1024
#define hashtable_hash(x) tommy_hash_u64(0, x, strlen(x))

#endif // _CHERICOMP_SYMBOLS_H
35 changes: 35 additions & 0 deletions include/symbols_comp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef _CHERICOMP_SYMBOLS_COMP_H
#define _CHERICOMP_SYMBOLS_COMP_H

#include "symbols.h"
#include "symbols_lib.h"

typedef tommy_hashtable comp_symbol_list;
typedef struct CompSymbol comp_symbol;

/* Struct representing a wrapper around a LibDependencySymbol, in order to
* facilitate compartment-level searching
*/
struct CompSymbol
{
struct LibDependencySymbol *sym_ref;
size_t sym_lib_idx;
tommy_node node;
};

comp_symbol_list *
comp_syms_init();
void
comp_syms_clean(comp_symbol_list *);
void
comp_syms_clean_deep(comp_symbol_list *);
void
comp_syms_insert(comp_symbol *, comp_symbol_list *);
comp_symbol *
comp_syms_search(const char *, comp_symbol_list *);
comp_symbol **
comp_syms_find_all(const char *, comp_symbol_list *);

void update_comp_syms(comp_symbol_list*, lib_symbol_list *, const size_t);

#endif // _CHERICOMP_SYMBOLS_COMP_H
36 changes: 36 additions & 0 deletions include/symbols_lib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef _CHERICOMP_SYMBOLS_LIB_H
#define _CHERICOMP_SYMBOLS_LIB_H

#include "symbols.h"

typedef tommy_hashtable lib_symbol_list;
typedef struct LibDependencySymbol lib_symbol;

/* Struct representing a symbol entry of a dependency library
*/
struct LibDependencySymbol
{
char *sym_name;
void *sym_offset;
unsigned short sym_type;
unsigned short sym_bind;
uint16_t sym_shndx;
tommy_node node;
};

lib_symbol_list *
lib_syms_init();
void
lib_syms_clean(lib_symbol_list *);
void
lib_syms_clean_deep(lib_symbol_list *);
void
lib_syms_insert(lib_symbol *, lib_symbol_list *);
lib_symbol *
lib_syms_search(const char *, lib_symbol_list *);
lib_symbol **
lib_syms_find_all(const char *, lib_symbol_list *);
void
lib_syms_print(lib_symbol_list*);

#endif // _CHERICOMP_SYMBOLS_LIB_H
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ add_library(chcomp STATIC
symbols_lib.c
transition.S
)
target_include_directories(chcomp PRIVATE ${INCLUDE_DIR} ${TOML_INCLUDE_DIR})
target_link_libraries(chcomp PRIVATE tomllib)
target_include_directories(chcomp PRIVATE ${INCLUDE_DIR} ${TOML_INCLUDE_DIR} ${TOMMYDS_DIR})
target_link_libraries(chcomp PRIVATE tomllib tommydslib)

add_library(computils SHARED
comp_utils.c)
82 changes: 31 additions & 51 deletions src/compartment.c
Original file line number Diff line number Diff line change
@@ -23,8 +23,6 @@ parse_lib_rela(Elf64_Shdr *, Elf64_Ehdr *, int, struct LibDependency *);
static void
parse_lib_dynamic_deps(Elf64_Shdr *, Elf64_Ehdr *, int, struct LibDependency *);
static void
update_comp_syms(struct Compartment *, const lib_symbol_list *, const size_t);
static void
map_comp_entry_points(struct Compartment *);
static void
resolve_rela_syms(struct Compartment *);
@@ -438,7 +436,7 @@ parse_lib_file(char *lib_name, struct Compartment *new_comp)
lib_fd = open(lib_path, O_RDONLY);
if (lib_fd == -1)
{
errx(1, "Error opening compartment file %s!\n", lib_name);
errx(1, "Error opening compartment file %s!", lib_name);
}
}

@@ -449,7 +447,7 @@ parse_lib_file(char *lib_name, struct Compartment *new_comp)
{
errx(1,
"Error parsing `%s` - only supporting ELFs of type DYN (shared "
"object files)!\n",
"object files)!",
lib_path);
}

@@ -565,7 +563,7 @@ parse_lib_file(char *lib_name, struct Compartment *new_comp)
new_comp->libs = realloc(
new_comp->libs, new_comp->libs_count * sizeof(struct LibDependency *));
new_comp->libs[new_comp->libs_count - 1] = new_lib;
update_comp_syms(new_comp, new_lib->lib_syms, new_comp->libs_count - 1);
update_comp_syms(new_comp->comp_syms, new_lib->lib_syms, new_comp->libs_count - 1);

free(shstrtab);

@@ -888,25 +886,6 @@ parse_lib_dynamic_deps(Elf64_Shdr *dynamic_shdr, Elf64_Ehdr *lib_ehdr,
free(dyn_entries);
}

static void
update_comp_syms(struct Compartment *comp, const lib_symbol_list *lib_dep_syms,
const size_t lib_idx)
{
comp_symbol *new_cs;
for (size_t i = 0; i < lib_dep_syms->data_count; ++i)
{
// We do not want to record non-local symbols
if (lib_dep_syms->data[i]->sym_shndx == 0)
{
continue;
}
new_cs = malloc(sizeof(comp_symbol));
new_cs->sym_ref = lib_dep_syms->data[i];
new_cs->sym_lib_idx = lib_idx;
comp_syms_insert(new_cs, comp->comp_syms);
}
}

static void
map_comp_entry_points(struct Compartment *new_comp)
{
@@ -916,22 +895,23 @@ map_comp_entry_points(struct Compartment *new_comp)
// TODO is the main loaded library always the 0th indexed one?
const size_t lib_idx = 0;
const char *ep_name = new_comp->cc->entry_points[i].name;
lib_symbol_list *candidates
lib_symbol **candidates
= lib_syms_find_all(ep_name, new_comp->libs[lib_idx]->lib_syms);
size_t j = 0;
for (; j < candidates->data_count; ++j)
while (candidates)
{
if (check_lib_dep_sym(candidates->data[j], STT_FUNC))
if (check_lib_dep_sym(*candidates, STT_FUNC))
{
break;
}
*candidates += sizeof(lib_symbol*);
}
if (j == candidates->data_count)
if (!candidates)
{
errx(1, "Did not find entry point %s!\n", ep_name);
}
new_comp->cc->entry_points[i].comp_addr
= eval_lib_sym_offset(new_comp, lib_idx, candidates->data[j]);
= eval_lib_sym_offset(new_comp, lib_idx, *candidates);
free(candidates);
}
}
@@ -942,13 +922,14 @@ resolve_rela_syms(struct Compartment *new_comp)
// Find all symbols for eager relocation mapping
size_t prev_tls_secs_size = 0;
struct LibRelaMapping *curr_rela_map;
comp_symbol_list *candidate_syms;
comp_symbol **candidate_syms;
comp_symbol *chosen_sym;
for (size_t i = 0; i < new_comp->libs_count; ++i)
{
for (size_t j = 0; j < new_comp->libs[i]->rela_maps_count; ++j)
{
curr_rela_map = &new_comp->libs[i]->rela_maps[j];
chosen_sym = NULL;

// This is a TLS variable that exists in the current library; we
// just allocate the space for it
@@ -984,7 +965,7 @@ resolve_rela_syms(struct Compartment *new_comp)
candidate_syms = comp_syms_find_all(
curr_rela_map->rela_name, new_comp->comp_syms);

if (candidate_syms->data_count == 0)
if (*candidate_syms == NULL)
{
if (curr_rela_map->rela_sym_bind == STB_WEAK)
{
@@ -1012,43 +993,42 @@ resolve_rela_syms(struct Compartment *new_comp)
curr_rela_map->rela_name, curr_rela_map->rela_sym_type, j,
new_comp->libs[i]->lib_name, i);
}
// TODO caching

// Prioritise looking for weak symbols in libraries outside the
// source library, even if they are defined
if (curr_rela_map->rela_sym_bind == STB_WEAK)
{
int fallback_sym_id = -1;
size_t k = 0;
for (; k < candidate_syms->data_count; ++k)
comp_symbol* fallback_sym = NULL;
while (*candidate_syms)
{
if (!check_lib_dep_sym(candidate_syms->data[k]->sym_ref,
if (check_lib_dep_sym((*candidate_syms)->sym_ref,
curr_rela_map->rela_sym_type))
{
continue;
}
if (candidate_syms->data[k]->sym_lib_idx != i)
{
chosen_sym = candidate_syms->data[k];
break;
}
else
{
fallback_sym_id = k;
if ((*candidate_syms)->sym_lib_idx != i)
{
chosen_sym = *candidate_syms;
break;
}
else if (!fallback_sym)
{
fallback_sym = *candidate_syms;
}
}
candidate_syms += 1;
}
if (k == candidate_syms->data_count)
if (!chosen_sym)
{
assert(fallback_sym_id != -1);
chosen_sym = candidate_syms->data[fallback_sym_id];
assert(fallback_sym);
chosen_sym = fallback_sym;
}
}
else
{
// Choose the first candidate
// TODO is there a better choice?
chosen_sym = candidate_syms->data[0];
chosen_sym = *candidate_syms;
}
comp_syms_clean(candidate_syms);
free(candidate_syms);

if (curr_rela_map->rela_sym_type == STT_TLS)
{
121 changes: 91 additions & 30 deletions src/symbols_comp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
#include "symbols.h"
#include "symbols_comp.h"

/*******************************************************************************
* Forward static declarations
******************************************************************************/

static void comp_syms_clean_one_entry(void*);
static int comp_syms_compare(const void*, const void*);
static void comp_syms_print_one(void*);

/*******************************************************************************
* Helper functions
******************************************************************************/

static void
comp_syms_clean_one_entry(void *sym)
{
free(sym);
}

static int
comp_syms_compare(const void* arg, const void* item)
{
return strcmp((const char*) arg, ((const comp_symbol*) item)->sym_ref->sym_name);
}

static void
comp_syms_print_one(void* sym)
{
comp_symbol* comp_sym = (comp_symbol*) sym;
printf("COMP SYM ADDR %p - NAME %s - LIBSYM ADDR %p\n", sym, comp_sym->sym_ref->sym_name,
(void*) comp_sym->sym_ref);
}

/*******************************************************************************
* Main functions
@@ -8,65 +40,94 @@ comp_symbol_list *
comp_syms_init()
{
comp_symbol_list *new_list = malloc(sizeof(comp_symbol_list));
new_list->data_count = 0;
new_list->data = NULL;
tommy_hashtable_init(new_list, HASHTABLE_MAX_SZ);
return new_list;
}

void
comp_syms_clean(comp_symbol_list *list)
{
free(list->data);
tommy_hashtable_done(list);
free(list);
}

void
comp_syms_clean_deep(comp_symbol_list *list)
{
for (size_t i = 0; i < list->data_count; ++i)
{
free(list->data[i]);
}
tommy_hashtable_foreach(list, comp_syms_clean_one_entry);
comp_syms_clean(list);
}

void
comp_syms_insert(comp_symbol *to_insert, comp_symbol_list *list)
{
size_t curr_count = list->data_count;
list->data = realloc(list->data, (curr_count + 1) * sizeof(comp_symbol *));
if (list->data == NULL)
{
err(1, "Error inserting symbol %s in comp_list!",
to_insert->sym_ref->sym_name);
}
list->data[curr_count] = to_insert;
list->data_count += 1;
tommy_hashtable_insert(list, &to_insert->node, to_insert,
hashtable_hash(to_insert->sym_ref->sym_name));
}

comp_symbol *
comp_syms_search(const char *to_find, const comp_symbol_list *list)
comp_syms_search(const char *to_find, comp_symbol_list *list)
{
for (size_t i = 0; i < list->data_count; ++i)
comp_symbol* found = tommy_hashtable_search(list, comp_syms_compare,
to_find, hashtable_hash(to_find));
if (!found)
{
if (!strcmp(list->data[i]->sym_ref->sym_name, to_find))
{
return list->data[i];
}
errx(1, "Did not find symbol %s!\n", to_find);
}
errx(1, "Did not find symbol %s!\n", to_find);
return found;
}

comp_symbol_list *
comp_syms_find_all(const char *to_find, const comp_symbol_list *list)
comp_symbol **
comp_syms_find_all(const char *to_find, comp_symbol_list *list)
{
comp_symbol_list *res = comp_syms_init();
for (size_t i = 0; i < list->data_count; ++i)
comp_symbol** res = calloc(1024, sizeof(comp_symbol*));
unsigned int res_sz = 0;
tommy_hashtable_node* curr_node = tommy_hashtable_bucket(list, hashtable_hash(to_find));
while (curr_node)
{
if (!strcmp(list->data[i]->sym_ref->sym_name, to_find))
if (!strcmp(((comp_symbol*) curr_node->data)->sym_ref->sym_name, to_find))
{
comp_syms_insert(list->data[i], res);
res[res_sz] = (comp_symbol*) curr_node->data;
res_sz += 1;
}
curr_node = curr_node->next;
}
assert(res_sz < 1024);
res = realloc(res, (res_sz + 1) * sizeof(comp_symbol*));
return res;
}

/*******************************************************************************
* Specialised functions
******************************************************************************/

static void
gather_defined_sym(void* arg, void* sym)
{
lib_symbol* lib_sym = (lib_symbol*) sym;
if (lib_sym->sym_shndx != 0)
{
tommy_array_insert((tommy_array*) arg, lib_sym);
}
}

void
update_comp_syms(comp_symbol_list* comp_syms, lib_symbol_list *lib_syms,
const size_t lib_idx)
{
tommy_array to_update;
tommy_array_init(&to_update);
tommy_hashtable_foreach_arg(lib_syms, gather_defined_sym, &to_update);
lib_symbol* curr_sym;
comp_symbol* new_cs;
for (size_t i = 0; i < tommy_array_size(&to_update); ++i)
{
curr_sym = (lib_symbol*) tommy_array_get(&to_update, i);
new_cs = malloc(sizeof(comp_symbol));
new_cs->sym_ref = curr_sym;
new_cs->sym_lib_idx = lib_idx;
comp_syms_insert(new_cs, comp_syms);
}
tommy_array_done(&to_update);
}

93 changes: 60 additions & 33 deletions src/symbols_lib.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
#include "symbols.h"
#include "symbols_lib.h"


/*******************************************************************************
* Forward static declarations
******************************************************************************/

static void lib_syms_clean_one_entry(void*);
static int lib_syms_compare(const void*, const void*);
static void lib_syms_print_one(void*);

/*******************************************************************************
* Helper functions
******************************************************************************/

static void
lib_syms_clean_one_entry(lib_symbol *sym)
lib_syms_clean_one_entry(void *sym)
{
lib_symbol* lib_sym = (lib_symbol*) sym;
free(lib_sym->sym_name);
free(lib_sym);
}

static int
lib_syms_compare(const void* arg, const void* item)
{
free(sym->sym_name);
free(sym);
return strcmp((const char*) arg, ((const lib_symbol*) item)->sym_name);
}

static void
lib_syms_print_one(void* sym)
{
lib_symbol* lib_sym = (lib_symbol*) sym;
printf("LIB SYM ADDR %p - NAME %s - OFF %p\n", sym, lib_sym->sym_name, lib_sym->sym_offset);
}

/*******************************************************************************
@@ -15,64 +42,64 @@ lib_symbol_list *
lib_syms_init()
{
lib_symbol_list *new_list = malloc(sizeof(lib_symbol_list));
new_list->data_count = 0;
new_list->data = NULL;
tommy_hashtable_init(new_list, HASHTABLE_MAX_SZ);
return new_list;
}

void
lib_syms_clean(lib_symbol_list *list)
{
free(list->data);
tommy_hashtable_done(list);
free(list);
}

void
lib_syms_clean_deep(lib_symbol_list *list)
{
for (size_t i = 0; i < list->data_count; ++i)
{
lib_syms_clean_one_entry(list->data[i]);
}
tommy_hashtable_foreach(list, lib_syms_clean_one_entry);
lib_syms_clean(list);
}

void
lib_syms_insert(lib_symbol *to_insert, lib_symbol_list *list)
{
size_t curr_count = list->data_count;
list->data = realloc(list->data, (curr_count + 1) * sizeof(lib_symbol *));
if (list->data == NULL)
{
err(1, "Error inserting symbol %s in lib_list!", to_insert->sym_name);
}
list->data[curr_count] = to_insert;
list->data_count += 1;
}
tommy_hashtable_insert(list, &to_insert->node, to_insert,
hashtable_hash(to_insert->sym_name)); }

lib_symbol *
lib_syms_search(const char *to_find, const lib_symbol_list *list)
lib_syms_search(const char *to_find, lib_symbol_list *list)
{
for (size_t i = 0; i < list->data_count; ++i)
lib_symbol* found = tommy_hashtable_search(list, lib_syms_compare,
to_find, hashtable_hash(to_find));
if (!found)
{
if (!strcmp(list->data[i]->sym_name, to_find))
{
return list->data[i];
}
errx(1, "Did not find symbol %s!\n", to_find);
}
errx(1, "Did not find symbol %s!\n", to_find);
return found;
}

lib_symbol_list *
lib_syms_find_all(const char *to_find, const lib_symbol_list *list)
lib_symbol **
lib_syms_find_all(const char *to_find, lib_symbol_list *list)
{
lib_symbol_list *res = lib_syms_init();
for (size_t i = 0; i < list->data_count; ++i)
lib_symbol** res = calloc(1024, sizeof(lib_symbol*));
unsigned int res_sz = 0;
tommy_hashtable_node* curr_node = tommy_hashtable_bucket(list, hashtable_hash(to_find));
while (curr_node)
{
if (!strcmp(list->data[i]->sym_name, to_find))
if (!strcmp(((lib_symbol*) curr_node->data)->sym_name, to_find))
{
lib_syms_insert(list->data[i], res);
res[res_sz] = (lib_symbol*) curr_node->data;
res_sz += 1;
}
curr_node = curr_node->next;
}
assert(res_sz < 1024);
res = realloc(res, (res_sz + 1) * sizeof(lib_symbol*));
return res;
}

void
lib_syms_print(lib_symbol_list* list)
{
tommy_hashtable_foreach(list, lib_syms_print_one);
}
8 changes: 5 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Manager executables
set(BIN_INCLUDE_DIRS ${INCLUDE_DIR} ${TOML_INCLUDE_DIR} ${TOMMYDS_DIR})

add_executable(manager_call
${TEST_DIR}/manager_caller.c
)
target_include_directories(manager_call PUBLIC ${INCLUDE_DIR} ${TOML_INCLUDE_DIR})
target_include_directories(manager_call PUBLIC ${BIN_INCLUDE_DIRS})
target_link_libraries(manager_call PUBLIC chcomp)

add_executable(manager_args
${TEST_DIR}/manager_arg_passer.c
)
target_include_directories(manager_args PUBLIC ${INCLUDE_DIR} ${TOML_INCLUDE_DIR})
target_include_directories(manager_args PUBLIC ${BIN_INCLUDE_DIRS})
target_link_libraries(manager_args PUBLIC chcomp)

# Test properties
@@ -49,7 +51,7 @@ function(new_func_test test_name)
${test_name}.c)
target_link_libraries(${test_name} PRIVATE chcomp)
target_include_directories(${test_name} PRIVATE
${CMAKE_SOURCE_DIR}/src ${INCLUDE_DIR} ${TOML_INCLUDE_DIR})
${CMAKE_SOURCE_DIR}/src ${BIN_INCLUDE_DIRS})
endfunction()

# Compartment tests
1 change: 1 addition & 0 deletions third-party/tommyds
Submodule tommyds added at 97ff74
10 changes: 10 additions & 0 deletions third-party/tommyds-makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CFLAGS += --shared -fPIC

TARGET = libtommyds.a
SOURCES = tommy.c
OBJECTS = $(SOURCES:.c=.o)

all: $(TARGET)

$(TARGET): $(OBJECTS)
ar rcs $@ $^

0 comments on commit d183b75

Please sign in to comment.