Commit Graph

183 Commits

Author SHA1 Message Date
Brent Cook
659e87fe1c move ftruncate to common libcompat for tests 2025-10-07 04:23:58 -05:00
Un1q32
d580acbc29 check for resolv.h and arpa/nameser.h 2025-08-01 13:15:43 -04:00
Jim B
5c205f4be3 Remove applying flag to C++ code 2025-07-06 15:48:55 -07:00
Jim B
f4d8b53546 Limit usage of warning flags to C and C++
`add_compile_options()` adds options to all compilers CMake can invoke, including ASM.  The format of this warning flag causes MASM to fail if the option is specified.  This limits specifying the warning suppression to just C and C++.
2025-07-06 09:32:49 -07:00
Brent Cook
1df6b52b25 should be no need to force disabling asm anymore 2025-06-05 15:19:32 +07:00
Brent Cook
aeadd0ae85 adjust CMAKE_SYSTEM_PROCESSOR on Windows builds
Match CMAKE_GENERATOR_PLATFORM so that cross-builds work properly.
Otherwise, we're just targeting the build system anyway.
2025-06-05 14:32:09 +07:00
Brent Cook
21f4bd2a61 Land #1175, Add ISC copyright headers, add explicit COPYING to LibreSSL portable tree 2025-06-03 05:08:04 -05:00
Brent Cook
5d9229b169 adjust incorrect commit years
Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
2025-06-01 17:24:24 +03:00
Brent Cook
c51665d429 add copyright headers to Cmake files
based on original committer and date
2025-06-01 08:22:33 +07:00
Theo Buehler
5011fa2a0a remove arm perlasm tendrils 2025-05-24 21:37:33 -06:00
Theo Buehler
2a63bda523 Drop -fno-common 2025-04-12 17:21:01 +02:00
Theo Buehler
033df1bf19 Switch to add_compile_options 2025-04-12 17:20:29 +02:00
Theo Buehler
fcd8751199 Land #1046 - Fix -Wno-pointer-sign for C++ 2025-04-12 17:19:52 +02:00
Ivan A. Melnikov
031c2f1722 Basic loongarch64 support
Just wire things up to make the project buildable
on LoongArch64.

opensslconf.h is taken form riscv64 folder as is,
and is the same as on some other 64 bit architectures.

Refs: https://github.com/libressl/portable/issues/1123
Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>
2025-04-10 17:22:36 +04:00
Mustafa Gökçe
441cacf1b7 Fix no pointer sign warning on C++ compilers 2025-04-07 13:30:02 +03:00
Theo Buehler
bf808ea0fc Provide getdelim and getline compat shims
These are portable implementations from NetBSD that are needed on
Windows and perhaps some other platforms with the new versions of
the mlkem tests.
2024-12-20 01:14:04 +01:00
Don Olmstead
1996dbc07d Disable additional MSVC warnings
Append additional MSVC warnings to `MSVC_DISABLED_WARNINGS_LIST`. Disable warnings for specific files using `COMPILE_OPTIONS`.
2024-11-13 14:15:53 -08:00
Viktor Szakats
4f20970ac6 cmake: use CMAKE_INSTALL_SYSCONFDIR
Replace `${CMAKE_INSTALL_PREFIX}/etc` with
`${CMAKE_INSTALL_SYSCONFDIR}`.

It makes the install step honor the `--prefix` option.

Fixes #1118
2024-10-29 15:27:38 +01:00
Theo Buehler
91658ff373 Fix CMake build on FreeBSD
FreeBSD's libc has a stub implementation of pthread_once() that returns
ENOSYS and doesn't seem to call the init routine. You need to link with
pthread for this to work.  This PR does this and fixes regress failures
for CMake builds on this platform.  This likely never worked.
2024-10-15 08:57:23 +02:00
Brent Cook
bd9978373f don't override language property for ASM files as C
As of CMake 3.20, this causes the files to be built _as_ C, instead of
just with a C compiler. This also properly specifies the languages in
the project call.
2024-10-08 04:49:46 -05:00
Theo Buehler
69c26f31f2 fix syslog_r and pipe2 detection 2024-10-02 12:35:23 +02:00
Theo Buehler
59f21d486f Fix syslog_r detection 2024-10-02 05:35:50 +02:00
Theo Buehler
415eb81ec3 Revert "bump minimum CMake version for DLL_NAME_WITH_SOVERSION"
This reverts commit 5feccf8665.
2024-10-02 04:41:23 +02:00
Brent Cook
c169d7e61e Land #1079, Switch to check_symbol_exists() for simple cases 2024-10-01 04:00:46 -05:00
Brent Cook
c04ca241de Land #1084, Append version to dll on CMake 2024-10-01 03:56:09 -05:00
Brent Cook
5feccf8665 bump minimum CMake version for DLL_NAME_WITH_SOVERSION 2024-10-01 03:23:09 -05:00
Yang Kun
d718a26815 Fix includedir on CMake 2024-08-21 22:45:24 +08:00
Theo Buehler
1ff9793dee Switch to check_symbol_exists() in simplest cases
There are a few exceptions. Some require _GNU_SOURCE, some are in the
weird strings.h header, some are probably too new to be found in the
standard locations.

Fixes #1077
2024-08-21 15:56:28 +02:00
Viktor Szakats
5c978c4e07 cmake: replace CMAKE_SYSTEM_PROCESSOR with HOST_*
Follow-up to e99a7dd931 #1075
2024-08-07 18:32:11 +02:00
rfl890
becbdfbfc3 Update CMakeLists.txt 2024-08-02 15:10:26 +05:00
OPNA2608
e6c7de3f03 CMakeLists.txt: Fix HOST variable for ppc64
The code here defined HOST_PPC64, but the rest of the build system expects HOST_POWERPC64.
2024-07-19 11:41:46 +02:00
MoustaphaSaad
71e574aa67 use compat implementations of strlcpy and strlcat
strlcpy and strlcat Emscripten implementations cause ASAN errors. This commit disables strlcpy and strlcat detection and uses the compat implementations instead.
2024-06-19 14:06:09 +02:00
Theo Buehler
f9874d49f6 Remove timegm() compat
Now that all uses of gmtime_r() and timegm() have been converted to
OPENSSL_gmtime() and OPENSSL_timegm(), this is no longer needed.
2024-05-25 13:49:18 +02:00
Jim B
fdfbde785d Update CMakeLists.txt
Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
2024-04-07 20:45:02 -07:00
Jim B
9f64e1d14d Update CMakeLists.txt
Collapse the same if condition blocks into one block.  Include the uninstall rule when building install rules; if there was no install, shouldn't need uninstall (for this build; a previous build that was installed would have an uninstall rule)
2024-04-06 12:17:32 -07:00
Viktor Szakats
6664303ae2 cmake: disable default NDEBUG differently
Before this patch `NDEBUG` was force-disabled, preventing a build with
debug asserts disabled.

After this patch `NDEBUG` works again when passed as a custom build
option, e.g.: `-DCMAKE_C_FLAGS=-DNDEBUG`

Previously submitted as #988, which was merged, but the commit vanished
from master and ended up missing from both 3.8.3 and 3.9.0 releases.
2024-03-11 15:35:13 +00:00
Brent Cook
4e25dc4f06 Land #989 cmake: disable ASM for Windows ARM64 2024-02-12 03:34:40 -06:00
Brent Cook
db3ab1675b Land #998, Windows: Improve check for endianness when using Visual Studio 2024-02-12 03:00:53 -06:00
Christian Andersen
5bd332ec20 Windows: Improve the check for endianness when using Visual Studio.
Visual studio does not define __BYTE_ORDER__ so all architectures
were detected as LITTLE_ENDIAN since both __BYTE_ORDER__ and
__ORDER_LITTLE_ENDIAN__ would evaluate to 0 and compare equal. This
updates the checks to use CMakes detection of endianness, with a hard
error, if this also fails.
2024-02-04 22:24:10 +01:00
Christian Andersen
7897052481 Windows: Don't set -Wall when compiling with Visual Studio.
As it enables a lot of spammed warnings that are not part of W4. This
reduces the warnings a lot when compiling LibreSSL in CLion for me.
2024-02-04 19:26:00 +01:00
Viktor Szakats
bebf63788f cmake: disable ASM for Windows ARM64
With ASM support the builds either exit with an assert or hang
(with asserts disabled).
2024-01-02 03:08:20 +00:00
Theo Buehler
14639912c9 Fix timingsafe memcmp detection 2023-12-20 16:09:18 +01:00
Viktor Szakats
17cf672a04 cmake: limit some macros to mingw
Syncing this up with autotools.

Also use the built-in `MINGW` variable.
2023-12-14 13:43:07 +00:00
Viktor Szakats
906e10ea83 try fixing missing tls-compat for tests 2023-12-14 04:59:04 +00:00
Viktor Szakats
848950877f cmake: stop exporting compat functions 2023-12-14 03:36:09 +00:00
Viktor Szakats
0de236a7c1 cmake: auto-detect strtonum
Notice that just like in autotools, this detection also doesn't take
into account the targeted OS version. Meaning it detects `strtonum` even
if targeting e.g. macOS older than release v11 Big Sur (which introduced
this funcitions), if the SDK declares it. Wrong detection will either
cause a binary broken on older macOS and/or trigger compiler warnings.

Ref: https://github.com/libressl/portable/issues/928#issuecomment-1850178282
Ref: https://github.com/libressl/portable/issues/928#issuecomment-1850276298

Prerequisite:
https://github.com/libressl/portable/issues/928#issuecomment-1850356408
2023-12-11 16:39:18 +00:00
Brent Cook
b16146e09b Land #938, cmake: simplify if expressions, accept CPU values more consistently 2023-11-07 19:27:58 -06:00
Viktor Szakats
abf3be5c56 always check CMAKE_SYSTEM_PROCESSOR with MATCHES
This makes it accept values consistently. Before this patch
mingw-w64, Apple and SunOS did not accept a CPU if it had
a suffix or prefix (e.g. a triplet), while other targets did.
2023-11-07 17:03:12 +00:00
Viktor Szakats
27486b12e1 simplify MATCHES/STREQUAL syntax 2023-11-07 16:57:51 +00:00
Viktor Szakats
557b5a191a cmake: stop passing unused C macros
- `-DCPPFLAGS`: probably a copy-paste typo from the initial CMake
  commit.

- `-DNO_CRYPT`: `NO_CRYPT` is no longer used in the source and this
  macro is no longer set by autotools.
2023-11-07 16:53:09 +00:00