76 Commits

Author SHA1 Message Date
kinichiro
2f3066df94 Set IA-64 compiler flag only if it is HP-UX with IA-64
Compiler switch -mlp64 (GCC) or +DD64(HP CC) gives build failure with
platform HP-UX other than IA-64.
This avoids build break on HP-UX with PA-RISC platform.

Suggested from Larkin Nickle (me <at> larbob org) by libressl ML.
2021-11-23 13:27:17 +09: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
kinichiro
e07b5feba5 Remove -D_FORTIFY_SOURCE=2 and -lssp with mingw build 2021-05-30 05:12:30 +00:00
kinichiro
420723ee18 Fix mingw build on ubuntu 20.04
- Link libssp to resolve undefined reference __memcpy_chk
- Disable dtlstest since mingw does not have poll
2021-05-30 01:11:45 +00:00
Brent Cook
921c0675a2 Add '--enable-libtls-only' build option 2021-04-07 07:51:45 -05:00
Brent Cook
df3d4bb57a Add -lbcrypt to Windows builds for CNG in getentropy 2020-11-11 05:39:56 -06:00
Brent Cook
2c49c28d47 need ax_check_compile_flag too for older autotools 2020-08-22 18:42:26 -05:00
Brent Cook
56202472bf Add a compile-time check for FORTIFY_SOURCE support
This is broken on some platforms, so pull in the conditional macro from
the latest version of autoconf-archive to test for working support.
2020-08-22 18:42:26 -05:00
Ørjan Malde
b80c4bf262 initial support for midipix 2019-10-20 20:22:22 +02:00
kinichiro
30e91bc6d2 Enable speed on win32
- Use thread and sleep instead of signal and alarm, on win32
- Disable -multi option on win32 since fork is hard to implement
2019-07-14 19:45:34 +09:00
Brent Cook
38c884f205 include -ldl for SHA512 operations 2019-04-23 01:54:33 -05:00
Brent Cook
535246269d add __dead__ annotation support 2019-02-09 09:09:36 -06:00
Brent Cook
a6d7ea9562 update autoconf for latest compat functions 2019-01-31 13:56:56 -06:00
Brent Cook
8730803401 enable asm for mingw64 2019-01-20 20:03:37 -06:00
Brent Cook
91d26602c9 check for more pthread functions that might not be in libc 2019-01-18 18:04:31 -06:00
Brent Cook
3f189a24f2 check if we need to link pthread dynamically
On Linux, bionic and musl for instance do not need libpthread. With
bionic, there is not even a stub library for compatibility.
2019-01-07 06:46:03 -06:00
Brent Cook
c1a44d2220 we don't need to pass this to automake 2019-01-06 15:49:28 -06:00
Brent Cook
7af3ba340d add configure-time check for timespecsub 2019-01-06 15:47:55 -06:00
Brent Cook
158281bdfe AC_CHECK_FUNC does not set the define, prefer AC_CHECK_FUNCS 2018-03-22 21:32:25 -05:00
Brent Cook
987aa6a084 add clock_gettime for macos 10.11 and earlier 2018-03-22 21:04:43 -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
0ed618095d Add libpthread for libtls build 2018-03-13 23:16:10 +09:00
kinichiro
9e06be3fcd Remove 64bit build designation on Solaris
- Revert commit c18852f650
- Remove -m64 from CMakeLists.txt by commit 08089a1b20
- Suggested by @andy-js in conversation https://github.com/libressl-portable/portable/pull/327
2018-01-11 23:46:22 +09:00
Evgen Bodunov
aff3a43fa0
Fixed getpagesize detection on Android 2017-11-23 15:28:25 +03:00
kinichiro
5afc4e3cd8 add prototype definitions of asprintf and vasprintf for CYGWIN build
- define _GNU_SOURCE in case of cygwin

As compilation warning report by @Dravion
2017-07-16 23:59:55 +09:00
Brent Cook
70ee57c6ad Land #328, generate the crypto export symbol list at build time 2017-07-09 05:12:21 -05:00
Brent Cook
9b88fa46bb generate the crypto export symbol list at build time
we currently do it at configure time, which makes this a generated
source, but generated sources should be cleaned up, which breaks
'make clean; make'
2017-07-08 17:46:16 -05:00
kinichiro
c18852f650 Set Solaris build default to 64 bit 2017-07-08 01:43:07 +09:00
Paul Graham
b49242fcb0 Remove misleading CFLAGS / LDFLAGS.
These variables were being ignored because libtool doesn't pass -static-libgcc to GCC.
If you want to link libgcc statically, currently the only way to achieve this is to
manually add -static-libgcc to CC variable. See:

http://www.mingw.org/wiki/HOWTO_Sneak_GCC_Switches_Past_Libtool
2017-06-09 13:33:14 +02:00
Brent Cook
7ba183503a include amd64 in the mix 2017-04-29 18:37:18 -05:00
Brent Cook
1f13e7956b only include ia32 syms on i?86/x86_64 targets 2017-04-29 18:36:14 -05:00
kinichiro
048625cf2b Add freezero support 2017-04-22 23:37:20 +09:00
Brent Cook
922cd9c94e move crypto_portable.sym to builddir 2017-04-10 09:30:29 -05:00
Brent Cook
d5b247cc4f Land #297, Add recallocarray 2017-03-16 19:23:36 -05:00
kinichiro
c61c9821e8 Add support for getpagesize 2017-03-15 22:02:11 +09:00
kinichiro
8877e9bc55 Add recallocarray 2017-03-09 23:00:04 +09:00
kinichiro
5297e9d486 Fix condition of arc4random* and getentropy for Cygwin build
- Fix the condition of exporting getentropy
- Modify the CMake condition of including arc4random_uniform as same as autoconf
2017-02-20 11:50:47 +09:00
kinichiro
7dd0650d33 Add inet_ntop and memmem for ocspcheck 2017-01-26 17:51:35 +09:00
kinichiro
91a8bd7914 Move strsep.c to crypto/compat/ and add ocspcheck build to CMake 2017-01-25 21:31:04 +09:00
Brent Cook
f21bd20c7e add open(2) shim to handle O_BINARY and O_CLOEXEC 2017-01-16 10:59:15 -06:00
Brent Cook
dfb6b11e5a include pipe2/socketpair compat for macOS 2017-01-15 16:00:16 -06:00
kinichiro
1d934cd2d8 Fix to use -export-symbols for libcrypto
- generating platform specific crypto/crypto_portable.sym from crypto.sym
2017-01-15 22:12:39 +09:00
Simone Basso
a206997ad9 Sync getentropy() checks with use-builtin-arc4random checks
Without this, we actually fail to build a library that includes the
bultin getentropy when compiling for 10.11 on 10.12.
2016-12-10 20:58:04 +01:00
Simone Basso
6fa2d21ba5 m4/check-libc.m4: improve getentropy check
- according to man.openbsd.org getentropy() is in unistd.h

- according to macOS sierra's man it's in sys/random.h

- since sys/random.h is does not exist for iOS and for linux, do
  not attempt to include it, rather redeclare the prototype

- make sure that `./configure`:

    - uses getentropy() on macOS sierra

    - does not use getentropy() if compiling for 10.11

    - does not use getentropy() if compiling for ios armv7
2016-12-09 14:17:06 +01:00
Simone Basso
f8a9c71e79 configure: fix getentropy() for sierra and ios
This diff changes the logic by which configure detects getentropy() to
ensure that we don't use the system wide getentropy

- with macOS sierra if the deployment target is lower than sierra as
  found by tor developers here

    https://gitweb.torproject.org/tor.git/commit/?id=https://gitweb.torproject.org/tor.git/commit/?id=16fcbd21c963a9a65bf55024680c8323c8b7175d

- with iOS unconditionally because an app linking libressl compiled with
  system wide getentropy has been rejected by the App store as I have
  documented here

    https://github.com/measurement-kit/measurement-kit/pull/994

I think something similar could also affect clock_gettime judging from
tor's patch, but this diff for now doesn't address that.

I do not have macOS < sierra, so I could only verify that configure was
not picking up system wide getentropy by compiling libressl using

    export CFLAGS="-mmacosx-version-min=10.11"

As regards iOS, removing the check for getentropy and recompiling (thus
using libressl builtin getentropy()) was enough to have another iteration
of the app accepted. Otherwise testing should be possible with:

    export LDFLAGS=-arch armv7 -miphoneos-version-min=7.1 -isysroot `xcrun --show-sdk-path --sdk iphoneos`
    export CPPFLAGS=-arch armv7 -isysroot `xcrun --show-sdk-path --sdk iphoneos`
    export CFLAGS=-arch armv7 -miphoneos-version-min=7.1 -isysroot `xcrun --show-sdk-path --sdk iphoneos`

Related ticket: https://github.com/libressl-portable/portable/issues/230
2016-12-09 12:50:56 +01:00
Brent Cook
d2f5ab1ee8 prefer builtin arc4random on OS X 10.12+ (using getentropy as the signal) 2016-11-06 03:12:34 -06:00
jacob berkman
83e9741dc6 Disable netcat if arpa/telnet.h is not available (iOS) 2016-08-09 15:04:45 -07:00
celan69
1b10e48a1f Fix typo in USE_BUILTIN_ARC4RANDOM check
Solaris 11 recently introduced a builtin arc4random in libc which fails the tests in "make check". Found USE_BUILTIN_ARC4RANDOM, but could not get it to work. Apparently, there is a typo in the configure logic rendering USE_BUILTIN_ARC4RANDOM ineffective.
2016-07-19 12:11:28 +02:00
Brent Cook
466e389d3f check linker flags before checking for functions 2016-04-24 03:29:14 -05:00