Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06796 Compiling Minor Always Dec 16, 2017, 21:44 26 days ago
Tester EoceneMiacid View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Acknowledged Driver spectrum.cpp
Version 0.192 Fixed in Version Build 64-bit
Summary MESS-specific 06796: spectrum and clones: Unable to compile tinybuild with spectrum included due to microdrive-related error
Description Ever since 0.190 (I presume), I cannot compile a tiny build with the spectrum driver included anymore.
Probably related to the recent microdrive changes?

Output is:
Compiling generated/mame/tinymame/drivlist.cpp...
Linking tinymame64...
../../../../linux_gcc/bin/x64/Release/mame_tinymame/liboptional.a(intf1.o): In function `spectrum_intf1_device::spectrum_intf1_device(machine_config const&, char const*, device_t*, unsigned int)':
intf1.cpp:(.text+0x2fa): undefined reference to `vtable for device_finder<microdrive_image_device, true>'
../../../../linux_gcc/bin/x64/Release/mame_tinymame/liboptional.a(intf1.o): In function `delegate_generic_class* delegate_base<void, int>::late_bind_helper<microdrive_image_device>(delegate_late_bind&)':
intf1.cpp:(.text._ZN13delegate_baseIvJiEE16late_bind_helperI23microdrive_image_deviceEEP22delegate_generic_classR18delegate_late_bind[_ZN13delegate_baseIvJiEE16late_bind_helperI23microdrive_image_deviceEEP22delegate_generic_classR18delegate_late_bind]+0x4): undefined reference to `typeinfo for microdrive_image_device'
intf1.cpp:(.text._ZN13delegate_baseIvJiEE16late_bind_helperI23microdrive_image_deviceEEP22delegate_generic_classR18delegate_late_bind[_ZN13delegate_baseIvJiEE16late_bind_helperI23microdrive_image_deviceEEP22delegate_generic_classR18delegate_late_bind]+0x30): undefined reference to `typeinfo for microdrive_image_device'
../../../../linux_gcc/bin/x64/Release/mame_tinymame/liboptional.a(intf1.o): In function `spectrum_intf1_device::device_add_mconfig(machine_config&)':
intf1.cpp:(.text.unlikely+0x6f): undefined reference to `MICRODRIVE'
intf1.cpp:(.text.unlikely+0x95): undefined reference to `microdrive_image_device::comms_in_w(int)'
collect2: error: ld returned 1 exit status
tinymame.make:250: recipe for target '../../../../../tinymame64' failed
make[2]: *** [../../../../../tinymame64] Error 1
Makefile:97: recipe for target 'tinymame' failed
make[1]: *** [tinymame] Error 2
makefile:1243: recipe for target 'linux_x64' failed
make: *** [linux_x64] Error 2
Steps To Reproduce Compile mame source with

make TARGET=mame SUBTARGET=tinymame SOURCES=src/mame/drivers/spectrum.cpp REGENIE=1 -j5
Additional Information
Flags
Regression Version
Affected Sets / Systems spectrum and clones
Attached Files
 
Relationships
There are no relationsihp linked to this issue.
Notes
4
User avatar
No.14552
Osso
Developer
Dec 18, 2017, 17:24
For a SOURCES build you don't need to do TARGET=mame.

That said, with current GIT I can't reproduce this doing a clean compile with your exact line.
User avatar
No.14553
Tafoid
Administrator
Dec 18, 2017, 22:01
I, too, am unable to produce a error attempting to compile spectrum.cpp. I tried 0.192 in a DEBUG=1 build as well as current GIT from this morning (32-bit) and neither failed.
User avatar
No.14567
Justin Kerk
Developer
Dec 26, 2017, 21:34
This was reported to me as happening with the Internet Archive's Emscripten compile as well and I was able to reproduce it in the Emscripten environment.

The issue is that by default, the behaviour of the linker is dependent on the order in which .a files are specified on the command line passed to the linker. If the files are in the wrong order or if there is a circular dependency, the linker can incorrectly designate some functions as being never called and drop them, when in fact they are used and needed.

Rather than debugging the exact issue, the easy workaround is to pass the "--start-group" parameter to the linker which makes it evaluate all of the .a files as a single group and prevents this problem. This has already been done for MAME in scripts/genie.lua but only for the mingw* configuration. EoceneMiacid is compiling on Linux so likely the same parameter is needed there as well, and really for all configurations.

Unfortunately an upstream fix is needed before this can be done for the Emscripten port: https://github.com/kripken/emscripten/issues/5982
User avatar
No.14892
EoceneMiacid
Tester
26 days ago
> "--start-group"

Is this something I can do myself? I looked at the makefile and added the parameter to the linker but that doesn't appear to work.

The hng64 driver has the same issue since a release or two ago, as well.