From d475f82c6236540c8e64bd17f65e8b2b48c53563 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Dec 2022 15:15:25 -0400 Subject: [PATCH] Added libgcc_s.so.1 to the linux standalone build so pthread_cancel will work In Makefile, listed additional deps of Build/Standalone. Without that, it does not get updated for the change to Utility/LinuxMkLibs.hs when compiling incrementally. Sponsored-by: Dartmouth College's DANDI project --- CHANGELOG | 2 ++ Makefile | 2 +- Utility/LinuxMkLibs.hs | 10 +++++--- ..._needs_more_depends_-_libgcc-s1__63__.mdwn | 2 ++ ..._93f4c8f86c58da7988bf1550867f8945._comment | 23 +++++++++++++++++++ 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__/comment_1_93f4c8f86c58da7988bf1550867f8945._comment diff --git a/CHANGELOG b/CHANGELOG index 2cf7b63c02..bf51bf831f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,8 @@ git-annex (10.20221213) UNRELEASED; urgency=medium This is slightly faster and clearer than --include=* or --exclude=* * Speed up git-annex upgrade (from v5) and init in a repository that has submodules. + * Added libgcc_s.so.1 to the linux standalone build so pthread_cancel + will work. -- Joey Hess Mon, 12 Dec 2022 13:04:54 -0400 diff --git a/Makefile b/Makefile index 73dffe3847..437afb7ee2 100644 --- a/Makefile +++ b/Makefile @@ -146,7 +146,7 @@ clean: Build/InstallDesktopFile: Build/InstallDesktopFile.hs $(GHC) --make $@ -Wall -fno-warn-tabs -Build/Standalone: Build/Standalone.hs tmp/configure-stamp +Build/Standalone: Build/Standalone.hs Build/LinuxMkLibs.hs Utility/LinuxMkLibs.hs tmp/configure-stamp $(GHC) --make $@ -Wall -fno-warn-tabs Build/BuildVersion: Build/BuildVersion.hs $(GHC) --make $@ -Wall -fno-warn-tabs diff --git a/Utility/LinuxMkLibs.hs b/Utility/LinuxMkLibs.hs index 796bdae6e2..ac8c62cdbb 100644 --- a/Utility/LinuxMkLibs.hs +++ b/Utility/LinuxMkLibs.hs @@ -64,12 +64,16 @@ parseLdd = mapMaybe (getlib . dropWhile isSpace) . lines where getlib l = headMaybe . words =<< lastMaybe (split " => " l) -{- Get all glibc libs. +{- Get all glibc libs, and also libgcc_s - - XXX Debian specific. -} glibcLibs :: IO [FilePath] -glibcLibs = lines <$> readProcess "sh" - ["-c", "dpkg -L libc6:$(dpkg --print-architecture) | egrep '\\.so' | grep -v /gconv/ | grep -v ld.so.conf | grep -v sotruss-lib"] +glibcLibs = do + ls <- lines <$> readProcess "sh" + ["-c", "dpkg -L libc6:$(dpkg --print-architecture) | egrep '\\.so' | grep -v /gconv/ | grep -v ld.so.conf | grep -v sotruss-lib"] + ls2 <- lines <$> readProcess "sh" + ["-c", "dpkg -L libgcc-s1:$(dpkg --print-architecture) | egrep '\\.so'"] + return (ls++ls2) {- Get gblibc's gconv libs, which are handled specially.. -} gconvLibs :: IO [FilePath] diff --git a/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__.mdwn b/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__.mdwn index 6edda72e7c..b3863dd72b 100644 --- a/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__.mdwn +++ b/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__.mdwn @@ -68,3 +68,5 @@ Any ideas Joey? [[!meta author=yoh]] [[!tag projects/dandi]] + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__/comment_1_93f4c8f86c58da7988bf1550867f8945._comment b/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__/comment_1_93f4c8f86c58da7988bf1550867f8945._comment new file mode 100644 index 0000000000..3b49b31ae1 --- /dev/null +++ b/doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__/comment_1_93f4c8f86c58da7988bf1550867f8945._comment @@ -0,0 +1,23 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2022-12-22T18:38:32Z" + content=""" +I'm a bit surprised git-annex is using `pthread_cancel`, since `strings` +does not show it contains that symbol. Perhaps one of the other pthread +symbols it uses ends up calling that. + +It does seem though from the message that it's git-annex and not a program +it runs that is core dumping on this. Also I checked, and the rclone you +installed is a statically linked binary so I would not expect it to use +`libgcc_s.so`. And And git-annex-remote-rclone is a bash script, and bash +doesn't use pthreads. + +(I do think that, in general, using the git-annex standalone tarball and +then trying to run additional programs besides git-annex inside it is not +going to always work well. Standalone interposes its own versions of libraries, +which may not work with the other programs. There is already a todo about that, +[[todo/restore_original_environment_when_running_external_special_remotes_from_standalone_git-annex__63__]].) + +I've added `libgcc_s.so.1` to the standalone build. +"""]]