Skip to content

Commit c08e2ef

Browse files
committed
Mod: remove in-line asm
1 parent 249a12b commit c08e2ef

File tree

101 files changed

+759
-1980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+759
-1980
lines changed

.vscode/c_cpp_properties.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/**",
7+
"${workspaceFolder}/sysdeps/unix"
8+
],
9+
"defines": [],
10+
"compilerPath": "/usr/bin/clang",
11+
"cStandard": "c17",
12+
"cppStandard": "c++14",
13+
"intelliSenseMode": "linux-clang-x64"
14+
}
15+
],
16+
"version": 4
17+
}

.vscode/settings.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"files.associations": {
3+
"cmath": "c",
4+
"complex": "c",
5+
"*.tbl": "c",
6+
"math_config.h": "c",
7+
"syscall-template.h": "c",
8+
"shlib-compat.h": "c",
9+
"sigsetops.h": "c",
10+
"socketcall.h": "c",
11+
"sysdep-cancel.h": "c",
12+
"sysdep.h": "c",
13+
"fcntl.h": "c",
14+
"sysinfo.h": "c",
15+
"kernel.h": "c",
16+
"types.h": "c",
17+
"stdlib.h": "c",
18+
"ratio": "cpp",
19+
"typeinfo": "c",
20+
"cstdlib": "c",
21+
"ieee754.h": "c",
22+
"dl-procinfo.h": "c",
23+
"unistd.h": "c",
24+
"fenv.h": "c",
25+
"functional": "c",
26+
"kernel_sigaction.h": "c"
27+
},
28+
"C_Cpp.errorSquiggles": "disabled"
29+
}

check.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Makeconfig:43: *** objdir must be defined by the build-directory Makefile. Stop.

elf/rtld.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ TLS_INIT_HELPER
401401
#endif
402402

403403
/* Helper function for syscall implementation. */
404+
// remove in-line asm
404405
#ifdef DL_SYSINFO_IMPLEMENTATION
405406
DL_SYSINFO_IMPLEMENTATION
406407
#endif

elf/sotruss-lib.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ init (void)
7676
/* Determine whether this process is supposed to be traced and if
7777
yes, whether we should print into a file. */
7878
const char *which_process = getenv ("SOTRUSS_WHICH");
79-
pid_t pid = getpid ();
79+
80+
// Dennis Edit
81+
pid_t pid = 0;
82+
// pid_t pid = getpid ();
83+
8084
int out_fd = -1;
8185
if (match_pid (pid, which_process))
8286
{
@@ -253,7 +257,10 @@ print_enter (uintptr_t *refcook, uintptr_t *defcook, const char *symname,
253257
char buf[3 * sizeof (pid_t) + 3];
254258
buf[0] = '\0';
255259
if (print_pid)
256-
snprintf (buf, sizeof (buf), "%5ld: ", (long int) getpid ());
260+
261+
// Dennis Edit
262+
snprintf (buf, sizeof (buf), "%5ld: ", (long int) 0);
263+
// snprintf (buf, sizeof (buf), "%5ld: ", (long int) getpid ());
257264

258265
fprintf (out_file, "%s%15s -> %-15s:%s%s(0x%lx, 0x%lx, 0x%lx)\n",
259266
buf, (char *) *refcook, (char *) *defcook,
@@ -340,7 +347,10 @@ print_exit (uintptr_t *refcook, uintptr_t *defcook, const char *symname,
340347
char buf[3 * sizeof (pid_t) + 3];
341348
buf[0] = '\0';
342349
if (print_pid)
343-
snprintf (buf, sizeof (buf), "%5ld: ", (long int) getpid ());
350+
351+
// Dennis Edit
352+
snprintf (buf, sizeof (buf), "%5ld: ", (long int) 0);
353+
// snprintf (buf, sizeof (buf), "%5ld: ", (long int) getpid ());
344354

345355
fprintf (out_file, "%s%15s -> %-15s:%s%s - 0x%lx\n",
346356
buf, (char *) *refcook, (char *) *defcook, " ", symname, reg);

myconfig.sh

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ set -e
1313
BUILDDIR=build
1414
mkdir -p $BUILDDIR
1515
cd $BUILDDIR
16-
../configure --prefix=/sysroot-coulson --host=i686-linux-gnu --build=i686-linux-gnu\
16+
../configure --disable-werror --disable-profile --prefix=/home/dennis/Documents/Just-One-Turtle/glibc/target --host=i686-linux-gnu --build=i686-linux-gnu \
1717
CFLAGS=" -O2 -march=i686 -g" \
1818
CC="gcc -m32" CXX="g++ -m32" \
1919
CFLAGS="-O2 -march=i686" \
2020
CXXFLAGS="-O2 -march=i686"
2121
# --with-headers=`pwd`/../kernel-headers --enable-kernel=2.2.0
22-
# --disable-shared
22+
# --disable-shared

support/shell-container.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ kill_func (char **argv)
162162
{
163163
pid_t pid;
164164
if (strcmp (argv[i], "$$") == 0)
165-
pid = getpid ();
165+
166+
// Dennis Edit
167+
pid = 0;
168+
// pid = getpid ();
169+
166170
else
167171
pid = atoi (argv[i]);
168172
kill (pid, signum);

sysdeps/generic/math-barriers.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@
2929
expression evaluations with respect to accesses to the
3030
floating-point environment. */
3131

32-
#define math_opt_barrier(x) \
33-
({ __typeof (x) __x = (x); __asm ("" : "+m" (__x)); __x; })
34-
#define math_force_eval(x) \
35-
({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "m" (__x)); })
32+
#define math_opt_barrier(x) \
33+
({ __typeof (x) __x = (x); \
34+
volatile __typeof (__x) *__px = &__x; \
35+
*__px = __x; \
36+
__x; })
37+
38+
#define math_force_eval(x) \
39+
do { \
40+
volatile __typeof (x) __x = (x); \
41+
(void)__x; \
42+
} while (0)
3643

3744
#endif /* math-barriers.h */

sysdeps/i386/fpu/fclrexcpt.c

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,9 @@
2424
int
2525
__feclearexcept (int excepts)
2626
{
27-
fenv_t temp;
28-
29-
/* Mask out unsupported bits/exceptions. */
30-
excepts &= FE_ALL_EXCEPT;
31-
32-
/* Bah, we have to clear selected exceptions. Since there is no
33-
`fldsw' instruction we have to do it the hard way. */
34-
__asm__ ("fnstenv %0" : "=m" (*&temp));
35-
36-
/* Clear the relevant bits. */
37-
temp.__status_word &= excepts ^ FE_ALL_EXCEPT;
38-
39-
/* Put the new data in effect. */
40-
__asm__ ("fldenv %0" : : "m" (*&temp));
41-
42-
/* If the CPU supports SSE, we clear the MXCSR as well. */
43-
if (CPU_FEATURE_USABLE (SSE))
44-
{
45-
unsigned int xnew_exc;
46-
47-
/* Get the current MXCSR. */
48-
__asm__ ("stmxcsr %0" : "=m" (*&xnew_exc));
49-
50-
/* Clear the relevant bits. */
51-
xnew_exc &= ~excepts;
52-
53-
/* Put the new data in effect. */
54-
__asm__ ("ldmxcsr %0" : : "m" (*&xnew_exc));
55-
}
56-
27+
#include <stdlib.h>
28+
// removed in-line asm
29+
exit(EXIT_FAILURE);
5730
/* Success. */
5831
return 0;
5932
}

sysdeps/i386/fpu/fedisblxcpt.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,8 @@
2424
int
2525
fedisableexcept (int excepts)
2626
{
27-
unsigned short int new_exc, old_exc;
28-
29-
/* Get the current control word. */
30-
__asm__ ("fstcw %0" : "=m" (*&new_exc));
31-
32-
old_exc = (~new_exc) & FE_ALL_EXCEPT;
33-
34-
excepts &= FE_ALL_EXCEPT;
35-
36-
new_exc |= excepts;
37-
__asm__ ("fldcw %0" : : "m" (*&new_exc));
38-
39-
/* If the CPU supports SSE we set the MXCSR as well. */
40-
if (CPU_FEATURE_USABLE (SSE))
41-
{
42-
unsigned int xnew_exc;
43-
44-
/* Get the current control word. */
45-
__asm__ ("stmxcsr %0" : "=m" (*&xnew_exc));
46-
47-
xnew_exc |= excepts << 7;
48-
49-
__asm__ ("ldmxcsr %0" : : "m" (*&xnew_exc));
50-
}
51-
52-
return old_exc;
27+
#include <stdlib.h>
28+
// removed in-line asm
29+
exit(EXIT_FAILURE);
30+
return 0;
5331
}

0 commit comments

Comments
 (0)