132 Commits

Author SHA1 Message Date
Jiajie Chen
ef2d6c70da Detect machine/endian.h for macOS 2022-07-12 22:29:39 +08:00
Sebastian Blunt
fe903fb7c5 Fix unreachable nc portability shim
This fixes nc failing to run on darwin due to it incorrectly setting the
linux-specific SOCK_NONBLOCK flag on connect.

nc already had a portability shim in apps/nc/compat/sys/socket.h, which
kicks in if SOCK_NONBLOCK is undefined. But that header includes
include/compat/sys/socket.h, which also has a portability shim that
defines a default value for SOCK_NONBLOCK if it's undefined. Thus the
first portability shim was unreachable.

Fixes this by moving the NEED_SOCKET_FLAGS flag into the outer shim, and
having the inner shim activate if NEED_SOCKET_FLAGS is defined.

This closes https://github.com/libressl-portable/portable/issues/631
2022-04-15 23:59:33 -07:00
Brent Cook
f6deadbec9 add vwarnx 2022-03-16 04:21:52 -05:00
Brent Cook
f690667262 Autoconf updates
Move machine/endian.h to endian.h, use AC_HEADER_RESOLV over individual
header checks, and include prerequisites for netinet/ip.h check.
2021-11-09 22:43:53 -06:00
Jonas 'Sortie' Termansen
fcf6c87788 Support operating systems without some non-POSIX headers
The arpa/nameser.h, netinet/ip.h, and resolv.h headers are not crucial
to building LibreSSL. The netinet/ip.h header is used in nc(1) for
optional IPTOS_ features that can be ifdef'd on systems without support.

The endian.h header is the upcoming standard header and should be used
whenever available and correct. The machine/endian.h header is
non-standard and doesn't have to exist on POSIX systems.

Fix the check for getpagesize(3) not forward declaring the function,
such that CFLAGS with -Werror=implicit-function-declaration doesn't
cause the check to fail.
2021-10-03 13:33:16 +02:00
Brent Cook
921c0675a2 Add '--enable-libtls-only' build option 2021-04-07 07:51:45 -05:00
Brent Cook
90f1c4db5c fix leak in Windows version of pthread_mutex_free
Free the lock pointer in addition to the critical section. Thanks to
martinkucera74 on github.
2021-02-28 10:04:51 -06:00
Brent Cook
527482b520 add win32 pthread_mutex_destroy implementation 2020-12-21 10:14:21 -06:00
Joel Sing
17c8816401 Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.

bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h).
2020-09-20 02:09:35 +10:00
kinichiro
461ec45335 Add queue.h tree.h _null.h
Import queue.h tree.h _null.h header files from OpenBSD upstream
since x509_issuer_cache.c requires them.
2020-09-13 21:56:34 +09:00
kinichiro
65b01cff7a Add PTHREAD_MUTEX_INITIALIZER 2020-09-13 21:56:34 +09:00
kinichiro
7bf5edc4f2 Add architecture define for s390/s390x and remove redundant sparc check 2020-07-22 21:32:34 +09:00
kinichiro
7423582705 Get __STRICT_ALIGNMENT from machine/endian.h 2020-07-21 22:13:39 +09:00
Brent Cook
e34586db19 include <windows.h> 2020-04-14 22:38:10 -05:00
Brent Cook
79f2a52a39 avoid exporting a sleep() symbol from libcrypto
Since it seems only MSVC lacks sleep(), and it's only used by apps, lets
special-case that and make it available as a static inline function
instead.
2020-04-14 22:29:37 -05:00
Ørjan Malde
b80c4bf262 initial support for midipix 2019-10-20 20:22:22 +02:00
Brent Cook
a2befe3383 unconditionally define reallocarray
deal with systems missing it but with it exported as a symbol
2019-05-10 11:09:18 -05:00
Brent Cook
a67ba9f4ad add pthread_mutex* windows compat for libtls 2019-04-11 07:29:45 -05:00
Brent Cook
535246269d add __dead__ annotation support 2019-02-09 09:09:36 -06:00
Brent Cook
cc0a0e1299 add syslog to compat headers 2019-02-01 05:14:57 -06:00
Brent Cook
a6d7ea9562 update autoconf for latest compat functions 2019-01-31 13:56:56 -06:00
Brent Cook
b6479e01f6 define in_port_t for Android 2019-01-07 06:46:03 -06:00
Brent Cook
7af3ba340d add configure-time check for timespecsub 2019-01-06 15:47:55 -06:00
Brent Cook
d5c155fcb8 add stdint.h shim, include limits for SIZE_MAX on Android 2019-01-01 22:56:13 -06:00
Brent Cook
4f1c9507b6 hide clock_gettime definition on WIN32 2018-11-16 05:17:37 -06:00
Brent Cook
387d2ae261 change windows compatibility stubs for pthread_t to be more like other OSes 2018-11-11 11:00:00 -06:00
kinichiro
4fe24eb56d Disable unveil 2018-08-22 00:12:56 +09:00
Sergei Trofimovich
787d8d240b __warn_references: tweak assembly for "gnu.warning" section
On some targets ';' (like hppa) is treated as a comment
in assembly files. This occasionally causes the following
assembly failures:

```
Error: can't resolve `.gnu.warning.EVP_DecryptFinal'
{.gnu.warning.EVP_DecryptFinal section} - `.Ltext0' {.text section}
```

Note how branch (or other reference) attempts to cross the
boundary across two section types: '.text' and '.gnu.warning'.

Tobias Ulmer notes that openbsd already uses newlines
for similar macro:

https://github.com/openbsd/src/blob/master/sys/arch/hppa/include/cdefs.h

This change switches from ';' to newline as well.
Tested on hppa2.0 and x86_64.

Reported-by: Jeroen Roovers
Bug: https://bugs.gentoo.org/656104
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2018-05-19 17:38:50 +01:00
Brent Cook
31c98c2969 always allow upstream time.h to be visible 2018-03-23 15:35:58 -05:00
Brent Cook
6b513a1c78 add proper guard and typedef 2018-03-23 13:45:05 -05:00
Brent Cook
4b2a8cd1c1 adjust definition of compat clock_gettime 2018-03-23 11:10:16 -05:00
Brent Cook
7ffaf00415 hide clock_gettime on win32 2018-03-22 21:11:46 -05:00
Brent Cook
987aa6a084 add clock_gettime for macos 10.11 and earlier 2018-03-22 21:04:43 -05:00
Brent Cook
0e46c1e8ba add pthread_self/pthread_equal for win32 2018-03-18 10:36:51 -05:00
Brent Cook
0e69421d82 re-add headers for distribution 2018-03-14 13:01:24 -05:00
Brent Cook
4799f0d9be syntax updates 2018-03-14 12:58:48 -05:00
Brent Cook
cfdaa1185f prefer including windows.h over the internal header 2018-03-14 12:56:26 -05:00
Brent Cook
d5608b38af add pthread_once(3) implementation for Windows 2018-03-14 07:36:45 -05:00
Brent Cook
3fb9e63b90 bump base requirement to Windows Vista, use builtin inet_ntop/pton 2018-03-14 07:29:04 -05:00
kinichiro
3681d02253 Add compat bits for libtls on Windows 2018-02-25 21:56:05 +09:00
kinichiro
f2953bc209 Add file permission define for Windows and MinGW build 2018-02-11 23:31:43 +09:00
kinichiro
1f4bfb9a4d Call va_end soon after using variable length variable
- This fix MSVC compiler warning C4702 "unreachable code".
2018-01-06 00:28:49 +09:00
kinichiro
965a89108e Add CLOCK_MONOTONIC and timersub for the OS that does not have them 2017-12-25 16:30:49 +09:00
Brent Cook
7b6953e9a9 add timerspecsub 2017-12-12 03:31:35 -06:00
Aric Belsito
cbe57bef04
Some CMake Fixes.
pqueue.h was getting installed when it shouldn't.
pkgconfig files were not getting installed or generated.
2017-09-10 11:54:23 -07:00
d3x0r
a4d80ca56a Merge branch 'master' of https://github.com/libressl-portable/portable into SkipInstall
Fix merge conflicts from GNUInstallDirs merge to master.
2017-07-06 23:11:11 -07:00
d3x0r
2557dd7439 Add option LIBRESSL_SKIP_INSTALL
Internally LIBRESSL_SKIP_INSTALL, if not set becomes ENABLE_LIBRESSL_INSTALL so this by default is enabled.  defining LIBRESSL_SKIP_INSTALL before hand will disable all install() rules.
This is useful if another project includes and links to this statically.
I chose to add a prefix to avoid potential name collision because the options are cached globally.

If the installation is skipped, maybe it should also disable building apps?  I didn't do that.
2017-07-06 02:09:44 -07:00
d3x0r
a2bd5ebaba use GNUInstallDirs from cmake to specify install paths.
Primarily this is to select whether 'lib64' or 'lib' is used on linux type systems.
2017-07-06 01:49:43 -07:00
kinichiro
530fbba1ed Add definition of in_addr_t for Windows build 2017-05-14 00:00:10 +09:00
kinichiro
048625cf2b Add freezero support 2017-04-22 23:37:20 +09:00