1
0
mirror of https://github.com/systemd/systemd synced 2026-04-11 09:34:51 +02:00

Compare commits

..

No commits in common. "a9cab9f5cf6fe7ec9922340bc8761a083843113b" and "8470a16d6f95312019f2f48de3c4e2b58910eae3" have entirely different histories.

11 changed files with 6 additions and 61 deletions

View File

@ -3,9 +3,5 @@
set -eu set -eu
set -o pipefail set -o pipefail
# In kernel's arch/parisc/include/uapi/asm/errno.h, ECANCELLED and EREFUSED are defined as aliases of
# ECANCELED and ECONNREFUSED, respectively. Let's drop them.
${1:?} -dM -include errno.h - </dev/null | \ ${1:?} -dM -include errno.h - </dev/null | \
grep -Ev '^#define[[:space:]]+(ECANCELLED|EREFUSED)' | \
awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }' awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'

View File

@ -24,16 +24,12 @@ typedef struct StaticDestructor {
typeof(variable) *q = p; \ typeof(variable) *q = p; \
func(q); \ func(q); \
} \ } \
/* Older compilers don't know retain attribute. */ \
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \
/* The actual destructor structure we place in a special section to find it */ \ /* The actual destructor structure we place in a special section to find it */ \
_section_("SYSTEMD_STATIC_DESTRUCT") \ _section_("SYSTEMD_STATIC_DESTRUCT") \
/* We pick pointer alignment, since that is apparently what gcc does for static variables */ \ /* We pick pointer alignment, since that is apparently what gcc does for static variables */ \
_alignptr_ \ _alignptr_ \
/* Make sure this is not dropped from the image because not explicitly referenced */ \ /* Make sure this is not dropped from the image because not explicitly referenced */ \
_used_ \ _used_ \
/* Prevent linker from garbage collection. */ \
_retain_ \
/* Make sure that AddressSanitizer doesn't pad this variable: we want everything in this section /* Make sure that AddressSanitizer doesn't pad this variable: we want everything in this section
* packed next to each other so that we can enumerate it. */ \ * packed next to each other so that we can enumerate it. */ \
_variable_no_sanitize_address_ \ _variable_no_sanitize_address_ \

View File

@ -139,7 +139,7 @@ static int detect_vm_device_tree(void) {
#endif #endif
} }
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch64) #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
static int detect_vm_dmi_vendor(void) { static int detect_vm_dmi_vendor(void) {
static const char *const dmi_vendors[] = { static const char *const dmi_vendors[] = {
"/sys/class/dmi/id/product_name", /* Test this before sys_vendor to detect KVM over QEMU */ "/sys/class/dmi/id/product_name", /* Test this before sys_vendor to detect KVM over QEMU */
@ -226,10 +226,10 @@ static int detect_vm_smbios(void) {
log_debug("DMI BIOS Extension table does not indicate virtualization."); log_debug("DMI BIOS Extension table does not indicate virtualization.");
return SMBIOS_VM_BIT_UNSET; return SMBIOS_VM_BIT_UNSET;
} }
#endif /* defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch64) */ #endif /* defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) */
static int detect_vm_dmi(void) { static int detect_vm_dmi(void) {
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch64) #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
int r; int r;
r = detect_vm_dmi_vendor(); r = detect_vm_dmi_vendor();

View File

@ -13,7 +13,6 @@
#define _pure_ __attribute__((__pure__)) #define _pure_ __attribute__((__pure__))
#define _section_(x) __attribute__((__section__(x))) #define _section_(x) __attribute__((__section__(x)))
#define _packed_ __attribute__((__packed__)) #define _packed_ __attribute__((__packed__))
#define _retain_ __attribute__((__retain__))
#define _used_ __attribute__((__used__)) #define _used_ __attribute__((__used__))
#define _unused_ __attribute__((__unused__)) #define _unused_ __attribute__((__unused__))
#define _cleanup_(x) __attribute__((__cleanup__(x))) #define _cleanup_(x) __attribute__((__cleanup__(x)))

View File

@ -38,7 +38,7 @@ int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_lis
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \ _Pragma("GCC diagnostic ignored \"-Wattributes\"") \
_section_("SYSTEMD_BUS_ERROR_MAP") \ _section_("SYSTEMD_BUS_ERROR_MAP") \
_used_ \ _used_ \
_retain_ \ __attribute__((retain)) \
_alignptr_ \ _alignptr_ \
_variable_no_sanitize_address_ _variable_no_sanitize_address_

View File

@ -57,8 +57,7 @@ typedef struct TestFunc {
/* See static-destruct.h for an explanation of how this works. */ /* See static-destruct.h for an explanation of how this works. */
#define REGISTER_TEST(func, ...) \ #define REGISTER_TEST(func, ...) \
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \ _section_("SYSTEMD_TEST_TABLE") _alignptr_ _used_ _variable_no_sanitize_address_ \
_section_("SYSTEMD_TEST_TABLE") _alignptr_ _used_ _retain_ _variable_no_sanitize_address_ \
static const TestFunc UNIQ_T(static_test_table_entry, UNIQ) = { \ static const TestFunc UNIQ_T(static_test_table_entry, UNIQ) = { \
.f = (union f) &(func), \ .f = (union f) &(func), \
.name = STRINGIFY(func), \ .name = STRINGIFY(func), \

View File

@ -574,9 +574,6 @@ tests += [
[['src/test/test-arphrd-util.c', [['src/test/test-arphrd-util.c',
generated_gperf_headers]], generated_gperf_headers]],
[['src/test/test-errno-list.c',
generated_gperf_headers]],
[['src/test/test-ip-protocol-list.c', [['src/test/test-ip-protocol-list.c',
shared_generated_gperf_headers]], shared_generated_gperf_headers]],

View File

@ -1,33 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "errno-list.h"
#include "errno-to-name.h"
#include "macro.h"
#include "string-util.h"
#include "tests.h"
#include "util.h"
TEST(errno_list) {
for (size_t i = 0; i < ELEMENTSOF(errno_names); i++) {
if (errno_names[i]) {
assert_se(streq(errno_to_name(i), errno_names[i]));
assert_se(errno_from_name(errno_names[i]) == (int) i);
}
}
#ifdef ECANCELLED
/* ECANCELLED is an alias of ECANCELED. */
assert_se(streq(errno_to_name(ECANCELLED), "ECANCELED"));
#endif
assert_se(streq(errno_to_name(ECANCELED), "ECANCELED"));
#ifdef EREFUSED
/* EREFUSED is an alias of ECONNREFUSED. */
assert_se(streq(errno_to_name(EREFUSED), "ECONNREFUSED"));
#endif
assert_se(streq(errno_to_name(ECONNREFUSED), "ECONNREFUSED"));
}
DEFINE_TEST_MAIN(LOG_INFO);

View File

@ -381,8 +381,6 @@ static void test_exec_personality(Manager *m) {
#elif defined(__i386__) #elif defined(__i386__)
test(m, "exec-personality-x86.service", 0, CLD_EXITED); test(m, "exec-personality-x86.service", 0, CLD_EXITED);
#elif defined(__loongarch64)
test(m, "exec-personality-loongarch64.service", 0, CLD_EXITED);
#else #else
log_notice("Unknown personality, skipping %s", __func__); log_notice("Unknown personality, skipping %s", __func__);
#endif #endif

View File

@ -133,7 +133,7 @@ udev_progs = [['ata_id/ata_id.c'],
'mtd_probe/mtd_probe.h', 'mtd_probe/mtd_probe.h',
'mtd_probe/probe_smartmedia.c']] 'mtd_probe/probe_smartmedia.c']]
dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips'] dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'mips']
if dmi_arches.contains(host_machine.cpu_family()) if dmi_arches.contains(host_machine.cpu_family())
udev_progs += [['dmi_memory_id/dmi_memory_id.c']] udev_progs += [['dmi_memory_id/dmi_memory_id.c']]
endif endif

View File

@ -1,7 +0,0 @@
[Unit]
Description=Test for Personality=loongarch64
[Service]
ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")'
Type=oneshot
Personality=loongarch64