1 From: Bernardo Innocenti <bernie@develer.com>
3 Adjusts the linker invocation for multilib targets built
4 with -mid-shared-library.
6 FIXME: this patch messes up the common m68k-elf target configuration.
7 uClinux specific stuff ought to be moved to its own target (m68k-*-uclinux*).
9 diff -Nru gcc-3.3.1.orig/gcc/config/m68k/m68020-elf.h gcc-3.3.1/gcc/config/m68k/m68020-elf.h
10 --- gcc-3.3.1.orig/gcc/config/m68k/m68020-elf.h 2001-12-11 19:21:03.000000000 +0100
11 +++ gcc-3.3.1/gcc/config/m68k/m68020-elf.h 2003-07-25 17:52:20.000000000 +0200
14 /* This comment is here to see if it will keep Sun's cpp from dying. */
16 -/* We need to override the default specs from elfos.h. This suppresses the
17 - loading of crt0.o by gcc's default linker spec. For embedded targets crt0
18 - now comes from the linker script. */
20 +/* Undo the empty definition of STARTFILE_SPEC from m68kemb.h so we'll
21 + pick the default from gcc.c (just link crt0.o from multilib dir) */
23 -#define STARTFILE_SPEC "crtbegin.o%s"
25 -#define LIB_SPEC "-lc"
26 +/* Override the default LIB_SPEC from gcc.c. We don't currently support
27 + profiling, or libg.a. */
31 +%{mid-shared-library:-R libc.gdb%s -elf2flt -shared-lib-id 0} -lc \
34 +/* we don't want a .eh_frame section */
35 +#define EH_FRAME_IN_DATA_SECTION
37 +/* ??? Quick hack to get constructors working. Make this look more like a
38 + COFF target, so the existing dejagnu/libgloss support works. A better
39 + solution would be to make the necessary dejagnu and libgloss changes so
40 + that we can use normal the ELF constructor mechanism. */
41 +#undef INIT_SECTION_ASM_OP
42 +#undef FINI_SECTION_ASM_OP
44 +#define ENDFILE_SPEC ""
46 +/* Bring in standard linux defines
47 + FIXME: move in some separate header along with other uClinux stuff */
48 +#define TARGET_OS_CPP_BUILTINS() \
51 + builtin_define ("__uClinux__"); \
52 + builtin_define_std ("linux"); \
53 + builtin_define_std ("unix"); \
54 + builtin_define ("__gnu_linux__"); \
55 + builtin_assert ("system=posix"); \
58 + builtin_define ("__PIC__"); \
59 + builtin_define ("__pic__"); \
64 /* end of m68020-elf.h */
65 diff -Nru gcc-3.3.1.orig/gcc/config/m68k/m68kemb.h gcc-3.3.1/gcc/config/m68k/m68kemb.h
66 --- gcc-3.3.1.orig/gcc/config/m68k/m68kemb.h 2001-12-11 19:21:03.000000000 +0100
67 +++ gcc-3.3.1/gcc/config/m68k/m68kemb.h 2003-07-25 00:43:55.000000000 +0200
69 /* Override the default LIB_SPEC from gcc.c. We don't currently support
70 profiling, or libg.a. */
73 -#define LIB_SPEC "-lc"
79 /* Make this be null, since we want the crt0.o to come from the linker
81 diff -Nru gcc-3.3.1.orig/gcc/config/m68k/t-m68kelf gcc-3.3.1/gcc/config/m68k/t-m68kelf
82 --- gcc-3.3.1.orig/gcc/config/m68k/t-m68kelf 2003-07-25 00:35:34.000000000 +0200
83 +++ gcc-3.3.1/gcc/config/m68k/t-m68kelf 2003-07-25 00:43:55.000000000 +0200
85 LIBGCC = stmp-multilib
86 INSTALL_LIBGCC = install-multilib
89 -EXTRA_PARTS=crtbegin.o crtend.o
91 -#CRTSTUFF_T_CFLAGS=-fpic
92 +# We don't use crtbegin.o and crtend.o