hurd: Move some i386 bits to x86

As they will actually be usable on x86_64 too.
This commit is contained in:
Samuel Thibault 2023-02-02 00:27:26 +01:00
parent fa93858a88
commit e0dc827bf6
10 changed files with 129 additions and 107 deletions

View File

@ -227,3 +227,65 @@ LDLIBS-pthread.so += $(objdir)/hurd/libhurduser.so
LDLIBS-c_malloc_debug.so += $(link-rpcuserlibs)
endif # in-Makerules
# For bug 23286
ifeq ($(subdir),hurd)
test-xfail-check-abi-libhurduser = yes
endif
ifeq ($(subdir),mach)
test-xfail-check-abi-libmachuser = yes
endif
# For bug 25521
# (setpshared support)
ifeq ($(subdir),malloc)
test-xfail-tst-mallocfork2 = yes
test-xfail-tst-mallocfork2-mcheck = yes
test-xfail-tst-mallocfork2-malloc-check = yes
test-xfail-tst-mallocfork2-malloc-hugetlb1 = yes
test-xfail-tst-mallocfork2-malloc-hugetlb2 = yes
endif
ifeq ($(subdir),htl)
test-xfail-tst-mutex4 = yes
test-xfail-tst-cancel16 = yes
test-xfail-tst-cancelx16 = yes
test-xfail-tst-cond4 = yes
test-xfail-tst-cond6 = yes
test-xfail-tst-cond12 = yes
test-xfail-tst-cond13 = yes
test-xfail-tst-cond23 = yes
test-xfail-tst-rwlock4 = yes
test-xfail-tst-rwlock12 = yes
test-xfail-tst-barrier2 = yes
test-xfail-tst-pututxline-cache = yes
test-xfail-tst-pututxline-lockfail = yes
test-xfail-tst-flock2 = yes
test-xfail-tst-signal1 = yes
test-xfail-tst-signal2 = yes
endif
ifeq ($(subdir),htl)
# For bug 25522
# (setprotocol support)
test-xfail-tst-cond24 = yes
test-xfail-tst-cond25 = yes
# For bug 25563
# (robust support against dead threads)
test-xfail-tst-robust1 = yes
test-xfail-tst-robust2 = yes
test-xfail-tst-robust3 = yes
test-xfail-tst-robust4 = yes
test-xfail-tst-robust5 = yes
test-xfail-tst-robust6 = yes
test-xfail-tst-robust7 = yes
test-xfail-tst-robust9 = yes
endif
ifeq ($(subdir),elf)
# We do use nested functions involving creation of trampolines, notably for
# callbacks whose parameters don't permit to get the context parameters.
check-execstack-xfail += ld.so libc.so libpthread.so
# We always create a thread for signals
test-xfail-tst-single_threaded-pthread-static = yes
endif

View File

@ -1,16 +1,3 @@
ifeq ($(subdir),misc)
sysdep_routines += ioperm
sysdep_headers += sys/io.h
endif
ifeq ($(subdir),debug)
gen-as-const-headers += signal-defines.sym
endif
ifeq ($(subdir),setjmp)
gen-as-const-headers += signal-defines.sym
endif
ifeq ($(subdir),csu)
ifeq (yes,$(build-shared))
sysdep_routines += divdi3
@ -24,69 +11,3 @@ ifeq ($(subdir),conform)
# (type conformance)
conformtest-xfail-conds += i386-gnu
endif
# For bug 23286
ifeq ($(subdir),hurd)
test-xfail-check-abi-libhurduser = yes
endif
ifeq ($(subdir),mach)
test-xfail-check-abi-libmachuser = yes
endif
# For bug 25521
# (setpshared support)
ifeq ($(subdir),malloc)
test-xfail-tst-mallocfork2 = yes
test-xfail-tst-mallocfork2-mcheck = yes
test-xfail-tst-mallocfork2-malloc-check = yes
test-xfail-tst-mallocfork2-malloc-hugetlb1 = yes
test-xfail-tst-mallocfork2-malloc-hugetlb2 = yes
endif
ifeq ($(subdir),htl)
test-xfail-tst-mutex4 = yes
test-xfail-tst-cancel16 = yes
test-xfail-tst-cancelx16 = yes
test-xfail-tst-cond4 = yes
test-xfail-tst-cond6 = yes
test-xfail-tst-cond12 = yes
test-xfail-tst-cond13 = yes
test-xfail-tst-cond23 = yes
test-xfail-tst-rwlock4 = yes
test-xfail-tst-rwlock12 = yes
test-xfail-tst-barrier2 = yes
test-xfail-tst-pututxline-cache = yes
test-xfail-tst-pututxline-lockfail = yes
test-xfail-tst-flock2 = yes
test-xfail-tst-signal1 = yes
test-xfail-tst-signal2 = yes
endif
ifeq ($(subdir),htl)
# For bug 25522
# (setprotocol support)
test-xfail-tst-cond24 = yes
test-xfail-tst-cond25 = yes
# For bug 25563
# (robust support against dead threads)
test-xfail-tst-robust1 = yes
test-xfail-tst-robust2 = yes
test-xfail-tst-robust3 = yes
test-xfail-tst-robust4 = yes
test-xfail-tst-robust5 = yes
test-xfail-tst-robust6 = yes
test-xfail-tst-robust7 = yes
test-xfail-tst-robust9 = yes
endif
ifeq ($(subdir),elf)
# We do use nested functions involving creation of trampolines, notably for
# callbacks whose parameters don't permit to get the context parameters.
check-execstack-xfail += ld.so libc.so libpthread.so
# We always create a thread for signals
test-xfail-tst-single_threaded-pthread-static = yes
endif
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif

View File

@ -0,0 +1,16 @@
ifeq ($(subdir),misc)
sysdep_routines += ioperm
sysdep_headers += sys/io.h
endif
ifeq ($(subdir),debug)
gen-as-const-headers += signal-defines.sym
endif
ifeq ($(subdir),setjmp)
gen-as-const-headers += signal-defines.sym
endif
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif

View File

@ -0,0 +1 @@
mach/x86

View File

@ -19,37 +19,12 @@
#ifndef _MACH_I386_SYSDEP_H
#define _MACH_I386_SYSDEP_H 1
/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
#include <dl-sysdep.h>
#include <tls.h>
#define LOSE asm volatile ("hlt")
#define SNARF_ARGS(entry_sp, argc, argv, envp) \
do \
{ \
char **p; \
argc = (int) *entry_sp; \
argv = (char **) (entry_sp + 1); \
p = argv; \
while (*p++ != NULL) \
; \
if (p >= (char **) argv[0]) \
--p; \
envp = p; \
} while (0)
#include <sysdeps/mach/x86/sysdep.h>
#define RETURN_TO(sp, pc, retval) \
asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \
: : "g" (sp), "r" (pc), "a" (retval))
#define STACK_GROWTH_DOWN
/* Get the machine-independent Mach definitions. */
#include <sysdeps/mach/sysdep.h>
/* This should be rearranged, but at the moment this file provides
the most useful definitions for assembler syntax details. */
#undef ENTRY

View File

@ -1,4 +1,4 @@
/* Old-style Unix parameters and limits. i386 Mach version.
/* Old-style Unix parameters and limits. x86 Mach version.
Copyright (C) 1993-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.

View File

@ -1,4 +1,4 @@
/* Machine-specific definition for spin locks. i386 version.
/* Machine-specific definition for spin locks. x86 version.
Copyright (C) 1994-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.

47
sysdeps/mach/x86/sysdep.h Normal file
View File

@ -0,0 +1,47 @@
/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#ifndef _MACH_X86_SYSDEP_H
#define _MACH_X86_SYSDEP_H 1
/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
#include <dl-sysdep.h>
#include <tls.h>
#define LOSE asm volatile ("hlt")
#define SNARF_ARGS(entry_sp, argc, argv, envp) \
do \
{ \
char **p; \
argc = (int) *entry_sp; \
argv = (char **) (entry_sp + 1); \
p = argv; \
while (*p++ != NULL) \
; \
if (p >= (char **) argv[0]) \
--p; \
envp = p; \
} while (0)
#define STACK_GROWTH_DOWN
/* Get the machine-independent Mach definitions. */
#include <sysdeps/mach/sysdep.h>
#endif /* mach/x86/sysdep.h */