Opened 5 years ago

Closed 2 years ago

#10962 closed defect (outdated)

BACKENDS: AMIGAOS: Configuring with -flto errors out on finding a suitable compiler (AmigaOS4)

Reported by: raziel- Owned by: raziel-
Priority: normal Component: Common
Version: Keywords:
Cc: Game:

Description

AmigaOS4 - BE - PPC - SDL
gcc -v
Using built-in specs.
COLLECT_GCC=/Development/Coding/SDK/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/Development/Coding/SDK/gcc/bin/../libexec/gcc/ppc-amigaos/8.3.0/lto-wrapper
Target: ppc-amigaos
Configured with: /var/lib/jenkins/workspace/native-gcc-8/gcc/repo/configure --with-bugurl=https://github.com/sba1/adtools/issues --with-pkgversion='adtools build 8.3.0' --host=ppc-amigaos --target=ppc-amigaos --disable-nls --prefix=/gcc --with-gmp=/var/lib/jenkins/workspace/native-gcc-8/native-build/root-cross --with-mpfr=/var/lib/jenkins/workspace/native-gcc-8/native-build/root-cross --with-mpc=/var/lib/jenkins/workspace/native-gcc-8/native-build/root-cross --enable-languages=c,c++ --enable-haifa --enable-sjlj-exceptions --disable-libstdcxx-pch --disable-tls --enable-threads=amigaos --enable-lto
Thread model: amigaos
gcc version 8.3.0 (adtools build 8.3.0)

On using the above compiler version and "trying" to compile with -flto in place, unfortunately makes ./configure not find any suitable compilers at all.

The problem seems to be the in-configure check for endianess, since, if i skip that check and simply set my endian to big, it works.

See also this thread on the forums:
https://forums.scummvm.org/viewtopic.php?f=1&t=14806&p=86938&hilit=configure+flto#p86938

Could this be fixed/supported in configure, if possible, please?

Change History (12)

comment:1 by bgK, 5 years ago

Which revision of ScummVM are you using? This was supposed to be fixed by https://github.com/scummvm/scummvm/commit/3a25a3c926243c7e93857f9edcb1b84d45b8caa0 (it is for me).

comment:2 by raziel-, 5 years ago

This is with a checkout from today and from right about now (5 minutes ago)
Your linked change is also merged in (just checked configure)

comment:3 by bgK, 5 years ago

Could you please attach your config.log with LDFLAGS="-flto"?

Last edited 5 years ago by bgK (previous) (diff)

comment:4 by raziel-, 5 years ago

Sure

Configure run on Thu May 16 21:16:19 2019
Invocation command line was:
./configure --enable-static
Saved environment variables:
AR="" AS="" ASFLAGS="" CPPFLAGS="" CXX="" CXXFLAGS="-std=c++11" DWP="" LD="ld" LDFLAGS="-athread=native -Wl,-no-keep-memory -flto -L/sdk/local/newlib/lib"
PKG_CONFIG_LIBDIR="/sdk/local/newlib/lib/pkgconfig/" RANLIB="" SDL_CONFIG="" STRIP="" WINDRES="" WINDRESFLAGS=""
testing compiler: g++
failure testing compiler: g++
testing compiler: c++
failure testing compiler: c++

comment:5 by raziel-, 5 years ago

Not much to show there, sorry.

But i also have a file called tmp_cxx_compiler.cpp in place, which doesn't get deleted due to the failing configure bit.

	class Foo { int a; };
	int main(int argc, char **argv) {
		Foo *a = new Foo(); delete a; return 0;
	}

comment:6 by bgK, 5 years ago

What happens when you try compiling that file?
g++ -std=c++11 -athread=native -Wl,-no-keep-memory -flto -L/sdk/local/newlib/lib ./tmp_cxx_compiler.cpp -o ./tmp_cxx_compiler

comment:7 by raziel-, 5 years ago

g++ -std=c++11 -athread=native -Wl,-no-keep-memory -flto -L/sdk/local/newlib/lib tmp_cxx_compiler.cpp -o tmp_cxx_compiler

Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: -f may not be used without -shared

Compiling with -shared in place makes it build.
g++ -std=c++11 -athread=native -Wl,-no-keep-memory -flto -shared -L/sdk/local/newlib/lib tmp_cxx_compiler.cpp -o tmp_cxx_compiler

But i don't really understand why. I (try) to compile everything static.

Output file is 123.040 bytes, if that helps

comment:8 by raziel-, 5 years ago

I think i should work aorund that by adding -shared to my LDFLAGS?

comment:9 by raziel-, 5 years ago

Nope, adding -shared to the LDFlags doesn't help, still errors out

comment:10 by raziel-, 5 years ago

See this thread for reference: https://forums.scummvm.org/viewtopic.php?f=1&t=14806
and also this bug, which seems to be related if not a duplicate: https://bugs.scummvm.org/ticket/10695

comment:11 by sev-, 4 years ago

Summary: COMPILER: Configuring with -flto errors out on finding a suitable compiler (AmigaOS4)BACKENDS: AMIGAOS: Configuring with -flto errors out on finding a suitable compiler (AmigaOS4)

comment:12 by raziel-, 2 years ago

Owner: set to raziel-
Resolution: outdated
Status: newclosed

Fixed in the meantime by probably a new gcc package release

Note: See TracTickets for help on using tickets.