Help : warnings when build uclibc for mips
Khem Raj
raj.khem at gmail.com
Tue Jul 14 07:27:37 UTC 2009
On (13/07/09 05:29), Mike Frysinger wrote:
> On Tuesday 16 June 2009 16:35:04 Khem Raj wrote:
> > On Sun, May 31, 2009 at 12:00 AM, Amker.Cheng<amker.cheng at gmail.com> wrote:
> > > Hi:
> > > I am currently building uclibc-0.9.30 using gcc-3.4.4 for
> > >
> > > mips-linux, and encountering following warnings:
> > >> libc/sysdeps/linux/mips/clone.S: Assembler messages:
> > >> libc/sysdeps/linux/mips/clone.S:122: Warning: No .frame pseudo-op used
> > >> in PIC code libc/sysdeps/linux/mips/clone.S:75: Warning: Pretending
> > >> global symbol used as branch target is local.
> > >>
> > >> libc/sysdeps/linux/mips/crt1.S: Assembler messages:
> > >> libc/sysdeps/linux/mips/crt1.S:134: Warning: No .cprestore pseudo-op
> > >> used in PIC code
> > >
> > > Somebody may found these warnings before, But I could not find any
> > > explanation or solutions
> > >
> > > So, Could anyone help? Thanks in advance.
> >
> > What assembler/binutils version are you using ?
> > is it possible for you to use a newer release
>
> fwiw, i see the same warnings with binutils-2.17 and gcc-4.1.1. i dont feel
> like those are terribly old.
> -mike
Hi
Here is a patch to silence these warnings. I have not tested it. see if
it helps
Thanks
-Khem
-------------- next part --------------
diff --git a/libc/sysdeps/linux/mips/clone.S b/libc/sysdeps/linux/mips/clone.S
index 716cd99..15fa295 100644
--- a/libc/sysdeps/linux/mips/clone.S
+++ b/libc/sysdeps/linux/mips/clone.S
@@ -55,8 +55,8 @@ clone:
/* Sanity check arguments. */
li v0,EINVAL
- beqz a0,error /* No NULL function pointers. */
- beqz a1,error /* No NULL stack pointers. */
+ beqz a0,L(error) /* No NULL function pointers. */
+ beqz a1,L(error) /* No NULL stack pointers. */
#if _MIPS_SIM != _MIPS_SIM_ABI32
and a1,~(16-1) /* force alignment */
@@ -71,8 +71,8 @@ clone:
li v0,__NR_clone
syscall
- bnez a3,error
- beqz v0,__thread_start
+ bnez a3,L(error)
+ beqz v0,L(__thread_start)
/* Successful return from the parent */
#if _MIPS_SIM != _MIPS_SIM_ABI32
@@ -82,7 +82,7 @@ clone:
j $31 ; nop
/* Something bad happened -- no child created */
-error:
+L(error):
#if _MIPS_SIM != _MIPS_SIM_ABI32
.cpreturn
#endif
@@ -104,12 +104,14 @@ error:
its own function so that we can terminate the stack trace with our
debug info. */
-.globl __thread_start;
+ .globl __thread_start;
.align 2;
.ent __thread_start, 0;
__thread_start:
+L(__thread_start):
#if _MIPS_SIM == _MIPS_SIM_ABI32
+ .frame sp, 24, sp
/* cp is already loaded. */
.cprestore 16
#endif
@@ -123,5 +125,10 @@ __thread_start:
/* Call _exit rather than doing it inline for breakpoint purposes. */
move a0,v0
- jal HIDDEN_JUMPTARGET(_exit)
+#ifdef __PIC__
+ PTR_LA t9,_exit
+ jalr t9
+#else
+ jal _exit
+#endif
.end __thread_start
diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
index 2e38cf0..e851d52 100644
--- a/libc/sysdeps/linux/mips/crt1.S
+++ b/libc/sysdeps/linux/mips/crt1.S
@@ -81,10 +81,12 @@
#endif
.type main, at function
.type __uClibc_main, at function
+ .ent __start
__start:
#ifdef __PIC__
#if _MIPS_SIM == _MIPS_SIM_ABI32
+ .frame sp, 24, sp
.set noreorder
move $0, $31 /* Save old ra. */
bal 10f /* Find addr of cpload. */
@@ -93,6 +95,7 @@ __start:
.cpload $31
move $31, $0
.set reorder
+ .cprestore 16
#else
move $0, $31; /* Save old ra. */
.set noreorder
@@ -108,7 +111,6 @@ __start:
move $31, $0
#endif
-
PTR_LA $4, main /* main */
PTR_L $5, 0($29) /* argc */
PTR_ADDIU $6, $29, PTRSIZE /* argv */
@@ -136,6 +138,7 @@ hlt:
/* Crash if somehow `__uClibc_main' returns anyway. */
b hlt
.size __start,.-__start
+.end __start
/* Define a symbol for the first piece of initialized data. */
.data
diff --git a/libc/sysdeps/linux/mips/sys/asm.h b/libc/sysdeps/linux/mips/sys/asm.h
index 76f6af3..79d1439 100644
--- a/libc/sysdeps/linux/mips/sys/asm.h
+++ b/libc/sysdeps/linux/mips/sys/asm.h
@@ -97,6 +97,7 @@ l: \
# define SETUP_GPX64_L(cp_reg, ra_save, l)
# define RESTORE_GP64
# define USE_ALT_CP(a)
+# define L(label) $L ## label
#else /* (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32) */
/*
* For callee-saved gp calling convention:
@@ -131,6 +132,7 @@ l: \
/* Use alternate register for context pointer. */
# define USE_ALT_CP(reg) \
.cplocal reg
+# define L(label) .L ## label
#endif /* _MIPS_SIM != _MIPS_SIM_ABI32 */
/*
More information about the uClibc
mailing list