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

fix LDFLAGS for darwin to avoid go1.9.4 error #64

Merged
merged 1 commit into from
Feb 8, 2018

Conversation

dmitris
Copy link
Contributor

@dmitris dmitris commented Feb 8, 2018

PR fixes #63 for Darwin
@miekg

@miekg
Copy link
Owner

miekg commented Feb 8, 2018

Can you update all Unixes?

@dmitris
Copy link
Contributor Author

dmitris commented Feb 8, 2018

I suggest to start with merging this as is, for the sake of the Darwin, and then figure out what to do for Unix (not sure about Windows).

@justincormack
Copy link
Contributor

Ah, was just about to open a PR for the same thing!

@miekg
Copy link
Owner

miekg commented Feb 8, 2018

diff --git a/pkcs11.go b/pkcs11.go
index 7abc9a1..b6fdef3 100644
--- a/pkcs11.go
+++ b/pkcs11.go
@@ -13,7 +13,7 @@ package pkcs11
 /*
 #cgo windows CFLAGS: -DREPACK_STRUCTURES
 #cgo windows LDFLAGS: -Wl,--no-as-needed -lltdl
-#cgo linux LDFLAGS: -Wl,--no-as-needed -lltdl -ldl
+#cgo linux LDFLAGS: -lltdl -ldl
 #cgo darwin CFLAGS: -I/usr/local/share/libtool
 #cgo darwin LDFLAGS: -lltdl -L/usr/local/lib/
 #cgo openbsd CFLAGS: -I/usr/local/include/

makes it compile on my Linux debian box.

@justincormack
Copy link
Contributor

Linux and Windows need fixes too, I can do a PR for those.

@miekg miekg merged commit 46a553c into miekg:master Feb 8, 2018
@miekg
Copy link
Owner

miekg commented Feb 8, 2018

please do @justincormack

@ruiadrmartins
Copy link

Just to add, it also happens on go 1.8.7 on Linux at least

@andlabs
Copy link

andlabs commented Feb 8, 2018

I'd personally wait to see if the Go team whitelists -Wl,-no-as-needed.

@dmitris dmitris deleted the fix-ldflags branch February 8, 2018 12:20
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 this pull request may close these issues.

invalid LDFLAGS break build with go1.9.4 / go1.10rc2
5 participants