Skip to content

Commit 7d0f3db

Browse files
committed
Mod: remove in-line asm
1 parent c08e2ef commit 7d0f3db

File tree

4 files changed

+30
-51
lines changed

4 files changed

+30
-51
lines changed

configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6982,10 +6982,10 @@ else
69826982
fi
69836983
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
69846984
printf "%s\n" "$libc_linker_feature" >&6; }
6985-
if test "$libc_cv_support_undefined_version" = no; then
6986-
as_fn_error $? "support for -Wl,--undefined-version required" "$LINENO" 5
6987-
fi
6988-
libc_cv_undefined_version="-Wl,--undefined-version"
6985+
# if test "$libc_cv_support_undefined_version" = no; then
6986+
# as_fn_error $? "support for -Wl,--undefined-version required" "$LINENO" 5
6987+
# fi
6988+
# libc_cv_undefined_version="-Wl,--undefined-version"
69896989
fi
69906990
rm -f conftest.*t
69916991
fi

sysdeps/i386/abort-instr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/* An instruction which should crash any program is `hlt'. */
2-
#define ABORT_INSTRUCTION asm ("hlt")
2+
#define ABORT_INSTRUCTION __builtin_trap ()

sysdeps/unix/sysv/linux/i386/sysdep.h

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -306,27 +306,16 @@ struct libc_do_syscall_args
306306
(int) (arg1), \
307307
(int) (arg5), \
308308
(int) (arg6) \
309-
}; \
310-
asm volatile ( \
311-
"movl %1, %%eax\n\t" \
312-
"call " I386_DO_SYSCALL_STRING \
313-
: "=a" (resultvar) \
314-
: "i" (__NR_##name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \
315-
: "memory", "cc")
309+
};
310+
316311
#define INTERNAL_SYSCALL_MAIN_NCS_6(name, arg1, arg2, arg3, \
317312
arg4, arg5, arg6) \
318313
struct libc_do_syscall_args _xv = \
319314
{ \
320315
(int) (arg1), \
321316
(int) (arg5), \
322317
(int) (arg6) \
323-
}; \
324-
asm volatile ( \
325-
"movl %1, %%eax\n\t" \
326-
"call " I386_DO_SYSCALL_STRING \
327-
: "=a" (resultvar) \
328-
: "a" (name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \
329-
: "memory", "cc")
318+
};
330319

331320
#define INTERNAL_SYSCALL(name, nr, args...) \
332321
({ \
@@ -342,46 +331,26 @@ struct libc_do_syscall_args
342331
#if I386_USE_SYSENTER
343332
# ifdef PIC
344333
# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
345-
LOADREGS_##nr(args) \
346-
asm volatile ( \
347-
"call *%%gs:%P2" \
348-
: "=a" (resultvar) \
349-
: "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \
350-
ASMARGS_##nr(args) : "memory", "cc")
334+
LOADREGS_##nr(args)
335+
351336
# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
352-
LOADREGS_##nr(args) \
353-
asm volatile ( \
354-
"call *%%gs:%P2" \
355-
: "=a" (resultvar) \
356-
: "a" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
357-
ASMARGS_##nr(args) : "memory", "cc")
337+
LOADREGS_##nr(args)
338+
358339
# else /* I386_USE_SYSENTER && !PIC */
359340
# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
360-
LOADREGS_##nr(args) \
361-
asm volatile ( \
362-
"call *_dl_sysinfo" \
363-
: "=a" (resultvar) \
364-
: "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc")
341+
LOADREGS_##nr(args)
342+
365343
# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
366-
LOADREGS_##nr(args) \
367-
asm volatile ( \
368-
"call *_dl_sysinfo" \
369-
: "=a" (resultvar) \
370-
: "a" (name) ASMARGS_##nr(args) : "memory", "cc")
344+
LOADREGS_##nr(args)
345+
371346
# endif /* I386_USE_SYSENTER && !PIC */
372347
#else /* !I386_USE_SYSENTER */
373348
# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
374-
LOADREGS_##nr(args) \
375-
asm volatile ( \
376-
"int $0x80" \
377-
: "=a" (resultvar) \
378-
: "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc")
349+
LOADREGS_##nr(args)
350+
379351
# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
380-
LOADREGS_##nr(args) \
381-
asm volatile ( \
382-
"int $0x80" \
383-
: "=a" (resultvar) \
384-
: "a" (name) ASMARGS_##nr(args) : "memory", "cc")
352+
LOADREGS_##nr(args)
353+
385354
#endif /* !I386_USE_SYSENTER */
386355

387356
#define LOADREGS_0()

wasm-config.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
BUILDDIR=build
6+
mkdir -p $BUILDDIR
7+
cd $BUILDDIR
8+
../configure --disable-werror --disable-profile --with-headers=/usr/i686-linux-gnu/include --prefix=/home/dennis/Documents/Just-One-Turtle/glibc/target --host=i686-linux-gnu --build=i686-linux-gnu\
9+
CFLAGS=" -O2 -g" \
10+
CC="/home/dennis/Documents/Just-One-Turtle/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/bin/clang --target=wasm32-unkown-wasi"

0 commit comments

Comments
 (0)