Skip to content

Commit

Permalink
BUILD: Fix Dreamcast crt0 link order
Browse files Browse the repository at this point in the history
Correct a regression introduced in 7557f17 which caused the Dreamcast
to hang at the license screen when running SCUMMVM.BIN from a CD.
7557f17 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.
  • Loading branch information
tsowell authored and David Turner committed Oct 25, 2018
1 parent 016ddd4 commit a307d88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion configure
Expand Up @@ -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)
Expand Down

0 comments on commit a307d88

Please sign in to comment.