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

Fishshell: Fix DSM7 build #4494

Merged
merged 8 commits into from
Apr 14, 2021
Merged

Conversation

publicarray
Copy link
Member

@publicarray publicarray commented Mar 14, 2021

Motivation: Start support for DSM7. On armv7/aarch64 cmake can't find pthreads.h
Linked issues: #4463 (comment)

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

@publicarray
Copy link
Member Author

publicarray commented Mar 22, 2021

CMakeError.log
Performing C++ SOURCE FILE Test HAS_NO_REDUNDANT_MOVE failed with the following output:
Change Dir: /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_6dc9a/fast"
make[3]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_6dc9a.dir/build.make CMakeFiles/cmTC_6dc9a.dir/build
make[4]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_6dc9a.dir/src.cxx.o
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++    -std=c++11 -D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH -Wall -Wextra -Wno-comment -Wno-address  -DHAS_NO_REDUNDANT_MOVE   -Werror=no-redundant-move -std=gnu++11 -o CMakeFiles/cmTC_6dc9a.dir/src.cxx.o -c /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: error: -Werror=no-redundant-move: no option -Wno-redundant-move
make[4]: *** [CMakeFiles/cmTC_6dc9a.dir/build.make:66: CMakeFiles/cmTC_6dc9a.dir/src.cxx.o] Error 1
make[4]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
make[3]: *** [Makefile:121: cmTC_6dc9a/fast] Error 2
make[3]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test HAS_REDUNDANT_MOVE failed with the following output:
Change Dir: /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_3471f/fast"
make[3]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_3471f.dir/build.make CMakeFiles/cmTC_3471f.dir/build
make[4]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_3471f.dir/src.cxx.o
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++    -std=c++11 -D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH -Wall -Wextra -Wno-comment -Wno-address  -DHAS_REDUNDANT_MOVE   -Werror=redundant-move -std=gnu++11 -o CMakeFiles/cmTC_3471f.dir/src.cxx.o -c /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: error: -Werror=redundant-move: no option -Wredundant-move
make[4]: *** [CMakeFiles/cmTC_3471f.dir/build.make:66: CMakeFiles/cmTC_3471f.dir/src.cxx.o] Error 1
make[4]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
make[3]: *** [Makefile:121: cmTC_3471f/fast] Error 2
make[3]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'

Source file was:
int main() { return 0; }
Determining if the function cbreak exists in the /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so failed with the following output:
Change Dir: /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_2196f/fast"
make[3]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_2196f.dir/build.make CMakeFiles/cmTC_2196f.dir/build
make[4]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2196f.dir/CheckFunctionExists.c.o
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -D_GNU_SOURCE=1  -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -I/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/include -DCHECK_FUNCTION_EXISTS=cbreak   -o CMakeFiles/cmTC_2196f.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.13/Modules/CheckFunctionExists.c
Linking C executable cmTC_2196f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2196f.dir/link.txt --verbose=1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -I/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/include -DCHECK_FUNCTION_EXISTS=cbreak  -L/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib -L/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/lib -Wl,--rpath-link,/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/lib -Wl,--rpath,/var/packages/fish/target/lib -fuse-ld=gold  -rdynamic CMakeFiles/cmTC_2196f.dir/CheckFunctionExists.c.o  -o cmTC_2196f /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so 
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crt1.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crti.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/crtbegin.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: CMakeFiles/cmTC_2196f.dir/CheckFunctionExists.c.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/crtend.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crtn.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/7.3.0/lto-wrapper
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-fresolution=/tmp/cczeIyJM.res
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/libc.so while searching for c
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/libc.so while searching for c
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find libgcc_s.so.1
collect2: error: ld returned 1 exit status
make[4]: *** [CMakeFiles/cmTC_2196f.dir/build.make:88: cmTC_2196f] Error 1
make[4]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
make[3]: *** [Makefile:121: cmTC_2196f/fast] Error 2
make[3]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'


Determining if the include file pthread.h exists failed with the following output:
Change Dir: /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_a6333/fast"
make[3]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_a6333.dir/build.make CMakeFiles/cmTC_a6333.dir/build
make[4]: Entering directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a6333.dir/CheckIncludeFile.c.o
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -D_GNU_SOURCE=1 -I/spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/include  -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -I/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/include    -o CMakeFiles/cmTC_a6333.dir/CheckIncludeFile.c.o   -c /spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
Linking C executable cmTC_a6333
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a6333.dir/link.txt --verbose=1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -I/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/include   -L/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib -L/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/lib -Wl,--rpath-link,/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/lib -Wl,--rpath,/var/packages/fish/target/lib -fuse-ld=gold  -rdynamic CMakeFiles/cmTC_a6333.dir/CheckIncludeFile.c.o  -o cmTC_a6333 
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crt1.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crti.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/crtbegin.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: CMakeFiles/cmTC_a6333.dir/CheckIncludeFile.c.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/crtend.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crtn.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/7.3.0/lto-wrapper
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-fresolution=/tmp/ccub3lvR.res
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/libc.so while searching for c
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/libc.so while searching for c
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find libgcc_s.so.1
collect2: error: ld returned 1 exit status
make[4]: *** [CMakeFiles/cmTC_a6333.dir/build.make:87: cmTC_a6333] Error 1
make[4]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
make[3]: *** [Makefile:121: cmTC_a6333/fast] Error 2
make[3]: Leaving directory '/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build/CMakeFiles/CMakeTmp'
$ make arch-armv7-7.0
[..]
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc
-- Check for working C compiler: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
-- Check for working CXX compiler: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAS_NO_REDUNDANT_MOVE
-- Performing Test HAS_NO_REDUNDANT_MOVE - Failed
-- Performing Test HAS_REDUNDANT_MOVE
-- Performing Test HAS_REDUNDANT_MOVE - Failed
-- Looking for cbreak in /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so
-- Looking for cbreak in /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so - not found
-- Found Curses: /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so  
-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.13/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/ConfigureChecks.cmake:63 (find_package)
  CMakeLists.txt:133 (include)


-- Configuring incomplete, errors occurred!
See also "/spksrc/spk/fish/work-armv7-7.0/fish-3.2.2/build/CMakeFiles/CMakeOutput.log".
See also "/spksrc/spk/fish/work-armv7-7.0/fish-3.2.2/build/CMakeFiles/CMakeError.log".

@publicarray
Copy link
Member Author

My favourite shell is fish. I think would be nice to get it going on DSM 7, but I've never seen errors like this before

@hgy59 @th0ma7 do you guys know what these errors mean?

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 8, 2021

Is this issue generic to all armv7 cmake package builds or specific to fishshell?
I also recall another DSM7 cmake build issue with chromaprint where I could not find the root cause: #4395 (comment)

EDIT: Just a thought and may find some time to look into it, I recall creating a native/cmake PR allowing to build our own version of cmake and thus control its default version. This was needed for ninja which needed a specific cmake build but we ended-up finding another method instead to circumvent this. Perhaps changing cmake version is something worth investigating? PR #4321

@publicarray
Copy link
Member Author

Thanks @th0ma7 I'll give it a go with a different cmake version.

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 9, 2021

@publicarray I guess good news: I gave it a shot by including native/cmake to spk/fish dependencies and building for x64 worked all-right at first try.

~/publicarray/spksrc/packages$ ll
total 6033
-rw-r--r-- 1 spksrc spksrc 6184960 Apr  9 00:55 fish_x64-7.0_3.2.0-2.spk

Although for aarch64 and armv7 that did not do the trick (edit: neither with cmake v3.19.1 or v3.20.1).
I further looked into it and could not find the reason why, yet...
I may find some more time to have a second look and check if this might solve the chromaprint issue, who knows?

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 9, 2021

I dig a little more on the issue... same problem also occurs on ARMv8.
I believe fish simply doesn't understand it's being cross-compiled.
The error output is as follow:

/home/spksrc/publicarray/spksrc/toolchain/syno-aarch64-7.0/work/aarch64-unknown-linux-gnu/bin/../lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld.gold: warning: skipping incompatible /home/spksrc/publicarray/spksrc/toolchain/syno-aarch64-7.0/work/aarch64-unknown-linux-gnu/bin/../aarch64-unknown-linux-gnu/sysroot/usr/lib/libc.so while searching for c

and cross-compiling environment variable are declared as UNITIALIZED meaning unused by the build:

$ grep -e PROCESSOR -e CROSS_COMPILE_ARM CMakeCache.txt 
CMAKE_SYSTEM_PROCESSOR:UNINITIALIZED=aarch64
CROSS_COMPILE_ARM:UNINITIALIZED=ON

Elsewhere I've found this fish-shell/fish-shell#5848 which relates to using CMAKE_FIND_ROOT_PATH variable that might help. Perhaps something worth looking into.

@publicarray
Copy link
Member Author

publicarray commented Apr 9, 2021

Thanks for looking deeper much appreciated. But I do have to disappoint you and say that on this branch x64 worked before updating cmake... (at least on my machine ™️ ). When you updated cmake did you pull the change from here? Or did updating cmake add additional compiler flags?

Hm, I've tried messing with CMAKE_FIND_ROOT_PATH and CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH before with no success (maybe I just can't get the right combination of variables set.).

The wired thing is that compiling for DSM6 does not have the issue and the variables are already set. Theoretically the only change here is an updated toolchain/compiler

I think It's time to ask a fish maintainer for advice. @zanchey any ideas?

PS: I'm now running DSM7 (Virtual DSM) in a virtualised dsm6 (xpenology) using libvirt/qemu and virtual machine manager (redhat). 😅

@publicarray
Copy link
Member Author

publicarray commented Apr 9, 2021

CMAKE_SYSTEM_PROCESSOR:UNINITIALIZED=aarch64

Isn't it uninitialised as a value or datatype by default, and it now set to aarch64?

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 9, 2021

Thanks for looking deeper much appreciated. But I do have to disappoint you and say that on this branch x64 worked before updating cmake... (at least on my machine tm ). When you updated cmake did you pull the change from here? Or did updating cmake add additional compiler flags?

The comment this PR refers to (#4463 (comment)) also mention a x64 build failure at 20% (along with the armv7 / aarch64). So I took that as a starting point and did not even bother tried compiling as-is.

The wired thing is that compiling for DSM6 does not have the issue and the variables are already set. Theoretically the only change here is an updated toolchain/compiler

Then there must be checks somewhere that differs. Comparing the logs line by line between dsm6 vs dsm7 may help but that's a hell of a task.

PS: I'm now running DSM7 (Virtual DSM) in a virtualised dsm6 (xpenology) using libvirt/qemu and virtual machine manager (redhat). sweat_smile

This is sweet indeed. Would you mind documenting how you achieved that (or point me to existing doc)? because that would allow me to test-bed (and fix) packages prior to updating my NAS and breaking up everything.

@publicarray
Copy link
Member Author

publicarray commented Apr 9, 2021

The comment this PR refers to (#4463 (comment)) also mention a x64 build failure at 20% (along with the armv7 / aarch64). So I took that as a starting point and did not even bother tried compiling as-is.

Sorry if I wasted your time on that one.

This is sweet indeed. Would you mind documenting how you achieved that (or point me to existing doc)? because that would allow me to test-bed (and fix) packages prior to updating my NAS and breaking up everything.

Sure I've tried documenting my steps on Manjaro. What OS are you running on?:

virt-dsm-emoji.pdf (the PDF table of contents is missing on this one) - virt-dsm-toc.pdf (the symbols are missing on this one)

Sorry about the PDF and lousy formatting. I can't attach md files on GitHub directly. I'm not sure if we should add it to the wiki I'm worried that this is not officially sanctioned by Synology (specifically xpenology might violate some T&C, but I have no clue)

Edit: The required packages to install might be incomplete
Added a gist

@zanchey
Copy link

zanchey commented Apr 10, 2021

I think It's time to ask a fish maintainer for advice. @zanchey any ideas?

Hi, I've not heard of most of the platform stuff you're talking about here but it doesn't look like the toolchain is working correctly. ld.gold: error: CMakeFiles/cmTC_a6333.dir/CheckIncludeFile.c.o: incompatible target does not look good.

I suggest trying this in a new directory, saved as CMakeLists.txt, then run with cmake .:

cmake_minimum_required(VERSION 3.2)
    
set(CMAKE_CXX_STANDARD 11)                                                                          

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")                                                          
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE=1)                                             

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

If that doesn't work, you could try by removing the line that uses gold, or the line that adds GNU_SOURCE, or both.

@publicarray
Copy link
Member Author

publicarray commented Apr 11, 2021

Thanks @zanchey, After some more trial and error I'm also convinced something is very wrong with the environment. .o: incompatible target

@th0ma7 in the cmake-env I don't see anything obvious. Synology might have changed something in their toolchains that impacts cmake (other C/C++ programs seem fine e.g zsh compiles fine).

$ echo 'int main() { return 0; }' > /spksrc/main.c

$ /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -D_GNU_SOURCE=1  -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -I/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/include -DCHECK_FUNCTION_EXISTS=cbreak   -o /spksrc/main.c.o   -c /spksrc/main.c

$ /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -I/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/include -DCHECK_FUNCTION_EXISTS=cbreak  -L/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib -L/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/lib -Wl,--rpath-link,/spksrc/spk/fish/work-armv7-7.0/install//var/packages/fish/target/lib -Wl,--rpath,/var/packages/fish/target/lib -fuse-ld=gold  -rdynamic /spksrc/main.c.o  -o main /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so

/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crt1.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crti.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/crtbegin.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/main.c.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/crtend.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crtn.o: incompatible target
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/7.3.0/lto-wrapper
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-fresolution=/tmp/ccWyGi3U.res
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/libc.so while searching for c
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/libc.so while searching for c
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find -lc
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: warning: skipping incompatible /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/lib/libgcc_s.so.1 while searching for libgcc_s.so.1
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld.gold: error: cannot find libgcc_s.so.1
collect2: error: ld returned 1 exit status


$ file /spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so.6.1
/spksrc/spk/fish/work-armv7-7.0/install/var/packages/fish/target/lib/libncursesw.so.6.1: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, with debug_info, not stripped

$ file /spksrc/main.c.o
/spksrc/main.c.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped

$ file /spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crt1.o
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi/sysroot/usr/lib/crt1.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), for GNU/Linux 3.2.0, with debug_info, not stripped

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 11, 2021

I have found two hints that makes me think that the updated binutils part of the toolchain requires new options for ARM:

  1. Using prior binutils version in the toolchain completely solves the issue:
syno-aarch64-7.0$ mv work/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/bin work/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/bin.old
syno-aarch64-7.0$ ln -s ~/publicarray/spksrc/toolchain/syno-aarch64-6.2.3/work/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/bin work/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/bin
  1. Using CMAKE_ARGS += -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON get is passed the pthread.h successfully but fails later on.
...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
...
[ 19%] Building CXX object CMakeFiles/fishlib.dir/src/ast.cpp.o
In file included from /home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/src/common.h:22:0,
                 from /home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/src/global_safety.h:10,
                 from /home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/src/flog.h:13,
                 from /home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/src/ast.h:10,
                 from /home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/src/ast.cpp:3:
/home/spksrc/publicarray/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include/dirent.h:224:12: error: expected ‘)’ before ‘*’ token
 extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
            ^
make[5]: *** [CMakeFiles/fishlib.dir/build.make:66: CMakeFiles/fishlib.dir/src/ast.cpp.o] Error 1
make[5]: Leaving directory '/home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build'
make[4]: *** [CMakeFiles/Makefile2:958: CMakeFiles/fishlib.dir/all] Error 2
make[4]: Leaving directory '/home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build'
make[3]: *** [Makefile:130: all] Error 2
make[3]: Leaving directory '/home/spksrc/publicarray/spksrc/spk/fish/work-armv7-7.0/fish-3.2.0/build'
make[2]: *** [../../mk/spksrc.cross-cmake.mk:48: cmake_compile_target] Error 2
make[2]: Leaving directory '/home/spksrc/publicarray/spksrc/cross/fish'
make[1]: *** [../../mk/spksrc.depend.mk:51: depend_target] Error 2
make[1]: Leaving directory '/home/spksrc/publicarray/spksrc/spk/fish'
make: [../../mk/spksrc.spk.mk:468: arch-armv7-7.0] Error 2 (ignored)

EDIT: I just noticed that you where able to make it pass through the CMAKE pre-build stage using your new options. As such disregard item no. 2 as it does not apply.

@publicarray
Copy link
Member Author

Thanks everybody for your help. @th0ma7 how can I apply the patch only to the toolchains that need it?

Copy link
Contributor

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an extremely awesome finding! Good work!

@publicarray
Copy link
Member Author

publicarray commented Apr 11, 2021

Thanks, I got there by playing with a sample program cmake generates (I don't even know the difference between the linkers):

echo 'int main() { return 0; }' > /spksrc/main.c

# cmake compile command 
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -D_GNU_SOURCE=1  -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include  -DCHECK_FUNCTION_EXISTS=cbreak   -o /spksrc/main.c.o   -c /spksrc/main.c

# broken cmake linking command
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -DCHECK_FUNCTION_EXISTS=cbreak -L/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib -Wl, -fuse-ld=gold  -rdynamic /spksrc/main.c.o  -o main

# eventually working command (see the error message in an earlier comment)
/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -I/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include -DCHECK_FUNCTION_EXISTS=cbreak -L/spksrc/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/lib -rdynamic /spksrc/main.c.o  -o main

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 11, 2021

Thanks everybody for your help. @th0ma7 how can I apply the patch only to the toolchains that need it?

I'm guessing you mean ensuring such patch get applied only on arch that do require it?
If that's the case then I invite you to have a look at the spksrc.patch.mk with the following:

# find patches into the following directory order:
#    patches/*.patch
#    patches/kernel-$(subst +,,$(TC_KERNEL))/*.patch   ## Discard any ending +
#    patches/DSM-$(TCVERSION)/*.patch
#    patches/$(group)/*.patch
#    patches/$(group)-$(TCVERSION)/*.patch
#    patches/$(arch)/*.patch
#    patches/$(arch)-$(TCVERSION)/*.patch

I tested it and you have two options, and builds successfully under DSM-6 as well with the patch applied which is great:

  1. move the patch under patches/armv7 and a second copy under patches/armv8
  2. adapt the spksrc.patch.mk to add arm group on top of the other ones. This allow using a single copy of the patch under patches/arm. Although I wonder if this could not add side-effects and try to double apply patches if other armvX are also existing?

Adapted code snippet for spksrc.patch.mk:

# supported groups: arm, armv5, armv7, armv7l, armv8, ppc, i686, x64
ifeq ($(strip $(PATCHES)),)
PATCHES = $(foreach group,ARM_ARCHS ARMv5_ARCHS ARMv7_ARCHS ARMv7L_ARCHS ARMv8_ARCHS PPC_ARCHS i686_ARCHS x64_ARCHS, \

To alleviate the duplicate patch applying I believe we would need to define a uniq function and parse PATCHES under uniq. Actually this could be quite useful and allow adding all general groups... EDIT: Or simply use sort... ?

@hgy59
Copy link
Contributor

hgy59 commented Apr 11, 2021

as #4539 is now on the master branch, you have to remove >> ${INST_LOG} in service-setup.sh for service_save/restore to work.

@publicarray
Copy link
Member Author

Thanks @th0ma7, I went with option 1 for now. It's only 2 files but maybe in a new PR it can be improved.

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 13, 2021

@publicarray if #4553 gets in you could then rebase your work against it to use a unique patch instead of needing a duplicate.

@publicarray
Copy link
Member Author

publicarray commented Apr 14, 2021

Ideally this will be fixed before the DSM7 release. Ping @SynologyOpenSource (probably an unmonitored account)

@publicarray
Copy link
Member Author

publicarray commented Apr 14, 2021

@th0ma7 Is it good to merge?

@publicarray publicarray changed the title Fishshell: Fix DSM7 x64 build Fishshell: Fix DSM7 build Apr 14, 2021
Copy link
Contributor

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@publicarray publicarray merged commit a6cb455 into SynoCommunity:master Apr 14, 2021
@publicarray publicarray deleted the Fishshell-dsm7 branch April 14, 2021 10:54
@publicarray publicarray added status/published Published and activated (may take up to 48h until visible in DSM package manager) and removed status/needs-review labels Apr 14, 2021
@publicarray publicarray mentioned this pull request Aug 28, 2021
3 tasks
brice-fromentin pushed a commit to brice-fromentin/spksrc-dotnet-9 that referenced this pull request Nov 27, 2024
* Fishshell: Fix x64 build

* made cmake happy but not much else

* Fish: don't use the gold linker, it's broken in the DSM7 toolchain

* cleanup

* fish: Apply patch only for armv7-7.0 and aarch64-7.0

* fish: remove $INST_LOG

* Fish: use single patch file

* Fish: Update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dsm 7 status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants