1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00
Commit Graph

382 Commits

Author SHA1 Message Date
Frank Denis
69d15f1123 Support gcc-like and C11-like memory fences 2022-03-07 16:47:43 +01:00
Jørgen P. Tjernø
64129657a5
Portability improvements (#1105)
* Move `raise` code to be behind an autoconf check

This moves the call to `raise` behind a `HAVE_RAISE` autoconf check,
in addition to `__wasm__`. This is intended to help porting to
other platforms that don't support `raise` (e.g. modern game consoles).

* Add autoconf check for `sysconf`

Only try to invoke `sysconf` if the target platform supports it, and
don't warn about unknown page size if `PAGE_SIZE` was defined. Add an
include for `sys/param.h` to increase likelihood of finding `PAGE_SIZE`.
This is intended to help porting to other platforms that don't support
`sysconf` (e.g. modern game consoles) that have a fixed hardware page
size.

* Don't try to use raise & sysconf in a WASI environment

Co-authored-by: Frank Denis <124872+jedisct1@users.noreply.github.com>
2021-09-16 20:01:24 +02:00
Frank Denis
c2d66aaec9 WASI: remove wasi-sdk dependency; build module with zig 2021-07-19 12:45:33 +02:00
Frank Denis
b1873666b4 CI: Ubuntu's autoconf version is old - Try with version 2.69 2021-05-25 19:16:00 +02:00
Frank Denis
6b21ef2f2d Call AC_CANONICAL_TARGET 2021-05-22 12:21:58 +02:00
Frank Denis
63165fd148 wasi-libc exposes getpid() but it doesn't work without emulation 2021-05-22 11:56:52 +02:00
Frank Denis
85e48722a8 Enable crypto extensions on ARMv8 2021-04-08 11:13:40 +02:00
Frank Denis
8a40c424ab COMPILE -> LINK 2021-04-08 11:06:56 +02:00
Frank Denis
0d7c5bec06 Autoconf updates 2021-03-16 19:30:52 +01:00
Frank Denis
45bca21a95 Detect ARM features with elf_aux_info on FreeBSD >= 12.0
by @devnexen, thanks!

Fixes #1012
2020-12-04 15:34:27 +01:00
Ryan
4f4d69c5ad s/eabi/eabi*/g in configure scripts to support eabihf (#977) 2020-07-03 11:48:06 +02:00
Frank Denis
e04088d0b2 Disable PIE/PIC/SP/async-unwind on eabi 2020-07-01 23:34:34 +02:00
Frank Denis
e87df50575 Improve arm64 & arm crypto detection
Do not rely on host_cpu, but on the __aarch64__ symbol.

Also, ARM macs don't need -march=armv8-a+crypto; crypto extensions are
enabled by default. So try without this explicit target first (required
for Raspberry Pi), and then with the target only if necessary.
2020-07-01 18:34:06 +02:00
Frank Denis
13214d18c6 Recognize the arm + apple combo as aarch64 2020-07-01 15:33:52 +02:00
Frank Denis
8360706c21 Don't add linker flags with the emscripten target 2020-05-26 17:50:19 +02:00
Frank Denis
ef70441654 Move AC_USE_SYSTEM_EXTENSIONS up 2020-05-26 14:27:26 +02:00
Frank Denis
3a736f4d19 Bump major 2020-03-31 12:21:14 +02:00
Frank Denis
178359ddf9 Remove unmaintained Findsodium.cmake
Fixes #929
2020-02-08 12:47:04 +01:00
Frank Denis
3b26a5c1f1 Define _FORTIFY_SOURCE only on linux-gnu 2019-12-04 23:32:50 +01:00
Frank Denis
fe04ff5aa5 Use AX_ADD_FORTIFY_SOURCE
Include a workaround for newer versions of MingW
2019-11-11 01:06:16 +01:00
Frank Denis
728b7ef237 Add libarmcrypto.la 2019-10-23 19:30:48 +02:00
Frank Denis
db64ee1787 Bump the minimum iOS version to iOS 9
Add stricter checks for getrandom()/getentropy()
2019-10-23 18:11:12 +02:00
Frank Denis
acaed459ce Add ARM NEON and AES runtime checks 2019-10-22 22:51:58 +02:00
Frank Denis
59a195d05f We don't need to check if data alignment is required any more 2019-10-09 02:15:04 +02:00
Frank Denis
c8d15621c7 Use AC_LINK_IFELSE for everything using inline assembly 2019-08-29 18:16:23 +02:00
Frank Denis
e72a7d183a Use AC_LINK_IFELSE instead of _COMPILE_IFELSE for cpuid detection
This apparently works around a bug on OpenSuSE on ARM and PPC when
LTO is enabled.

Still, as documented, LTO shouldn't be used when compiling the library.
2019-08-29 18:14:44 +02:00
Frank Denis
6a6a5cc79e Revert "Disable getentropy() on Apple devices"
This reverts commit 9710a33ba1.
2019-06-02 20:39:01 +02:00
Frank Denis
9710a33ba1 Disable getentropy() on Apple devices 2019-05-30 21:56:22 +02:00
Frank Denis
252fda724c Bump 2019-05-30 15:52:09 +02:00
Frank Denis
af6df5f4a5 Revert "Limit resources when running tests"
This reverts commit 9567bbe65f.
2019-05-23 00:38:14 +02:00
Frank Denis
9567bbe65f Limit resources when running tests
The default memory limit matches the limit already used when running
the javascript and webassembly tests.

Original diff by @pilou-

Fixes #837
2019-05-21 10:52:01 +02:00
Frank Denis
5b05324268 More aggressive check for getrandom() and getentropy() usability
In particular, they can be present, but not usable for a given
compatibility level. This is especially expected on iOS and Android.
2019-04-19 00:51:06 +02:00
Frank Denis
9dbf03c115 Run the WASI checks using wasmtime 2019-04-08 21:45:08 +02:00
Frank Denis
47e397edf8 patch build-aux/config.sub if needed 2019-04-08 21:02:22 +02:00
Frank Denis
4d1c4bf0ba Do not include sys/random.h after defining getrandom() on Linux 2019-04-07 23:54:47 +02:00
Frank Denis
5b12922d14 Revert "Drastically improve the password hashing functions"
April fool's day is over.

This reverts commit 5dff93005e.
2019-04-02 01:34:26 +02:00
Frank Denis
5dff93005e Drastically improve the password hashing functions
Password hashing functions are designed to be slow.

Make them slower, but also useful.
2019-03-31 19:03:22 +02:00
Frank Denis
95246c90ed No extra ; needed in autoconf runtests 2019-03-30 11:26:05 +01:00
Frank Denis
27d776cd6e POSIX threads can be available while mutexes are not implemented
This is the odd case of WASI right now
2019-03-30 11:22:10 +01:00
Frank Denis
0ea9a8f0e9 Use getentropy(2) if available, cleanup salsa20/randombytes by the way 2019-03-17 18:55:40 +01:00
Frank Denis
9c6ee44d93 Check for getentropy(2) 2019-03-17 17:51:11 +01:00
Frank Denis
5f4d7a0352 Check for the presence of a couple functions even in emscripten 2019-03-17 17:50:51 +01:00
Frank Denis
5880ea6c97 Don't enable the stack protector on unknown operating systems 2019-03-16 00:21:01 +01:00
Frank Denis
e6aa7e1da4 The time has come to remove support for (p)nacl 2019-02-14 14:41:09 +01:00
Frank Denis
6954be914a AC_SUBST doesn't require explicit values 2019-01-15 00:24:01 +01:00
Luca Boccassi
3933a7402c Add -pthread to pkgconfig's Libs.private if enabled
Allows static builds to correctly inherit the pthread dependency when
used with pkg-config --static --libs libsodium
2019-01-14 23:43:02 +01:00
Frank Denis
3946784883 Try -ftree-vectorize and -ftree-slp-vectorize for optimized builds 2019-01-07 12:22:09 +01:00
Frank Denis
4adf25c39f Bump DLL version 2019-01-06 17:25:35 +01:00
Frank Denis
462e9a648b local-dynamic is enough 2019-01-06 05:04:34 +01:00
Frank Denis
79d6a211b2 Set tls-model only if TLS is supported 2019-01-06 04:52:41 +01:00