1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg: 64 bit compatibility

* Added arch_64bit feature and added it to all packages that require 32 bit.
* hacl, wolfssl: Fixed different types between function declaration and implementation.
* lwip: Add required flag for 64 bit and bug fix in `lwip_sock`.
* micro-ecc: Workaround for GCC warning when using `__int128`.
This commit is contained in:
Frederik Haxel 2024-01-12 17:53:46 +01:00
parent 0cffb7f365
commit 3291f94e07
36 changed files with 42 additions and 32 deletions

View File

@ -22,6 +22,11 @@ config HAS_ARCH_32BIT
help help
Indicates that the CPU has a 32-bits architecture. Indicates that the CPU has a 32-bits architecture.
config HAS_ARCH_64BIT
bool
help
Indicates that the CPU has a 64-bits architecture.
config HAS_ARCH_ARM config HAS_ARCH_ARM
bool bool
help help

View File

@ -8,7 +8,7 @@
config PACKAGE_CIFRA config PACKAGE_CIFRA
bool "Cifra cryptographic primitives" bool "Cifra cryptographic primitives"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
help help
Cifra is a collection of cryptographic primitives targeted at Cifra is a collection of cryptographic primitives targeted at
embedded use. embedded use.

View File

@ -1,2 +1,2 @@
# Cifra is only supported by 32 bit architectures # Cifra is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -8,7 +8,7 @@
config PACKAGE_CN-CBOR config PACKAGE_CN-CBOR
bool "Constrained Node CBOR" bool "Constrained Node CBOR"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
select MODULE_POSIX_HEADERS select MODULE_POSIX_HEADERS
help help
A constrained node implementation of CBOR in C. A constrained node implementation of CBOR in C.

View File

@ -1,4 +1,4 @@
USEMODULE += posix_headers USEMODULE += posix_headers
# CN-CBOR is only supported by 32 bit architectures # CN-CBOR is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -1,5 +1,5 @@
# FlashDB is only supported by 32 bit architectures # FlashDB is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit
CFLAGS += -DFDB_USING_NATIVE_ASSERT CFLAGS += -DFDB_USING_NATIVE_ASSERT
ifneq (,$(filter flashdb_tsdb,$(USEMODULE))) ifneq (,$(filter flashdb_tsdb,$(USEMODULE)))

View File

@ -9,4 +9,4 @@ config PACKAGE_HACL
bool "High Assurance Cryptographic Library package" bool "High Assurance Cryptographic Library package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on MODULE_RANDOM depends on MODULE_RANDOM
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT

View File

@ -1,4 +1,4 @@
USEMODULE+=random USEMODULE+=random
# HACL is only supported by 32 bit architectures # HACL is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

Binary file not shown.

View File

@ -8,7 +8,7 @@
config PACKAGE_JERRYSCRIPT config PACKAGE_JERRYSCRIPT
bool "Ultra-lightweight Javascript interpreter" bool "Ultra-lightweight Javascript interpreter"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
select MODULE_JERRYSCRIPT-PORT-DEFAULT select MODULE_JERRYSCRIPT-PORT-DEFAULT
select MODULE_JERRYSCRIPT-EXT select MODULE_JERRYSCRIPT-EXT

View File

@ -2,4 +2,4 @@ USEMODULE += jerryscript-port-default
USEMODULE += jerryscript-ext USEMODULE += jerryscript-ext
# Jerryscript is only supported by 32-bit architectures # Jerryscript is only supported by 32-bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -9,4 +9,4 @@ config PACKAGE_LIBHYDROGEN
bool "LibHydrogen Crypto Library package" bool "LibHydrogen Crypto Library package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on MODULE_RANDOM depends on MODULE_RANDOM
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT

View File

@ -3,4 +3,4 @@ USEMODULE += random
# libhydrogen is only supported by 32 bit architectures # libhydrogen is only supported by 32 bit architectures
# AVR boards: require avr-gcc >= 7.0 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60040) # AVR boards: require avr-gcc >= 7.0 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60040)
# MSP430 boards: invalid alignment of 'hydro_random_context' # MSP430 boards: invalid alignment of 'hydro_random_context'
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -7,5 +7,5 @@ ifneq (,$(filter lorabasics_sx1280_driver,$(USEMODULE)))
USEMODULE += lorabasics_driver_sx1280_hal USEMODULE += lorabasics_driver_sx1280_hal
endif endif
# This package has assumptions that only work for 32-bit architectures # This package has assumptions that only work for 32-bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit
USEMODULE += lorabasics_smtc_ral USEMODULE += lorabasics_smtc_ral

View File

@ -8,7 +8,7 @@
config PACKAGE_LUA config PACKAGE_LUA
bool "LUA language package" bool "LUA language package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
depends on !HAS_ARCH_RISCV depends on !HAS_ARCH_RISCV
depends on !MODULE_PICOLIBC depends on !MODULE_PICOLIBC

View File

@ -3,7 +3,7 @@ USEMODULE += lua-contrib
USEMODULE += printf_float USEMODULE += printf_float
# LUA is only supported by 32-bit architectures # LUA is only supported by 32-bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit
# LUA is not supported on RISCV because of build issues with the toolchain # LUA is not supported on RISCV because of build issues with the toolchain
# (undefined reference to _times, _unlink and _link functions in provided # (undefined reference to _times, _unlink and _link functions in provided

View File

@ -1,6 +1,6 @@
# lwIP's memory management doesn't seem to work on non 32-bit platforms at the # lwIP's memory management doesn't seem to work on non 32-bit platforms at the
# moment. # moment.
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit
DEFAULT_MODULE += auto_init_lwip DEFAULT_MODULE += auto_init_lwip

View File

@ -17,6 +17,11 @@ PSEUDOMODULES += lwip_udp
PSEUDOMODULES += lwip_udplite PSEUDOMODULES += lwip_udplite
PSEUDOMODULES += lwip_sock_async PSEUDOMODULES += lwip_sock_async
ifneq (,$(filter arch_64bit,$(FEATURES_USED)))
# Required for platforms where sizeof(void*) > 4
CFLAGS += -DIPV6_FRAG_COPYHEADER=1
endif
ifneq (,$(filter lwip_contrib,$(USEMODULE))) ifneq (,$(filter lwip_contrib,$(USEMODULE)))
DIRS += $(RIOTBASE)/pkg/lwip/contrib DIRS += $(RIOTBASE)/pkg/lwip/contrib
endif endif

View File

@ -616,7 +616,7 @@ ssize_t lwip_sock_sendv(struct netconn *conn, const iolist_t *snips,
struct netconn *tmp; struct netconn *tmp;
struct netbuf *buf = NULL; struct netbuf *buf = NULL;
size_t payload_len = 0; size_t payload_len = 0;
int res; ssize_t res;
err_t err= ERR_OK; err_t err= ERR_OK;
u16_t remote_port = 0; u16_t remote_port = 0;

Binary file not shown.

View File

@ -8,7 +8,7 @@
config PACKAGE_MONOCYPHER config PACKAGE_MONOCYPHER
bool "Monocypher high performance cryptographic library package" bool "Monocypher high performance cryptographic library package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
select MODULE_MONOCYPHER_OPTIONAL select MODULE_MONOCYPHER_OPTIONAL
help help
Provides functions for authenticated encryption, hashing, Provides functions for authenticated encryption, hashing,

View File

@ -2,4 +2,4 @@
USEMODULE += monocypher_optional USEMODULE += monocypher_optional
# monocypher is only supported by 32 bit architectures # monocypher is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -8,4 +8,4 @@
config PACKAGE_QCBOR config PACKAGE_QCBOR
bool "QCBOR CBOR encoder/decoder" bool "QCBOR CBOR encoder/decoder"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT

View File

@ -1 +1 @@
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -8,7 +8,7 @@
menuconfig PACKAGE_TINYCBOR menuconfig PACKAGE_TINYCBOR
bool "Tiny CBOR encode/decoder package" bool "Tiny CBOR encode/decoder package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
help help
TinyCBOR is a CBOR encoder and decoder with a very small TinyCBOR is a CBOR encoder and decoder with a very small
footprint, optimized for very fast operation. footprint, optimized for very fast operation.

View File

@ -1,2 +1,2 @@
# tinycbor is only supported by 32 bit architectures # tinycbor is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -8,4 +8,4 @@
config PACKAGE_TINYCRYPT config PACKAGE_TINYCRYPT
bool "TinyCrypt crypto library package" bool "TinyCrypt crypto library package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT

View File

@ -1 +1 @@
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -32,7 +32,7 @@ choice USB_IMPLEMENTATION
menuconfig PACKAGE_TINYUSB menuconfig PACKAGE_TINYUSB
bool "TinyUSB stack package" bool "TinyUSB stack package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
depends on HAS_TINYUSB_DEVICE || HAS_TINYUSB_HOST depends on HAS_TINYUSB_DEVICE || HAS_TINYUSB_HOST
select MODULE_FMT select MODULE_FMT
select MODULE_LUID select MODULE_LUID

View File

@ -8,7 +8,7 @@
menuconfig PACKAGE_TLSF menuconfig PACKAGE_TLSF
bool "TLFS malloc/realloc/free/etc package" bool "TLFS malloc/realloc/free/etc package"
depends on TEST_KCONFIG depends on TEST_KCONFIG
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
help help
TLSF provides an implementation of malloc/realloc/free/etc. TLSF provides an implementation of malloc/realloc/free/etc.

View File

@ -9,4 +9,4 @@ ifneq (,$(filter tlsf-malloc,$(USEMODULE)))
endif endif
# tlsf is not compatible with 8bit and 16bit architectures # tlsf is not compatible with 8bit and 16bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -14,7 +14,7 @@ menuconfig PACKAGE_UWB-DW1000
select MODULE_PERIPH_GPIO_IRQ select MODULE_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_SPI depends on HAS_PERIPH_SPI
select MODULE_PERIPH_SPI select MODULE_PERIPH_SPI
depends on HAS_ARCH_32BIT depends on HAS_ARCH_32BIT || HAS_ARCH_64BIT
if PACKAGE_UWB-DW1000 if PACKAGE_UWB-DW1000

View File

@ -7,4 +7,4 @@ FEATURES_REQUIRED += periph_gpio_irq
FEATURES_REQUIRED += periph_spi FEATURES_REQUIRED += periph_spi
# Some of the pkg operation would overflow on 16bit # Some of the pkg operation would overflow on 16bit
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -91,4 +91,4 @@ ifneq (,$(filter native,$(CPU)))
endif endif
# wolfssl is only supported by 32 bit architectures # wolfssl is only supported by 32 bit architectures
FEATURES_REQUIRED += arch_32bit FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit

View File

@ -73,7 +73,7 @@ extern "C" {
#endif #endif
/* defined somewhere else */ /* defined somewhere else */
int strncasecmp(const char *s1, const char * s2, unsigned int sz); int strncasecmp(const char *s1, const char * s2, size_t sz);
#define SINGLE_THREADED #define SINGLE_THREADED

View File

@ -85,7 +85,7 @@ void sock_dtls_session_destroy(sock_tls_t *sk)
#endif #endif
#include <ctype.h> #include <ctype.h>
int strncasecmp(const char *s1, const char * s2, unsigned int sz) int strncasecmp(const char *s1, const char * s2, size_t sz)
{ {
unsigned int i; unsigned int i;
for( i = 0; i < sz; i++) { for( i = 0; i < sz; i++) {