Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluencelabs/sqlite
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: fluencelabs/sqlite
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: sdk_version
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Mar 12, 2021

  1. initial

    mikevoronov committed Mar 12, 2021
    Copy the full SHA
    490026b View commit details
Showing with 11 additions and 5 deletions.
  1. +2 −2 Dockerfile
  2. +3 −3 Makefile
  3. +4 −0 src/version.c
  4. +2 −0 src/wrapper.c
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -7,9 +7,9 @@ RUN apt-get update \
make \
cargo

RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sdk-11.0-linux.tar.gz | tar xz --strip-components=1 -C /
RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz | tar xz --strip-components=1 -C /

RUN cargo install fcli --version 0.1.12
RUN cargo install fcli --version 0.2.0

VOLUME /code
WORKDIR /code
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ SYSROOT = /share/wasi-sysroot
TARGET_TRIPLE = wasm32-wasi
CFLAGS = -fvisibility=hidden
SDK = sdk/logger.h
LDFLAGS = -Wl,--demangle,--allow-undefined
LDFLAGS = -Wl,--demangle,--allow-undefined,--no-gc-sections
EXPORT_FUNCS = \
--export=allocate,$\
--export=deallocate,$\
@@ -123,6 +123,7 @@ SQLITE_SRC = \
src/vdbemem.c\
src/vdbesort.c\
src/vdbetrace.c\
src/version.c\
src/vtab.c\
src/wal.c\
src/walker.c\
@@ -162,8 +163,7 @@ default: $(TARGET)
all: default

$(TARGET): $(SQLITE_SRC) $(WRAPPER_SRC)
$(CC) -O3 --sysroot=$(SYSROOT) --target=$(TARGET_TRIPLE) $(SQLITE_FLAGS) $(CFLAGS) $(LDFLAGS) -Wl,$(EXPORT_FUNCS) $^ -o $@.wasm
/root/.cargo/bin/fce embed -i sqlite3.wasm -w sqlite3.wit
$(CC) -O3 --sysroot=$(SYSROOT) --target=$(TARGET_TRIPLE) $(SQLITE_FLAGS) $(CFLAGS) $(LDFLAGS) -Wl,$(EXPORT_FUNCS) $^ -o $@.wasm

.PRECIOUS: $(TARGET)

4 changes: 4 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "sqliteInt.h"

__attribute__((section(".custom_section.__fluence_sdk_version")))
static const unsigned char __FCE_SDK_VERSION[6] = "0.5.0";
2 changes: 2 additions & 0 deletions src/wrapper.c
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
const char *RESULT_PTR;
int RESULT_SIZE;

const unsigned char __FCE_SDK_VERSION1[6] __attribute__((__section__(".custom_section.__fluence_sdk_version1"))) = "0.5.0";

void* allocate(size_t size) {
return malloc(size + 1);
}