BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
660 stars 87 forks source link

Compile issues after 223a709a4f205809f0410708f8a4c19458db56ec commit #1220

Closed dhwz closed 9 months ago

dhwz commented 9 months ago

Hello midwan,

after the commit 223a709a4f205809f0410708f8a4c19458db56ec I can't build amiberry anymore, maybe you have an idea whats wrong: Seems there is some issue finding the libguisan? Some issue in the Makefile?

-- Check for working CXX compiler: /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ - broken
CMake Error at /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/share/cmake-3.27/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/amiberry-223a709a4f205809f0410708f8a4c19458db56ec/external/mt32emu/build/CMakeFiles/CMakeScratch/TryCompile-RM2G4P'

    Run Build Command(s): /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/cmake -E env VERBOSE=1 /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/gmake -f Makefile cmTC_74707/fast
    gmake[1]: Entering directory '/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/amiberry-223a709a4f205809f0410708f8a4c19458db56ec/external/mt32emu/build/CMakeFiles/CMakeScratch/TryCompile-RM2G4P'
    /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/gmake  -f CMakeFiles/cmTC_74707.dir/build.make CMakeFiles/cmTC_74707.dir/build
    gmake[2]: Entering directory '/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/amiberry-223a709a4f205809f0410708f8a4c19458db56ec/external/mt32emu/build/CMakeFiles/CMakeScratch/TryCompile-RM2G4P'
    Building CXX object CMakeFiles/cmTC_74707.dir/testCXXCompiler.cxx.o
    /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++   -pipe -Wno-shift-overflow -Wno-narrowing  -std=gnu++17  -o CMakeFiles/cmTC_74707.dir/testCXXCompiler.cxx.o -c /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/amiberry-223a709a4f205809f0410708f8a4c19458db56ec/external/mt32emu/build/CMakeFiles/CMakeScratch/TryCompile-RM2G4P/testCXXCompiler.cxx
    Linking CXX executable cmTC_74707
    /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/cmake -E cmake_link_script CMakeFiles/cmTC_74707.dir/link.txt --verbose=1
    /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -pipe -Wno-shift-overflow -Wno-narrowing  -std=gnu++17  -L/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/aarch64-libreelec-linux-gnueabi/sysroot/usr/lib -lSDL2 -lSDL2_image -lSDL2_ttf -lserialport -lportmidi -lguisan -Lexternal/libguisan/lib -lmt32emu -Lexternal/mt32emu -fuse-ld=gold -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lpthread -lz -lpng -lrt -lFLAC -lmpg123 -ldl -lmpeg2convert -lmpeg2 -lstdc++fs  CMakeFiles/cmTC_74707.dir/testCXXCompiler.cxx.o -o cmTC_74707
    /home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/toolchain/lib/gcc/aarch64-libreelec-linux-gnueabi/13.2.0/../../../../aarch64-libreelec-linux-gnueabi/bin/ld.gold: error: cannot find -lguisan
    collect2: error: ld returned 1 exit status
    gmake[2]: *** [CMakeFiles/cmTC_74707.dir/build.make:99: cmTC_74707] Error 1
    gmake[2]: Leaving directory '/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/amiberry-223a709a4f205809f0410708f8a4c19458db56ec/external/mt32emu/build/CMakeFiles/CMakeScratch/TryCompile-RM2G4P'
    gmake[1]: *** [Makefile:127: cmTC_74707/fast] Error 2
    gmake[1]: Leaving directory '/home/dragon/351ELEC/build.AmberELEC-RG552.aarch64/amiberry-223a709a4f205809f0410708f8a4c19458db56ec/external/mt32emu/build/CMakeFiles/CMakeScratch/TryCompile-RM2G4P'

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (project)

-- Configuring incomplete, errors occurred!
make: *** [Makefile:738: mt32emu] Error 1
dhwz commented 9 months ago

Edit: Note seems it's only an issue when building via make, cmake-make does work, so for me it's ok but maybe you still want to fix it (make did work before).

solskogen commented 9 months ago

How do you compile? I suspect that libguisan didn't build. If you use -j remove it and try again

dhwz commented 9 months ago

Packages for our OS are build with parallel (which enforces the use of -j), but I also already tried unsetting the use of parallel, again with the same issue.

midwan commented 9 months ago

mt32emu requires CMake to build, so the requirements are updated accordingly since that commit. The automated builds in the agents I use run make (and they don't fail), so I don't think it's a generic issue?

dhwz commented 9 months ago

Agreed, maybe it's only happening in special cases like with our make toolchain. As said for me it's solved as it works with cmake-make toolchain.

solskogen commented 9 months ago

It's very strange that it doesn't build libguisan. Something else is wrong with your toolchain.

dhwz commented 9 months ago

Idk never had that issue before. It's the toolchain also used by CoreELEC.

solskogen commented 9 months ago

Give us the full log please, and all of the commands you run (with flags)

dhwz commented 9 months ago

Ok I've solved it now also for make, seems the root cause was LDFLAGS, which somehow injected -lguisan to the linker for cmake of mt32emu. After unsetting LDFLAGS in our package for amiberry it's now working again as expected.

https://github.com/AmberELEC/AmberELEC/commit/261f8e12bc1acb3a0bc896765b7a7417d26cb63c#diff-08f4eef81fb54d20229022e1a6a184e2ac07a1c9a1f943164602acf2cc0d6227R27