Browse Source

Jakub Bogusz writes:

Hello,

the attached patch fixes ldso compilation on sparc-linux (at least with
sparc32 userland). It was made against uClibc 0.9.21, but it's still OK
with 0.9.26.

There were three problems:
- missing __NR_getpid definition
- conflicting prototypes in elfinterp.c
- syntax error (missing semicolon) in ldso.c

With this patch shared libraries and ldso can be built on sparc.

It contains also ldso.c syntax fix for m68k - there was the same
mistake two lines earlier; but I didn't test build on m68k.
Eric Andersen 20 years ago
parent
commit
50abd26321
3 changed files with 4 additions and 2 deletions
  1. 2 2
      ldso/ldso/ldso.c
  2. 1 0
      ldso/ldso/sparc/dl-syscalls.h
  3. 1 0
      ldso/ldso/sparc/ld_syscalls.h

+ 2 - 2
ldso/ldso/ldso.c

@@ -278,9 +278,9 @@ LD_BOOT(unsigned long args)
 #if defined(__i386__)
   __asm__("\tmovl %%ebx,%0\n\t":"=a"(got));
 #elif defined(__m68k__)
-  __asm__("movel %%a5,%0":"=g"(got))
+  __asm__("movel %%a5,%0":"=g"(got));
 #elif defined(__sparc__)
-  __asm__("\tmov %%l7,%0\n\t":"=r"(got))
+  __asm__("\tmov %%l7,%0\n\t":"=r"(got));
 #elif defined(__arm__)
   __asm__("\tmov %0, r10\n\t":"=r"(got));
 #elif defined(__powerpc__)

+ 1 - 0
ldso/ldso/sparc/dl-syscalls.h

@@ -8,6 +8,7 @@
 #define __NR_write		  4
 #define __NR_open		  5
 #define __NR_close		  6
+#define __NR_getpid		 20
 #define __NR_getuid		 24
 #define __NR_getgid		 47
 #define __NR_geteuid		 49

+ 1 - 0
ldso/ldso/sparc/ld_syscalls.h

@@ -8,6 +8,7 @@
 #define __NR_write		  4
 #define __NR_open		  5
 #define __NR_close		  6
+#define __NR_getpid		 20
 #define __NR_getuid		 24
 #define __NR_getgid		 47
 #define __NR_geteuid		 49