-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
CMakeError.log
|
Is this issue generic to all armv7 cmake package builds or specific to EDIT: Just a thought and may find some time to look into it, I recall creating a |
Thanks @th0ma7 I'll give it a go with a different cmake version. |
@publicarray I guess good news: I gave it a shot by including
Although for |
I dig a little more on the issue... same problem also occurs on
and cross-compiling environment variable are declared as
Elsewhere I've found this fish-shell/fish-shell#5848 which relates to using |
Thanks for looking deeper much appreciated. But I do have to disappoint you and say that on this branch Hm, I've tried messing with 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). 😅 |
Isn't it uninitialised as a value or datatype by default, and it now set to |
The comment this PR refers to (#4463 (comment)) also mention a
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.
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. |
Sorry if I wasted your time on that one.
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 Edit: The required packages to install might be incomplete |
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. I suggest trying this in a new directory, saved as 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 |
Thanks @zanchey, After some more trial and error I'm also convinced something is very wrong with the environment. @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 $ 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 |
I have found two hints that makes me think that the updated
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. |
Thanks everybody for your help. @th0ma7 how can I apply the patch only to the toolchains that need it? |
There was a problem hiding this 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!
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 |
I'm guessing you mean ensuring such patch get applied only on arch that do require it?
I tested it and you have two options, and builds successfully under DSM-6 as well with the patch applied which is great:
Adapted code snippet for
To alleviate the duplicate patch applying I believe we would need to define a |
as #4539 is now on the master branch, you have to remove |
787fc01
to
4f5e3d7
Compare
Thanks @th0ma7, I went with option 1 for now. It's only 2 files but maybe in a new PR it can be improved. |
@publicarray if #4553 gets in you could then rebase your work against it to use a unique patch instead of needing a duplicate. |
Ideally this will be fixed before the DSM7 release. Ping @SynologyOpenSource (probably an unmonitored account) |
4f5e3d7
to
5f2d7e3
Compare
@th0ma7 Is it good to merge? |
There was a problem hiding this 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!
* 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
Motivation: Start support for DSM7. On armv7/aarch64 cmake can't find pthreads.h
Linked issues: #4463 (comment)
Checklist
all-supported
completed successfully