From 1895fabfb0c7de774cffb049e063de5dce62473d Mon Sep 17 00:00:00 2001 From: EnumDev Date: Fri, 5 Dec 2025 20:16:11 +0200 Subject: [PATCH] Do not strip files that use ELF as a container format --- src/bpmlib/compilation.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bpmlib/compilation.go b/src/bpmlib/compilation.go index 6617b21..56ac892 100644 --- a/src/bpmlib/compilation.go +++ b/src/bpmlib/compilation.go @@ -261,6 +261,17 @@ func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks, k fmt.Printf("Stripped %s (%s)\n", path, mimetype) } } else if strings.HasPrefix(mimetype, "application/x-pie-executable") || strings.HasPrefix(mimetype, "application/x-sharedlib") { + cmd = exec.Command("file", "-b", path) + cmd.Stderr = os.Stderr + output, err = cmd.Output() + if err != nil { + return err + } + // Skip files that use ELF as a container format + if strings.Contains(string(output), "no machine") { + return nil + } + cmd := exec.Command("strip", "--strip-unneeded", path) cmd.Stderr = os.Stderr err = cmd.Run()