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

libpam makefile assumes incorrect path for libdl on Ubuntu Natty #71

Closed
ThomasHabets opened this issue Oct 10, 2014 · 15 comments
Closed

libpam makefile assumes incorrect path for libdl on Ubuntu Natty #71

ThomasHabets opened this issue Oct 10, 2014 · 15 comments

Comments

@ThomasHabets
Copy link
Contributor

@ThomasHabets ThomasHabets commented Oct 10, 2014

Original issue 71 created by mikalstill on 2011-05-12T02:49:06.000Z:

What steps will reproduce the problem?

  1. Download google authentication pam code
  2. make
  3. Get an error about libdl being missing

What is the expected output? What do you see instead?

$ make
cc -g
-o google-authenticator google-authenticator.o base32.o hmac.o sha1.o
google-authenticator.o: In function displayQRCode': /data/src/stillhq_private/google-authenticator/libpam/google-authenticator.c:154: undefined reference todlopen'
/data/src/stillhq_private/google-authenticator/libpam/google-authenticator.c:166: undefined reference to dlsym' /data/src/stillhq_private/google-authenticator/libpam/google-authenticator.c:168: undefined reference todlsym'
/data/src/stillhq_private/google-authenticator/libpam/google-authenticator.c:253: undefined reference to dlclose' /data/src/stillhq_private/google-authenticator/libpam/google-authenticator.c:156: undefined reference todlopen'
collect2: ld returned 1 exit status
make: *** [google-authenticator] Error 1

What version of the product are you using? On what operating system?

Latest mercurial source, on Ubuntu Natty.

Please provide any additional information below.

libdl isn't where the makefile expects it to be. It is instead here:

mikal@molokai:/lib/x86_64-linux-gnu$ ls -l libdl*
-rw-r--r-- 1 root root 14696 2011-04-11 21:26 libdl-2.13.so
lrwxrwxrwx 1 root root 13 2011-05-01 16:52 libdl.so.2 -> libdl-2.13.so

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #1 originally posted by charles.lacroix on 2011-05-12T15:24:09.000Z:

I had same issue on centos 5.6

i modified the Makefile to point at the libdl in /usr/lib64/libdl.so


google-authenticator: google-authenticator.o base32.o hmac.o sha1.o
$(CC) -g $(LDFLAGS) $(shell [ -f /usr/lib64/libdl.so ] && echo " -ldl")
-o $@ $+

demo: demo.o pam_google_authenticator_demo.o base32.o hmac.o sha1.o
$(CC) -g $(LDFLAGS) -rdynamic
$(shell [ -f /usr/lib64/libdl.so ] && echo " -ldl") -o $@ $+

pam_google_authenticator_unittest: pam_google_authenticator_unittest.o
base32.o hmac.o sha1.o
$(CC) -g $(LDFLAGS) -rdynamic -lc
$(shell [ -f /usr/lib64/libdl.so ] && echo " -ldl") \

-o $@ $+

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #2 originally posted by chris.ritsen on 2011-05-31T15:48:19.000Z:

sudo find / -name libdl.so
/usr/lib/i386-linux-gnu/libdl.so
Find and replace /usr/lib/libdl.so with wherever you found libdl.so

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #3 originally posted by chris.ritsen on 2011-05-31T15:49:21.000Z:

find /usr/lib -name libdl.so
/usr/lib/i386-linux-gnu/libdl.so
Find and replace /usr/lib/libdl.so with wherever you found libdl.so

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #4 originally posted by chris.ritsen on 2011-05-31T15:50:28.000Z:

find /usr/lib -name libdl.so
Replace all instances in the Makefile in /libpam

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #5 originally posted by yeohayon on 2011-06-21T14:56:23.000Z:

Upgraded to Natty today, still had to do this procedure to compile with the latest git clone..

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #6 originally posted by tiran79 on 2011-10-12T00:27:46.000Z:

The bug is related to the new multiarch system introduced by recent Debian and Ubuntu builds. Architecture specific libraries have been moved to /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) or /lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH).

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #7 originally posted by jakob.p80 on 2011-11-20T18:03:33.000Z:

For me (on oneiric) linking against libdl (via -ldl) did not work alone - I had to change the ordering of the object files and linker flags. Seems to be due to the --as-needed option passed to ld per default.

Here the statement from http://wiki.debian.org/ToolChain/DSOLinking#Onlylinkwithneededlibraries
Object files, including .la files from a package build must appear before any library on the command line.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #8 originally posted by davide.piazza on 2011-11-28T22:59:26.000Z:

Hello Jabcob, I'm also triying to build on Oneiric 64 bit and have the same issue. Cold you please post the exact commands?
thanks a lot.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #9 originally posted by markus@google.com on 2011-12-15T08:54:13.000Z:

Issue 106 has been merged into this issue.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #10 originally posted by markus@google.com on 2011-12-15T08:57:58.000Z:

Issue 77 has been merged into this issue.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #11 originally posted by markus@google.com on 2011-12-15T08:58:39.000Z:

Issue 74 has been merged into this issue.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #12 originally posted by markus@google.com on 2011-12-15T08:58:52.000Z:

<empty>

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #13 originally posted by markus@google.com on 2011-12-16T01:00:31.000Z:

I believe this problem is now fixed in the head of tree. Please reopen this issue, if you still encounter difficulties building the PAM module.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #14 originally posted by luckyjcell on 2011-12-27T15:46:51.000Z:

Issue occurs on CentOS 5.7 with latest checkout of google-authenticator code.

@ThomasHabets

This comment has been minimized.

Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Oct 10, 2014

Comment #15 originally posted by markus@google.com on 2011-12-28T05:28:21.000Z:

Our old approach of trying to test for whether we need to pass the "-ldl" option by searching for "libdl.so" proved unreliable. So, instead, we now actually try passing this option to the compiler and see what happens. Hopefully, that'll be more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.