From a307d88f437aabe53824feb5a735e570edf12579 Mon Sep 17 00:00:00 2001 From: Thomas Sowell Date: Tue, 23 Oct 2018 20:51:30 -0800 Subject: [PATCH] BUILD: Fix Dreamcast crt0 link order Correct a regression introduced in 7557f17ed2 which caused the Dreamcast to hang at the license screen when running SCUMMVM.BIN from a CD. 7557f17ed2 fixed configure's feature detection by moving crt0.o from LDFLAGS to LIBS, but that changed the linking order resulting in the start symbol from crt0 being located at an address other than 0x8c010000. ELF binaries loaded over serial or TCP/IP were unaffected (presumably because the loaders use the start address from the ELF header instead of a fixed address) which is probably why this went unnoticed. This commit corrects the link order by moving crt0 back into LDFLAGS and adds "-lronin -lm" to LDFLAGS to ensure that configure checks continue to work. --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 5794d864ec34..f590fe6c68a6 100755 --- a/configure +++ b/configure @@ -3424,12 +3424,14 @@ case $_backend in append_var LDFLAGS "-Wl,-Ttext,0x8c010000" append_var LDFLAGS "-nostartfiles" append_var LDFLAGS "-L$RONINDIR/lib" - append_var LIBS "$RONINDIR/lib/crt0.o" + append_var LDFLAGS "$RONINDIR/lib/crt0.o" # Enable serial debugging output only when --enable-debug is passed if test "$_release_build" = yes -o "$_debug_build" != yes; then append_var LIBS "-lronin-noserial -lm" + append_var LDFLAGS "-lronin-noserial -lm" else append_var LIBS "-lronin -lm" + append_var LDFLAGS "-lronin -lm" fi ;; dingux)