Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@namachan10777
Copy link
Contributor

@namachan10777 namachan10777 commented Apr 15, 2020

Error

FROM ubuntu:18.04

RUN apt-get update && \
	apt-get install -y cargo git
RUN git clone https://coord-e/magicpak
WORKDIR magicpak
RUN git checkout 919a2be14
RUN cargo build --release
RUN target/release/magicpak /bin/bash bundle/
Sending build context to Docker daemon   2.56kB

Step 1/7 : FROM ubuntu:18.04
 ---> 4e5021d210f6
Step 2/7 : RUN apt-get update && 	apt-get install -y cargo git
 ---> Using cache
 ---> 6ccc575204e8
Step 3/7 : RUN git clone https://github.com/coord-e/magicpak
 ---> Using cache
 ---> 6a27484cbb79
Step 4/7 : WORKDIR magicpak
 ---> Using cache
 ---> d609c551ca44
Step 5/7 : RUN git checkout 919a2be14
 ---> Using cache
 ---> a1db8725179b
Step 6/7 : RUN cargo build --release
 ---> Using cache
 ---> a42dfc87e265
Step 7/7 : RUN target/release/magicpak /bin/bash bundle/
 ---> Running in f640ab3ca8be
[ERROR] error: Error happend during the compilation of library resolver: /tmp/cc0s2LdF.o: In function `main':
.tmp85KlQR:(.text+0x38): undefined reference to `dlopen'
.tmp85KlQR:(.text+0x4f): undefined reference to `dlerror'
.tmp85KlQR:(.text+0x76): undefined reference to `dlinfo'
.tmp85KlQR:(.text+0x86): undefined reference to `dlerror'
.tmp85KlQR:(.text+0xb4): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status

Solution

Current code (919a2be14) is executing cc with flags -Wl,-dynamic-linker,<ld path> -o <output> -xc <source>. I reordered this flags as -xc <source> -Wl,-dynamic-linker,<ld path> -o <output> to prevent above error. However, I couldn't figure out why this problem caused, sorry.

@namachan10777 namachan10777 marked this pull request as ready for review April 15, 2020 18:22
@coord-e
Copy link
Owner

coord-e commented Apr 15, 2020

I think the cause was -ldl placed before the source file path. Thanks!

@coord-e coord-e merged commit 3501b22 into coord-e:develop Apr 15, 2020
coord-e added a commit that referenced this pull request May 5, 2020
Fixed the order of `-ldl` option in resolver compilation. (#1, thanks @namachan10777)
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.

2 participants