Added libgcc_s.so.1 to the linux standalone build so pthread_cancel will work
authorJoey Hess <joeyh@joeyh.name>
Thu, 22 Dec 2022 19:15:25 +0000 (15:15 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 22 Dec 2022 19:15:25 +0000 (15:15 -0400)
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
Makefile
Utility/LinuxMkLibs.hs
doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__.mdwn
doc/bugs/standalone_needs_more_depends_-_libgcc-s1__63__/comment_1_93f4c8f86c58da7988bf1550867f8945._comment [new file with mode: 0644]

index 2cf7b63c0244d6aa64881859f9856185fdc801b0..bf51bf831fb6c8f3a7d7d9336caec281e70b1605 100644 (file)
--- 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 <id@joeyh.name>  Mon, 12 Dec 2022 13:04:54 -0400
 
index 73dffe3847f1c8c6858ce13e5ab1a91d3c873bef..437afb7ee2a92849bcad6b364af5ad76977ca743 100644 (file)
--- 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
index 796bdae6e25d5d7cd4416c387e736443e282eb43..ac8c62cdbb9f05179547e8ab9c75f0cb95c12d3e 100644 (file)
@@ -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]
index 6edda72e7c43e7a70ffcdda486bae48592e4ec19..b3863dd72b697685c2378880d0d66b6954db59f7 100644 (file)
@@ -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 (file)
index 0000000..3b49b31
--- /dev/null
@@ -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.
+"""]]