aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ps2
diff options
context:
space:
mode:
authorTony Puccinelli2010-06-03 00:46:24 +0000
committerTony Puccinelli2010-06-03 00:46:24 +0000
commitf1ae25baa87c6c0fbbd7b78daf6c886d8a0e68ab (patch)
tree13be059a55881a2e9d37d77eeda1b312fd48e958 /backends/platform/ps2
parentd9e46078699af4b8be14d76cca6dcd24128d8b1c (diff)
downloadscummvm-rg350-f1ae25baa87c6c0fbbd7b78daf6c886d8a0e68ab.tar.gz
scummvm-rg350-f1ae25baa87c6c0fbbd7b78daf6c886d8a0e68ab.tar.bz2
scummvm-rg350-f1ae25baa87c6c0fbbd7b78daf6c886d8a0e68ab.zip
compiles with modified linker when dynamic plugins turned off now
svn-id: r49399
Diffstat (limited to 'backends/platform/ps2')
-rw-r--r--backends/platform/ps2/Makefile.ps231
-rw-r--r--backends/platform/ps2/main_prog.ld6
-rw-r--r--backends/platform/ps2/plugin.ld21
3 files changed, 37 insertions, 21 deletions
diff --git a/backends/platform/ps2/Makefile.ps2 b/backends/platform/ps2/Makefile.ps2
index 5ca695fbf4..6f44b11ee7 100644
--- a/backends/platform/ps2/Makefile.ps2
+++ b/backends/platform/ps2/Makefile.ps2
@@ -6,9 +6,9 @@ PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /vorbis /tremor/tremor
# Set to 1 to enable, 0 to disable dynamic modules
-DYNAMIC_MODULES = 1
+DYNAMIC_MODULES = 0
-VERBOSE_BUILD=1
+VERBOSE_BUILD=0
# Test for dynamic plugins
ifeq ($(DYNAMIC_MODULES),1)
@@ -58,13 +58,14 @@ RM = rm -f
srcdir = ../../..
VPATH = $(srcdir)
-INCDIR = ../../../
-# DEPDIR = .deps
+INCDIR = $(srcdir)
+#DEPDIR = .deps
+#CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d,-MQ,"$@",-MP
DEFINES = -DUSE_VORBIS -DUSE_MAD -DUSE_TREMOR -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -O2 -Wall -Wno-multichar
-INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
-INCLUDES += -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines -I $(srcdir)/backends/platform/ps2
+INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
+INCLUDES += -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines
TARGET = elf/scummvm.elf
@@ -86,23 +87,23 @@ OBJS := backends/platform/ps2/DmaPipe.o \
backends/platform/ps2/ps2debug.o \
backends/platform/ps2/ps2loader.o
-MODULE_DIRS += .
+MODULE_DIRS += ./
include $(srcdir)/Makefile.common
-LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Tmain_prog.ld
+# Variables for dynamic plugin building
+PLUGIN_PREFIX =
+PLUGIN_SUFFIX = .plg
+PLUGIN_EXTRA_DEPS = plugin.syms scummvm-ps2.elf
+PLUGIN_LDFLAGS = -nostartfiles -Wl,-q,--just-symbols=scummvm-ps2.org.elf,-Tplugin.ld,--export-dynamic,--retain-symbols-file,plugin.syms -lstdc++ -lc
+
+LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-Tmain_prog.ld
LDFLAGS += -L $(PS2SDK)/ee/lib -L .
LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS))
LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lkernel -lstdc++
LDFLAGS += -s
-# Variables for dynamic plugin building
-PLUGIN_PREFIX =
-PLUGIN_SUFFIX = .plg
-PLUGIN_EXTRA_DEPS = plugin.ld plugin.syms
-PLUGIN_LDFLAGS = -nostartfiles -Wl,-q, -Tplugin.ld, --retain-symbols-file,plugin.syms -lstdc++ -lc
-
all: $(TARGET)
$(TARGET): $(OBJS)
- $(LD) $^ $(LDFLAGS) -o $@
+ $(LD) $(PRE_OBJS_FLAGS) $(OBJS) $(POST_OBJS_FLAGS) $(LDFLAGS) -o $@
diff --git a/backends/platform/ps2/main_prog.ld b/backends/platform/ps2/main_prog.ld
index 10b881cef9..b968bee431 100644
--- a/backends/platform/ps2/main_prog.ld
+++ b/backends/platform/ps2/main_prog.ld
@@ -219,4 +219,10 @@ SECTIONS
.debug_varnames 0 : { *(.debug_varnames) }
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+
+ /* Symbols needed by crt0.s. */
+ PROVIDE(_heap_size = -1);
+ PROVIDE(_stack = -1);
+ PROVIDE(_stack_size = 128 * 1024);
+
}
diff --git a/backends/platform/ps2/plugin.ld b/backends/platform/ps2/plugin.ld
index 1eceac4966..d6ca6dcfe6 100644
--- a/backends/platform/ps2/plugin.ld
+++ b/backends/platform/ps2/plugin.ld
@@ -2,20 +2,22 @@
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips:5900)
+SEARCH_DIR("/home/tony/GSOC/ps2/tools/ee/ee/lib");
PHDRS
{
plugin PT_LOAD ;
shorts PT_LOAD ;
}
/* Do we need any of these for elf?
- __DYNAMIC = 0; */
-_DYNAMIC_LINK = 0;
+ __DYNAMIC = 0;
+_DYNAMIC_LINK = 0; */
SECTIONS
{
/* Read-only sections, merged into text segment: */
- . = 0; //Not sure this shouldn't be 0x100000
- .interp : { *(.interp) } plugin
- .reginfo : { *(.reginfo) } plugin
+ . = 0x100000;
+ .interp : { *(.interp) } : plugin
+ .reginfo : { *(.reginfo) } : plugin
+ .dynamic : { *(.dynamic) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
@@ -129,8 +131,10 @@ SECTIONS
___plugin_dtors_end = .;
}
.jcr : { KEEP (*(.jcr)) }
+
. = __plugin_hole_start;
- .got : { *(.got.plt) *(.got) } shorts
+
+ .got : { *(.got.plt) *(.got) } : shorts
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
/* We want the small data sections together, so single-instruction offsets
@@ -202,4 +206,9 @@ SECTIONS
.debug_varnames 0 : { *(.debug_varnames) }
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+
+ /* Symbols needed by crt0.s */
+ PROVIDE(_heap_size = -1);
+ PROVIDE(_stack = -1);
+ PROVIDE(_stack_size = 128 * 1024);
}