[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] mbaserel cleanup
Hello.
Here is some cleanup prior to my future ColdFire patches on the startup code.
I saw in various places that the -mbaserel option was removed from GCC long
time ago, and has been unsupported by the MiNTLib, too. The attached patch
remove the remaining traces of that option in the MiNTLib sources.
If this is correct, please commit with the following description:
----------------------------------------------------------------------
Removed artifacts from the ancient -mbaserel GCC option and WITH_SOFT_FP.
Contributed by Vincent Riviere.
----------------------------------------------------------------------
--
Vincent Rivière
diff -aurN -x CVS mintlib.orig/buildrules mintlib/buildrules
--- mintlib.orig/buildrules 2009-01-28 16:13:26.000000000 +0100
+++ mintlib/buildrules 2009-05-29 14:19:58.312500000 +0200
@@ -11,11 +11,6 @@
# binary distributions.
ifndef top_distdir
-ifdef WITH_SOFT_FP
-SFPFLAG = -Dsfp004
-sfp = sfp
-endif
-
libc := libc$(qualifier).a
libiio := libiio$(qualifier).a
librpcsvc := librpcsvc$(qualifier).a
diff -aurN -x CVS mintlib.orig/configvars mintlib/configvars
--- mintlib.orig/configvars 2009-05-07 11:05:40.000000000 +0200
+++ mintlib/configvars 2009-05-29 14:04:27.078125000 +0200
@@ -106,7 +106,7 @@
# Define this to "${AR} s" if your system lacks the ranlib program.
RANLIB=$(toolprefix)ranlib
-# Minimal set of CFLAGS to use. The flags "-mshort", "-mbaserel"
+# Minimal set of CFLAGS to use. Additional flags for other processors
# will be added by the individual Makefiles. If you want a debuggable
# library you will have to add "-g" here. If you want more or less
# optimization you can change "-O2" to nothing, "-O" or "-O3". Don't
diff -aurN -x CVS mintlib.orig/mintlib/setjmp.S mintlib/mintlib/setjmp.S
--- mintlib.orig/mintlib/setjmp.S 2009-05-29 09:19:05.890625000 +0200
+++ mintlib/mintlib/setjmp.S 2009-05-29 14:28:49.671875000 +0200
@@ -4,14 +4,6 @@
.globl ___mint
-#ifdef __MBASE__
-#define Mint __MBASE__@(___mint:w)
-#define Sigmask __MBASE__@(__sigmask:w)
-#else
-#define Mint ___mint
-#define Sigmask __sigmask
-#endif
-
.text
.even
.globl _sigsetjmp
@@ -24,11 +16,11 @@
#endif
movel a1, a0@(52) | save sigmask for siglongjmp?
jeq SETJMP | no -- call common code
- movel Sigmask, d0 | save tos emulation signal mask
+ movel __sigmask, d0 | save tos emulation signal mask
#ifdef __MSHORT__
- tstw Mint | see if MiNT is active
+ tstw ___mint | see if MiNT is active
#else
- tstl Mint
+ tstl ___mint
#endif
jeq nomint | no -- call common code
@@ -65,9 +57,9 @@
.globl _longjmp
_longjmp:
#ifdef __MSHORT__
- tstw Mint | see if MiNT is active
+ tstw ___mint | see if MiNT is active
#else
- tstl Mint
+ tstl ___mint
#endif
jeq NOMINT | no -- do not call sigreturn
movew #0x11a, sp@- | Psigreturn() system call
@@ -82,11 +74,11 @@
#else
andw #-2,d0
#endif
- movel d0, Sigmask | restore tos emulation signal mask
+ movel d0, __sigmask | restore tos emulation signal mask
#ifdef __MSHORT__
- tstw Mint | see if MiNT is active
+ tstw ___mint | see if MiNT is active
#else
- tstl Mint
+ tstl ___mint
#endif
jeq NORESTORE | no -- do not call sigsetmask
diff -aurN -x CVS mintlib.orig/startup/Makefile mintlib/startup/Makefile
--- mintlib.orig/startup/Makefile 2000-10-12 12:56:54.000000000 +0200
+++ mintlib/startup/Makefile 2009-05-29 14:20:32.031250000 +0200
@@ -20,25 +20,13 @@
include $(top_srcdir)/configvars
include $(top_srcdir)/bindist
-STANDARD_MODULES = crt0.o gcrt0.o
-
-ifdef WITH_SHARED_TEXT
-SHARED_TEXT_MODULES = bcrt0.o bgcrt0.o
-endif
-
-OBJS = $(STANDARD_MODULES) $(SHARED_TEXT_MODULES)
+OBJS = crt0.o gcrt0.o
libdir = $(prefix)/lib
-ifdef WITH_SOFT_FP
-SFPFLAG = -Dsfp004
-endif
-
-ASFLAGS =
-
INCLUDES = -nostdinc -I$(top_srcdir)/include
-COMPILE = $(CC) $(WARN) $(CFLAGS) $(INCLUDES) $(DEFS) $(SFPFLAG) $(ASFLAGS)
+COMPILE = $(CC) $(WARN) $(CFLAGS) $(INCLUDES) $(DEFS)
all-here: $(OBJS)
@@ -50,12 +38,6 @@
gcrt0.o: $(srcdir)/crt0.S
$(COMPILE) -DGCRT0 -c $< -o $@
-bcrt0.o: $(srcdir)/crt0.S
- $(COMPILE) -mbaserel -c $< -o $@
-
-bgcrt0.o: $(srcdir)/crt0.S
- $(COMPILE) -DGCRT0 -mbaserel -c $< -o $@
-
include $(top_srcdir)/rules
install: all-here
diff -aurN -x CVS mintlib.orig/startup/crt0.S mintlib/startup/crt0.S
--- mintlib.orig/startup/crt0.S 2008-04-28 09:24:24.000000000 +0200
+++ mintlib/startup/crt0.S 2009-05-29 14:25:56.515625000 +0200
@@ -29,36 +29,12 @@
.even
.globl __start
__start:
-
-|
-| If compiled for base-relative, get address of data segment from
-| basepage and store data+32K in base register. -- hyc
-
-#ifdef __MBASE__
-
-#define Base __MBASE__@(__base:w)
-#define Heapbase __MBASE__@(__heapbase:w)
-#define Stksize __MBASE__@(__stksize:w)
-
- movl a0, a1
- cmpw #0, a1
- jne skip0
- movl sp@(4), a1
-skip0: movl a1@(16), __MBASE__
- subw #32768, __MBASE__ | 32K == -32K, so subtract to add
-#else
-
-#define Base __base
-#define Heapbase __heapbase
-#define Stksize __stksize
-
-#endif
subl a6, a6 | clear a6 for debuggers
cmpw #0, a0 | test if acc or program
jeq __startprg | if a program, go elsewhere
tstl a0@(36) | also test parent basepage pointer
jne __startprg | for accs, it must be 0
- movel a0, Base | acc basepage is in A0
+ movel a0, __base | acc basepage is in A0
lea a0@(252), sp | use the command line as a temporary stack
jmp __acc_main | function is in crtinit.c
|
@@ -67,7 +43,7 @@
|
__startprg:
movel sp@(4), a0 | get basepage
- movel a0, Base | save it
+ movel a0, __base | save it
movel a0@(4), d0 | get _base->p_hitpa
bclr #0, d0 | round off
movel d0, sp | set stack (temporarily)
diff -aurN -x CVS mintlib.orig/unix/vfork.S mintlib/unix/vfork.S
--- mintlib.orig/unix/vfork.S 2009-05-29 09:19:06.109375000 +0200
+++ mintlib/unix/vfork.S 2009-05-29 14:31:04.515625000 +0200
@@ -11,23 +11,13 @@
.text
.even
-# ifdef __MBASE__
-#define Mint __MBASE__@(___mint:w)
-#define Vfsav __MBASE__@(L_vfsav:w)
-#define Errno __MBASE__@(_errno:w)
-# else
-#define Mint ___mint
-#define Vfsav L_vfsav
-#define Errno _errno
-# endif
-
_vfork:
___vfork:
movel sp@+, a1 | save return address; this is important!
#ifdef __MSHORT__
- tstw Mint
+ tstw ___mint
# else
- tstl Mint
+ tstl ___mint
#endif
jeq L_TOS | go do the TOS thing
movew #0x113, sp@- | push MiNT Pvfork() parameter
@@ -38,20 +28,20 @@
jmp a1@ | return
L_TOS:
#ifdef __mcoldfire__
- lea Vfsav, a0
+ lea L_vfsav, a0
moveml d2-d7/a1-a6, a0@ | save registers
#else
- moveml d2-d7/a1-a6, Vfsav | save registers
+ moveml d2-d7/a1-a6, L_vfsav | save registers
#endif
- pea Vfsav
+ pea L_vfsav
pea pc@(L_newprog)
jbsr _tfork | tfork(L_newprog, L_vfsav)
addql #8, sp
#ifdef __mcoldfire__
- lea Vfsav, a0
+ lea L_vfsav, a0
moveml a0@, d2-d7/a1-a6 | restore reggies
#else
- moveml Vfsav, d2-d7/a1-a6 | restore reggies
+ moveml L_vfsav, d2-d7/a1-a6 | restore reggies
#endif
tstl d0 | fork went OK??
jmi L_err | no -- error
@@ -59,9 +49,9 @@
L_err:
negl d0
#ifdef __MSHORT__
- movew d0, Errno | save error code in errno
+ movew d0, _errno | save error code in errno
# else
- movel d0, Errno | save error code in errno
+ movel d0, _errno | save error code in errno
# endif
moveql #-1, d0 | return -1
jmp a1@ | return