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.
This commit is contained in:
Thomas Sowell 2018-10-23 20:51:30 -08:00 committed by David Turner
parent 016ddd4899
commit a307d88f43

4
configure vendored
View file

@ -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)