Good morning, Frode!
I just tried to build latest git with LTO enabled and optimizations for my native CPU (AMD Bulldozer first generation). It builds fine until the final link stage.
I configured build as:
Code:
./configure CFLAGS='-flto -march=native -mtune=native' CXXFLAGS='-flto -march=native -mtune=native' CPPFLAGS='-flto -march=native -mtune=native' LDFLAGS='-flto'
Error at end:
Code:
basty@cdgs-basty:~/src/fs-uae$ make -j16
make all-recursive
make[1]: Entering directory '/home/basty/src/fs-uae'
make[2]: Entering directory '/home/basty/src/fs-uae'
g++ -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DLUA_USE_POSIX -pthread -I/usr/include/mirclient -I/usr/include/mircookie -I/usr/include/mircore -I/usr/include/AL -I/usr/include/libdrm -I/usr/include/libpng16 -D_REENTRANT -I/usr/include/SDL2 -fno-strict-overflow -fno-strict-aliasing -Wmissing-declarations -Waddress -fvisibility=hidden -I/usr/include/mpeg2dec -flto -march=native -mtune=native -no-pie -flto -o fs-uae src/fs-uae/config.o src/fs-uae/config-accelerator.o src/fs-uae/config-common.o src/fs-uae/config-drives.o src/fs-uae/config-graphics.o src/fs-uae/config-hardware.o src/fs-uae/config-model.o src/fs-uae/config-paths.o src/fs-uae/config-sound.o src/fs-uae/input.o src/fs-uae/joystick.o src/fs-uae/keyboard.o src/fs-uae/main.o src/fs-uae/menu.o src/fs-uae/mouse.o src/fs-uae/paths.o src/fs-uae/plugins.o src/fs-uae/recording.o src/fs-uae/uae_config.o src/fs-uae/video.o src/ppc/ppcd.o src/sndboard.o src/moduleripper.o libuae.a libcpuemu.a libfsemu.a libmanymouse.a libglad.a libpcem.a libudis86.a libprowizard.a -lm -ldl -lgthread-2.0 -pthread -lglib-2.0 -lopenal -lGL -lpng16 -lz -lSDL2 -lX11 -lz -lmpeg2 -lmpeg2convert
src/sana2.cpp:172:8: warning: type 'struct asyncreq' violates the C++ One Definition Rule [-Wodr]
struct asyncreq {
^
src/uaeserial.cpp:116:8: note: a different type is defined in another translation unit
struct asyncreq {
^
src/sana2.cpp:176:19: note: the first difference of corresponding definitions is field 's2p'
struct s2packet *s2p;
^
src/uaeserial.cpp:120:6: note: a field with different name is defined in another translation unit
int ready;
^
src/scsiemul.cpp:49:8: warning: type 'struct devstruct' violates the C++ One Definition Rule [-Wodr]
struct devstruct {
^
src/uaeserial.cpp:123:8: note: a different type is defined in another translation unit
struct devstruct {
^
src/scsiemul.cpp:50:6: note: the first difference of corresponding definitions is field 'unitnum'
int unitnum, aunit;
^
src/uaeserial.cpp:124:6: note: a field with different name is defined in another translation unit
int open;
^
src/blitter.cpp:81:15: warning: type of 'cycle_line' does not match original declaration [-Wlto-type-mismatch]
extern uae_u8 cycle_line[256];
^
src/custom.cpp:277:8: note: array types have different bounds
uae_u8 cycle_line[256 + 1];
^
src/custom.cpp:277:8: note: 'cycle_line' was previously declared here
/tmp/ccqStKra.ltrans0.ltrans.o: In function `sb_get_buffer_emu8k(int*, int, void*)':
<artificial>:(.text+0x1d3c8): undefined reference to `emu8k_update(emu8k_t*)'
collect2: error: ld returned 1 exit status
Makefile:3881: recipe for target 'fs-uae' failed
make[2]: *** [fs-uae] Error 1
make[2]: Leaving directory '/home/basty/src/fs-uae'
Makefile:4504: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/basty/src/fs-uae'
Makefile:2555: recipe for target 'all' failed
make: *** [all] Error 2