Previous Thread
Next Thread
Print Thread
Joined: Mar 2008
Posts: 161
Senior Member
Senior Member
Joined: Mar 2008
Posts: 161
Trying to build Mame for Ubuntu on arm64, I get the following error:

Code
thomson.cpp:(.text.unlikely+0x40): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::ioport_configurer(device_t&, ioport_list&, std::ostream&)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0x50): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::port_alloc(char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0x68): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::field_alloc(ioport_type, unsigned int, unsigned int, char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0x78): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::string_from_token(char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0x90): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::field_add_code(input_seq_type, input_code)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0xb0): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::field_alloc(ioport_type, unsigned int, unsigned int, char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0xc0): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::string_from_token(char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0xd8): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::field_add_code(input_seq_type, input_code)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0xf8): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::field_alloc(ioport_type, unsigned int, unsigned int, char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0x108): relocation truncated to fit: R_AARCH64_CALL26 against symbol `ioport_configurer::string_from_token(char const*)' defined in .text section in ../../../../../scripts/src/libemu.a(ioport.o)
thomson.cpp:(.text.unlikely+0x120): additional relocation overflows omitted from the output

I guess this is not due to some missing g++ option, as suggested elsewhere, as this only happens in thomson.cpp so it may need some fixing.

Anyone else experimentig this? Should I open an issue in Github?

Thanks!


Master of Sarcastic Wit
Linux User #182984
Joined: Mar 2004
Posts: 702
Likes: 2
Senior Member
Senior Member
Joined: Mar 2004
Posts: 702
Likes: 2
You might need to reduce the debug level to -g1.

Joined: Feb 2004
Posts: 2,626
Likes: 332
Very Senior Member
Very Senior Member
Joined: Feb 2004
Posts: 2,626
Likes: 332
It would help if you gave the full make command you’re actually using.

Joined: Mar 2008
Posts: 161
Senior Member
Senior Member
Joined: Mar 2008
Posts: 161
Originally Posted by Vas Crabb
It would help if you gave the full make command you’re actually using.

The make command is as follows, but please note there may be some additional make variable neede by the apt packaging system:

Code
/usr/bin/make NOWERROR=1 OSD=sdl DEBUG= TARGETOS=linux DISTRO=debian-stable PTR64= BIGENDIAN= PYTHON_EXECUTABLE=python3 QT_HOME=/usr/lib/aarch64-linux-gnu/qt5/ USE_SYSTEM_LIB_ASIO=1 USE_SYSTEM_LIB_EXPAT=1 USE_SYSTEM_LIB_ZLIB=1 USE_SYSTEM_LIB_JPEG=1 USE_SYSTEM_LIB_FLAC=1 USE_SYSTEM_LIB_SQLITE3=1 USE_SYSTEM_LIB_PORTMIDI=1 USE_SYSTEM_LIB_PORTAUDIO=1 USE_BUNDLED_LIB_SDL2= USE_SYSTEM_LIB_UTF8PROC=1 USE_SYSTEM_LIB_GLM=1 USE_SYSTEM_LIB_RAPIDJSON=1 USE_SYSTEM_LIB_PUGIXML=1 VERBOSE=1 ARCHOPTS="-mabi=lp64 -fPIC" FULLNAME=mame TARGET=mame SUBTARGET=mame TOOLS=1

This is the build command of the single file:

Code
g++ -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/mame-0.275+dfsg.1-0ubuntu1~ppa1~oracular1 -g0 -O2 -Wno-error=implicit-function-declaration -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/mame-0.275+dfsg.1-0ubuntu1~ppa1~oracular1 -Wdate-time -D_FORTIFY_SOURCE=3 -Wdate-time -D_FORTIFY_SOURCE=3 -MMD -MP -MP -DNDEBUG -DCRLF=2 -DLSB_FIRST -DXMD_H -DFLAC__NO_DLL -DNATIVE_DRC=drcbe_arm64 -DASMJIT_STATIC -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DPTR64=1 -DNO_AFFINITY_NP -I"../../../../../src/osd" -I"../../../../../src/lib" -I"../../../../../src/lib/util" -I"../../../../../scripts/src" -I"../../../../../src/tools/imgtool"  -g -std=c++17 -pipe -O3 -fno-strict-aliasing -mabi=lp64 -fPIC -Wno-unknown-pragmas -Wall -Wcast-align -Wformat-security -Wundef -Wwrite-strings -Wno-conversion -Wno-sign-compare -Wno-error=deprecated-declarations -Wno-error=unused-result -Wno-error=array-bounds -Wno-error=attributes -Wno-error=stringop-truncation -Wno-stringop-overflow -Wno-nonnull -Wno-stringop-overread -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-cast-align -std=c++17 -Woverloaded-virtual -Wvla -Wimplicit-fallthrough -Wno-error=class-memaccess -Wno-xor-used-as-pow  -o "obj/Release/src/tools/imgtool/modules/thomson.o" -c "../../../../../src/tools/imgtool/modules/thomson.cpp"

Full buildlog is available (for the time being) here:
https://launchpad.net/~c.falco/+arc...-0ubuntu1~ppa1~oracular1_BUILDING.txt.gz

Thanks! smile


Master of Sarcastic Wit
Linux User #182984
Joined: Mar 2008
Posts: 161
Senior Member
Senior Member
Joined: Mar 2008
Posts: 161
Originally Posted by belegdol
You might need to reduce the debug level to -g1.
I'll check this out, but I'm afraid it's already to the lowest possible.

Thanks! smile


Master of Sarcastic Wit
Linux User #182984
Joined: Feb 2004
Posts: 2,626
Likes: 332
Very Senior Member
Very Senior Member
Joined: Feb 2004
Posts: 2,626
Likes: 332
And this is a great example of why we can’t endorse these pre-packaged versions of MAME…

You’re getting a lot of suboptimal options from your build system there:
  • -g it’s likely MAME with full symbols will result in something so big it causes issues (like the linking problem you’re seeing now) – you can only enable full symbols when building small subsets
  • -O2 MAME benefits from -O3 – you’re leaving performance on the table
  • -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer causing stack thrashing in hot leaf functions hurts performance substantially
  • -D_FORTIFY_SOURCE=3 I’m not going to go into reasons, yet again, but we don’t recommend this

Joined: Mar 2004
Posts: 702
Likes: 2
Senior Member
Senior Member
Joined: Mar 2004
Posts: 702
Likes: 2
For Fedora, I had to use -g1 instead of -g for several years now, even on x86_64. I am quite surprised this has not been a problem until now.

Joined: Mar 2008
Posts: 161
Senior Member
Senior Member
Joined: Mar 2008
Posts: 161
Originally Posted by belegdol
For Fedora, I had to use -g1 instead of -g for several years now, even on x86_64. I am quite surprised this has not been a problem until now.
It's actually set to -g0, which should stand for no debug symbols at all, the first -g options is overridden later. smile


Master of Sarcastic Wit
Linux User #182984
Joined: Mar 2008
Posts: 161
Senior Member
Senior Member
Joined: Mar 2008
Posts: 161
Originally Posted by Vas Crabb
  • -g it’s likely MAME with full symbols will result in something so big it causes issues (like the linking problem you’re seeing now) – you can only enable full symbols when building small subsets
  • -O2 MAME benefits from -O3 – you’re leaving performance on the table
Both options are already in place, -g is overridden by -g0 and -O2 by -O3 later in the command line.

Originally Posted by Vas Crabb
  • -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer causing stack thrashing in hot leaf functions hurts performance substantially
  • -D_FORTIFY_SOURCE=3 I’m not going to go into reasons, yet again, but we don’t recommend this
I've tried to override these using the same trick (i.e. appending the desired values), unfortunately with no luck.
I can't find specific infos in the gcc documentation however, so the precedence in case of multiple values may also simply be different from option to option.

I'll try to investigate more ASAP, unfortunately I'm in a hurry now. frown


Master of Sarcastic Wit
Linux User #182984
Joined: Mar 2008
Posts: 161
Senior Member
Senior Member
Joined: Mar 2008
Posts: 161
I've put every suggested option on (hopefully disabling FORTIFY_SOURCE as well), anyway I only solved the issue by linking with gold instead of ld.

Thanks for your help, any further advice? smile


Master of Sarcastic Wit
Linux User #182984

Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
0 members (), 161 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,356
Posts122,431
Members5,082
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Powered by UBB.threads™ PHP Forum Software 8.0.0