Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lto1.exe: error: two or more sections for .gnu.lto__ZTV13device_finderI19generic_slot_deviceLb0EE.173732.c2717568 #12589

Open
shoober420 opened this issue Jul 17, 2024 · 4 comments

Comments

@shoober420
Copy link

MAME version

2695a18

System information

Windows 11 64-bit / MSYS2
16GB RAM
GEFORCE 2060 RTX
555.85

INI configuration details

REGENIE = 1
# VERBOSE = 1
 NOWERROR = 1
# IGNORE_GIT = 1

# TARGET = mame
# SUBTARGET = tiny
# TOOLS = 1
# EMULATOR = 1
# TESTS = 1
# BENCHMARKS = 1
# OSD = sdl

 NO_OPENGL = 0
# USE_DISPATCH_GL = 0
 MODERN_WIN_API = 1
 USE_SDL = 1
# SDL_INI_PATH = .;$HOME/.mame/;ini;
# SDL2_MULTIAPI = 1
# NO_USE_MIDI = 1
# NO_USE_PORTAUDIO = 1
 NO_USE_PULSEAUDIO = 1
 USE_TAPTUN = 0
 USE_PCAP = 0
 USE_QTDEBUG = 0
# NO_X11 = 1
# USE_WAYLAND = 1
# NO_USE_XINPUT = 1
# NO_USE_XINPUT_WII_LIGHTGUN_HACK = 1
# FORCE_DRC_C_BACKEND = 1

 DEBUG = 0
# PROFILER = 1
# SANITIZE =

# PTR64 = 1
# BIGENDIAN = 1
# NOASM = 1

 OPTIMIZE = 3
# SYMBOLS = 1
# SYMLEVEL = 2
# MAP = 1
# PROFILE = 1
# ARCHOPTS =
# ARCHOPTS_C =
# ARCHOPTS_CXX =
# ARCHOPTS_OBJC =
# ARCHOPTS_OBJCXX =
 OPT_FLAGS = -march=native -msahf -O3 -pipe -fno-plt -fno-common -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fexcess-precision=fast -flto=auto
# LDOPTS =

# USE_SYSTEM_LIB_ASIO = 1
# USE_SYSTEM_LIB_EXPAT = 1
# USE_SYSTEM_LIB_ZLIB = 1
# USE_SYSTEM_LIB_ZSTD = 1
# USE_SYSTEM_LIB_JPEG = 1
# USE_SYSTEM_LIB_FLAC = 1
# USE_SYSTEM_LIB_LUA = 1
# USE_SYSTEM_LIB_SQLITE3 = 1
# USE_SYSTEM_LIB_PORTMIDI = 1
# USE_SYSTEM_LIB_PORTAUDIO = 1
# USE_SYSTEM_LIB_UTF8PROC = 1
# USE_SYSTEM_LIB_GLM = 1
# USE_SYSTEM_LIB_RAPIDJSON = 1
# USE_SYSTEM_LIB_PUGIXML = 1

# MESA_INSTALL_ROOT = /opt/mesa
# SDL_INSTALL_ROOT = /opt/sdl2
# SDL_FRAMEWORK_PATH = $(HOME)/Library/Frameworks
# USE_LIBSDL = 1
# CYGWIN_BUILD = 1

# BUILDDIR = build
# TARGETOS = windows
# CROSS_BUILD = 1
# TOOLCHAIN =
# OVERRIDE_CC = cc
# OVERRIDE_CXX = c++
# OVERRIDE_LD = ld
# OVERRIDE_AR = ar

# DEPRECATED = 0
 LTO = 1
 SSE2 = 1
# OPENMP = 1

# SEPARATE_BIN = 1
# PYTHON_EXECUTABLE = python3
# SHADOW_CHECK = 1
# STRIP_SYMBOLS = 0

# QT_HOME = /usr/lib64/qt48/

# SOURCES = src/mame/atari/asteroid.cpp,src/mame/cinematronics/cchasm.cpp

# SOURCEFILTER = mydrivers.flt

# FORCE_VERSION_COMPILE = 1

# MSBUILD = 1
# IGNORE_BAD_LOCALISATION = 1
# PRECOMPILE = 0

# DEBUG_DIR=c:\test\location
# DEBUG_ARGS= -window -video bgfx

Emulated system/software

No response

Incorrect behaviour

Build fail.

GNU ld (GNU Binutils) 2.42
lto-wrapper.exe: warning: using serial compilation of 128 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
lto1.exe: error: two or more sections for .gnu.lto__ZTV13device_finderI19generic_slot_deviceLb0EE.173732.c2717568
(null):0: confused by earlier errors, bailing out
lto-wrapper.exe: fatal error: C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe returned 1 exit status
compilation terminated.
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
make[2]: *** [mame.make:271: ../../../../../mame.exe] Error 1
make[1]: *** [Makefile:1132: mame] Error 2
make: *** [makefile:1127: windows_x64] Error 2

Expected behaviour

Build completion

Steps to reproduce

run make with LTO enabled

Additional details

No response

@cuavas
Copy link
Member

cuavas commented Jul 17, 2024

LTO builds are unsupported, and are not a recommended configuration. If you can show an actual bug in the source that happens to be exposed by LTO builds we can look at it, but we don’t investigate LTO build issues.

@shoober420
Copy link
Author

Is there a build flag I can force the 64bit version to only be built, and skip the 32bit version of MAME? I do have the following already added to my bashrc file.

export MINGW64=/mingw64
export MINGW32=

@cuavas
Copy link
Member

cuavas commented Jul 20, 2024

If you include PTR64=1 in your make options, only the 64-bit version is built. You need to explicitly build the 32-bit version if you want it, they aren’t both built automatically.

@shoober420
Copy link
Author

I tried to compile with PTR64=1 to see if it would get passed the error, but it still occured. Thanks for the info though, I hope one day MAME supports LTO optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants