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

go1.9.0: glibc issue with 'dlopen' in statically linked applications. #457

Closed
mjtrangoni opened this issue Aug 25, 2017 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@mjtrangoni
Copy link
Contributor

Hi,

I am using this library, and tried compiling my code with the new released,

go version go1.9 linux/amd64

My OS is CentOS 7.3,

Linux sargas 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

and I am having this issue when static compiling.

/tmp/go-link-211633467/000001.o: In function `unixDlOpen':
[...]/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c:35900: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-211633467/000000.o: In function `_cgo_b0c710f30cfd_C2func_getaddrinfo':
/tmp/go-build/net/_obj/cgo-gcc-prolog:46: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open':
(.text+0x6823): warning: the use of `mktemp' is dangerous, better use `mkstemp'

With go.1.8.3 it compiles statically without any problem, and with go1.9.0 with the glibc shared too. Any idea on how this could be fixed?

@gjrtimmer
Copy link
Collaborator

@mjtrangoni Is this still an active problem or did you fix it ? Can you try Go 1.10.x

@mjtrangoni
Copy link
Contributor Author

@gjrtimmer one warning is still there, see,

[...]/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c:37945: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-220495420/000015.o: In function `_cgo_f7895c2c5a3a_C2func_getaddrinfo':
/tmp/go-build/cgo-gcc-prolog:46: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
$ go version
go version go1.10.3 linux/amd64
$ uname -a
Linux hostname 3.10.0-862.2.3.el7.x86_64 #1 SMP Wed May 9 18:05:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ grep -A3 -B1 go-sqlite3  Gopkg.lock 
[[projects]]
  name = "github.com/mattn/go-sqlite3"
  packages = ["."]
  revision = "d31a44a0bd3b04338b506515c1cab0fe0e6e73bf"
  version = "v1.8.0"

@gjrtimmer gjrtimmer self-assigned this Jun 12, 2018
@gjrtimmer gjrtimmer added this to the 1.9.0 milestone Jun 12, 2018
@gjrtimmer
Copy link
Collaborator

@mjtrangoni After some research I think you have to live with it.

See golang issue: golang/go#21421
See Comment: golang/go#21421 (comment)

Summary:
Earlier versions of the golang compiler where auto-hiding the warning.

Unfortunately we cannot help you with this, seems to be golang compiler related.

I really hope this information helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants