Commit graph

87 commits

Author SHA1 Message Date
Hubert Chathi
ed94b56d16 fix compatibility with newer versions of emscripten 2022-10-06 13:14:38 -04:00
Hubert Chathi
84807125c0 allow memory to grow in wasm 2022-05-13 16:28:04 -04:00
Faye Duxovni
e000c33a58 don't try to harden unoptimized debug builds, it just causes errors 2022-05-12 20:55:00 -04:00
Hubert Chathi
dd1905454b fix doc building. Thanks to Jonas Smedegaard. 2022-01-14 11:08:58 -05:00
Benjamin Kampmann
f6309f0281 Disable forced exports (introduced in 72b8bf53) for wasm. 2021-12-02 12:27:37 -05:00
Benjamin Kampmann
336e1d56a8 disable DEBUG symbols for emscripten build 2021-11-24 10:43:23 -05:00
Hubert Chathi
0e7c0a5613 recommend using cmake more strongly 2021-11-02 16:16:07 -04:00
Hubert Chathi
201f139523 also install olm_export.h when using make 2021-11-02 12:49:52 -04:00
Hubert Chathi
6a63a5bfa9 use full path to externs.js because it's failing to find it 2021-09-14 18:18:26 -04:00
Denis Kasak
4d14750c38 Move fuzzers under fuzzing/ dir. 2021-07-13 13:49:18 +02:00
Denis Kasak
e06ac20558 Add unpickle_megolm_outbound fuzzer. Enable C harness support. 2021-07-13 11:13:15 +00:00
Denis Kasak
84dbba8e1c Makefile: Remove debugging flag from the release target. 2021-07-12 16:50:34 +02:00
Denis Kasak
a44fc368f2 Makefile: Fix passing optimization flag to fuzzing builds. 2021-07-12 16:50:06 +02:00
Hubert Chathi
0f7c13334f install error.h when using make too 2021-06-17 15:26:46 -04:00
Hubert Chathi
3612ac7ae7 add missing dependency in Makefile for javascript/olm_prefix.js 2021-06-08 14:57:05 -04:00
Denis Kasak
3e6592e445 Compile ASAN and MSAN versions of fuzzer harnesses too. 2021-06-02 14:02:19 +02:00
Denis Kasak
56df2613f3 Switch to afl-clang-fast(++).
This type of instrumentation is much faster (several times over) and
supports much more features than afl-gcc/afl-g++, though it requires
a LLVM/clang installation.
2021-06-02 14:02:19 +02:00
Arun Babu Neelicattu
15f65283c7 make: Replace deprecated emcc configuration
EXTRA_EXPORTED_RUNTIME_METHODS is deprecated. Replace with
EXPORTED_RUNTIME_METHODS.
2021-05-10 20:40:42 +00:00
Hubert Chathi
f16377822f Add LibreJS license tag 2021-03-31 16:11:41 -04:00
Lukas Lihotzki
22f85d3f3d simplify Makefile (olm_legacy.js) 2020-10-06 09:48:15 +02:00
Lukas Lihotzki
add885c874 add test_mem target for valgrind memcheck 2020-10-01 15:40:22 +02:00
Lukas Lihotzki
73a9ced64e simplify Makefile 2020-09-26 18:24:58 +02:00
Hubert Chathi
efd17631b1 move -o option before source files, for better compatibility with LLVM 2020-05-19 15:10:24 -04:00
Matthew Hodgson
83bf351a34 fix build on latest emscripten 2020-05-16 17:10:02 +01:00
Matthew Hodgson
5a9fdd85cb remove overzealous -D param to install which breaks build on macOS 2020-05-15 03:06:08 +01:00
stoically
611d3949cb Add wasm target to Makefile
Allows building an WASM-ready archive with emscripten.

This allows e.g. to compile to the `wasm32-unknown-unknown`
target with Rust.

Related matrix-rust-sdk PR:
https://github.com/matrix-org/matrix-rust-sdk/pull/31

Signed-off-by: stoically <stoically@protonmail.com>
2020-05-07 15:58:24 -04:00
David Baker
72df5301e0 Build the js objects without PIC
This confuses emscripten now
2019-09-30 13:50:35 +01:00
Trygve Aaberge
e267825bb7 Makefile: Overwrite symlinks in install and install-debug
Without this, it's not possible to run the install or install-debug
rules multiple times.

Signed-off-by: Trygve Aaberge <trygveaa@gmail.com>
2019-08-08 09:29:14 -07:00
David Baker
c31ab73704 Drop support for old emscripten
because emscripted has dropped support for the old flag and us
setting it is now breaking the build.
2019-01-30 18:16:48 +00:00
Hubert Chathi
94f664e725
initial implementation of short authentication string generation 2019-01-21 23:21:41 -05:00
Hubert Chathi
5cf074d337 Merge branch 'master' into poljar 2018-10-12 17:02:51 -04:00
David Baker
82534708a3 Merge remote-tracking branch 'origin/master' into dbkr/ci2 2018-10-10 20:08:55 +01:00
Hubert Chathi
44f78cf4fe
Merge branch 'master' into dbkr/wasm 2018-10-09 17:38:32 -04:00
David Baker
713e9aeb4d Build on mac 2018-10-05 15:35:21 -04:00
David Baker
602c00a8d6 Dual-build wasm and asm.js olm 2018-10-04 20:09:54 +01:00
David Baker
877166dedc Merge branch 'dbkr/wasm' into dbkr/ci2 2018-10-03 16:22:13 +01:00
David Baker
3e775938e5 Replace the impenetrable line of perl with python
Mostly because the standard emscripten docker image does not have
libjson-perl, but python always comes with json. But also because
it was impenetrable.
2018-10-03 16:06:15 +01:00
David Baker
263b94428a Another day, another interface
Change the interface again, hopefully this time a bit more normal.
Now we wrap the emscripten module completely and just expose the
high level objects.

The olm library export is now imported as normal (ie. returns
a module rather than a function returning a module) but has an
`init` method which *must* be called. This returns a promise
which resolves when the module is ready. It also rejects if the
module failed to set up, unlike before (and unlike the
promise-not-a-promise that emscripten returns).

Generally catch failures to init the module.
2018-09-25 17:13:29 +01:00
David Baker
5e87db615a Make OLM_OPTIONS work again
The closure compiler was just renaming the variable so it never
would have picked them up. Make it an extern so it knows what to do.
2018-09-21 16:35:17 +01:00
David Baker
122867c45c WebAssembly support!
Quite a lot going on in this PR:
 * Updates to support recent emscripten, switching to WASM which is now the default
 * Use emscripten's MODULARIZE option rather than wrapping it ourself, since doing
   so in pre-post js doesn't work anymore.
 * Most changes are moving the emscripten runtime functions to top-level
   calls rather than in the Module object.
 * Get rid of duplicated NULL_BYTE_PADDING_LENGTH
 * Fix ciphertext_length used without being declared
 * Fix things that caused the closure compiler to error, eg. using
   OLM_OPTIONS without a declaration.
 * Wait until module is inited to do OLM_ERROR = olm_error()

The main BREAKING CHANGE here is that the module now needs to initialise
asyncronously (because it has to load the wasm file). require()ing olm
now gives a function which needs to be called to create an instance.
The resulting object has a promise-like then() method that can be used
to detect when the module is ready. (We could use MODULARIZE_INSTANCE
to return the module directly as before, rather than the function,
but then we don't get the .then() method).
2018-09-21 16:01:51 +01:00
Damir Jelić
ac071d9c0d python: Enable build with the local build of the Olm C library.
This patch adds the ability to build the bindings without having a
globally installed Olm C library.

Provided that the C library is already built, the tests can be run now
with make test.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2018-07-18 17:44:32 -04:00
Hubert Chathi
128d45cc83 add initial implementation of basic private key encryption functionality 2018-06-27 16:38:45 -04:00
MTRNord
4065c8e11a Update Makefile to support building on Windows
The code for this change is taken from
https://stackoverflow.com/a/30225575/4929236

This patch is Signed-Off-By: Marcel Radzio <marcel@radzio-sh.de>
2018-04-12 10:51:16 +01:00
Richard van der Hoff
bb05b5687f Makefile: fix tab/space substitution. 2017-03-29 10:44:54 +01:00
Andreas Zwinkau
b0a010b153 Support building as a static library
Signed-off-by: Andreas Zwinkau <qznc@web.de>
2017-03-24 10:20:49 +00:00
Yannick LE COLLEN
a9aeb6b5d7 Android : improve the version number management (#46)
Add functions to make the difference between the native and the java code version.

Factor out the version management in the makefiles.
2017-03-02 12:01:32 +00:00
Richard van der Hoff
77eaaa3d5f prepare v2.2.2 2017-03-01 16:21:37 +00:00
Richard van der Hoff
b185229c2b Prep v2.2.1 2017-01-18 18:16:32 +00:00
Richard van der Hoff
150c360e82 Bump version numbers to 2.2.0 2017-01-18 16:03:02 +00:00
Richard van der Hoff
86b64b653a Bump version numbers throughout 2016-12-22 15:03:00 +00:00