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

E: shared-lib-without-dependency-information /usr/bin/xxx for GO binaries #598

Open
socketpair opened this issue Jan 11, 2021 · 11 comments
Open

Comments

@socketpair
Copy link

socketpair commented Jan 11, 2021

I use Fedora 33 and rpmlint from the distro (rpmlint-1.11-12.fc33.noarch)

Fragment of .spec file how I build my GO sources:

%build
export GOPATH=/usr/share/gocode
export GOBUILDFLAGS="%gobuildflags"
export CGO_ENABLED=0
mkdir bin
export GOBIN=$(pwd)/bin
eval "go install $GOBUILDFLAGS ./mysources/..."

Example of the binary:
bug.zip

@marxin
Copy link
Contributor

marxin commented Jan 11, 2021

Thank you for the report.

Right now we skip .gox files

# Go .go and .gox, .o and .static
if is_ocaml_native or is_lua_bytecode or fname.endswith('.o') or \
fname.endswith('.static') or fname.endswith('.gox') or \
fname.endswith('.go'):
continue

shouldn't the installed bug be named with the extension? I'm sorry, but I'm not much familiar with go extensions, but I know that we intentionally skip ELFs created with go for various reasons.

@socketpair
Copy link
Author

No! my binaries are not extensions! they are final executable files. That's why they are placed in /usr/bin

@marxin
Copy link
Contributor

marxin commented Jan 11, 2021

All right, we can filter out the checks based on:

$ readelf -n bug
...
Displaying notes found in: .note.go.buildid
  Owner                Data size 	Description
  Go                   0x00000053	Unknown note type: (0x00000004)
   description data: 32 35 37 38 74 7a 4d 61 66 2d 68 32 39 62 37 4a 36 5f 47 46 2f 43 49 39 43 36 71 64 62 70 65 5a 79 79 5a 35 6e 39 4f 36 48 2f 6a 78 7a 65 6f 30 61 50 76 6c 4f 74 51 45 4d 55 71 6b 6e 31 2f 37 64 50 39 6d 64 61 31 6d 50 41 4a 43 6e 2d 6d 49 66 35 42 

I'll work on that..

@marxin
Copy link
Contributor

marxin commented Jan 11, 2021

@socketpair May I please ask you for steps on how to create a reproducer that will be as small as possible?

@socketpair
Copy link
Author

socketpair commented Jan 11, 2021

@marxin What should I give to you ? minimized srpm ?

@marxin
Copy link
Contributor

marxin commented Jan 11, 2021

@marxin What should I give to you ? minimized srpm ?

Yes, please.

@socketpair
Copy link
Author

socketpair commented Jan 11, 2021

example.zip

srpm + generated rpms

@marxin

@marxin
Copy link
Contributor

marxin commented Aug 16, 2021

@Conan-Kudo Ok, looking again at the provided /usr/bin/example1, I see the following:

$ file ./usr/bin/example1
./usr/bin/example1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=8b6123ebd92047ed4d7edefd646d453b98332dba, stripped

So it's classified as "shared object" and it's really statically linked:

ldd ./usr/bin/example1
	statically linked

That said, the error message looks reasonable to me.

marxin added a commit to marxin/rpmlint that referenced this issue Aug 23, 2021
@marxin
Copy link
Contributor

marxin commented Jul 19, 2022

Fixed with 5e1a42a.

@marxin marxin closed this as completed Jul 19, 2022
@socketpair
Copy link
Author

@marxin no such commit in master. Please reopen.

@marxin
Copy link
Contributor

marxin commented Jul 20, 2022

Sorry, you're correct as #599 was not merged.

@marxin marxin reopened this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants