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 missing dl lib on armv5te-unknown-linux-uclibceabi #2005

Merged
merged 1 commit into from Jan 26, 2021

Conversation

operutka
Copy link
Contributor

I'm unable to link my executable for the Linux uClibc environment because of some missing symbols from the dl lib:

/home/operutka/goodcam/goodcam-server/target/armv5te-unknown-linux-uclibceabi/release/deps/goodcam_server-aefb92c403e8cd55.goodcam_server.dzc3futp-cgu.0.rcgu.o: In function `mio::sys::unix::dlsym::fetch::he5e2964820cfd29d':
      goodcam_server.dzc3futp-cgu.0:(.text._ZN3mio3sys4unix5dlsym5fetch17he5e2964820cfd29dE+0x30): undefined reference to `dlsym'
/home/operutka/goodcam/goodcam-server/target/armv5te-unknown-linux-uclibceabi/release/deps/goodcam_server-aefb92c403e8cd55.goodcam_server.dzc3futp-cgu.0.rcgu.o: In function `std::sys::unix::weak::fetch::h5ed4b0fa5792ef5c':
      goodcam_server.dzc3futp-cgu.0:(.text._ZN3std3sys4unix4weak5fetch17h5ed4b0fa5792ef5cE+0x3c): undefined reference to `dlsym'

The libc crate is being used at both of these points.

This change fixes the issue for me. I've tested it with two different GCC cross toolchains for armv5te and it seems to be OK.

Note: I'm building my own std using the unstable build-std Cargo feature.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@operutka
Copy link
Contributor Author

... I'm not sure why the freebsd test failed. I believe I haven't changed anything that would affect this target.

@JohnTitor
Copy link
Member

Seems reasonable to me but I'd r? @joshtriplett as they're more familiar with this than me, I think (it's on the holiday season and the review may be delayed).

... I'm not sure why the freebsd test failed. I believe I haven't changed anything that would affect this target.

Because you're on the old branch and CI stuff is outdated. That failure should be resolved when testing on bors.

@joshtriplett
Copy link
Member

Does uclibc actually have its own libutil, libdl, and similar?

@operutka
Copy link
Contributor Author

operutka commented Jan 4, 2021

@joshtriplett I believe it does. See:

-rw-r--r--. 1 operutka operutka  1,8K 25. lis 14.21 crt1.o
-rw-r--r--. 1 operutka operutka  2,5K 25. lis 14.21 crti.o
-rw-r--r--. 1 operutka operutka  2,0K 25. lis 14.21 crtn.o
drwxr-xr-x. 3 operutka operutka  4,0K 25. lis 14.20 gcc
drwxr-xr-x. 2 operutka operutka  4,0K 25. lis 14.12 ldscripts
-rwxr-xr-x. 1 operutka operutka  111K 25. lis 14.21 ld-uClibc-0.9.33.2.so
lrwxrwxrwx. 1 operutka operutka    21 25. lis 14.20 ld-uClibc.so.0 -> ld-uClibc-0.9.33.2.so
lrwxrwxrwx. 1 operutka operutka     3 25. lis 14.20 lib -> lib
-rw-r--r--. 1 operutka operutka   63K 25. lis 14.25 libatomic.a
-rwxr-xr-x. 1 operutka operutka  1,1K 25. lis 14.25 libatomic.la
lrwxrwxrwx. 1 operutka operutka    18 25. lis 14.25 libatomic.so -> libatomic.so.1.0.0
lrwxrwxrwx. 1 operutka operutka    18 25. lis 14.25 libatomic.so.1 -> libatomic.so.1.0.0
-rwxr-xr-x. 1 operutka operutka   25K 25. lis 14.25 libatomic.so.1.0.0
-rw-r--r--. 1 operutka operutka  6,1M 25. lis 14.21 libc.a
lrwxrwxrwx. 1 operutka operutka     6 25. lis 14.21 libc_pic.a -> libc.a
-rwxr-xr-x. 1 operutka operutka   40K 25. lis 14.21 libcrypt-0.9.33.2.so
-rw-r--r--. 1 operutka operutka   54K 25. lis 14.21 libcrypt.a
lrwxrwxrwx. 1 operutka operutka    10 25. lis 14.21 libcrypt_pic.a -> libcrypt.a
lrwxrwxrwx. 1 operutka operutka    13 25. lis 14.21 libcrypt.so -> libcrypt.so.0
lrwxrwxrwx. 1 operutka operutka    20 25. lis 14.20 libcrypt.so.0 -> libcrypt-0.9.33.2.so
-rwxr-xr-x. 1 operutka operutka   269 25. lis 14.21 libc.so
lrwxrwxrwx. 1 operutka operutka    21 25. lis 14.20 libc.so.0 -> libuClibc-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  6,1M 25. lis 14.20 libc_so.a
-rwxr-xr-x. 1 operutka operutka   38K 25. lis 14.21 libdl-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  134K 25. lis 14.21 libdl.a
lrwxrwxrwx. 1 operutka operutka     7 25. lis 14.21 libdl_pic.a -> libdl.a
lrwxrwxrwx. 1 operutka operutka    10 25. lis 14.21 libdl.so -> libdl.so.0
lrwxrwxrwx. 1 operutka operutka    17 25. lis 14.20 libdl.so.0 -> libdl-0.9.33.2.so
-rw-r--r--. 1 operutka operutka   132 25. lis 14.25 libgcc_s.so
-rw-r--r--. 1 operutka operutka  227K 25. lis 14.25 libgcc_s.so.1
-rw-r--r--. 1 operutka operutka  161K 25. lis 14.25 libitm.a
-rwxr-xr-x. 1 operutka operutka  1,1K 25. lis 14.25 libitm.la
lrwxrwxrwx. 1 operutka operutka    15 25. lis 14.25 libitm.so -> libitm.so.1.0.0
lrwxrwxrwx. 1 operutka operutka    15 25. lis 14.25 libitm.so.1 -> libitm.so.1.0.0
-rwxr-xr-x. 1 operutka operutka  144K 25. lis 14.25 libitm.so.1.0.0
-rw-r--r--. 1 operutka operutka   162 25. lis 14.25 libitm.spec
-rwxr-xr-x. 1 operutka operutka  240K 25. lis 14.21 libm-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  610K 25. lis 14.21 libm.a
lrwxrwxrwx. 1 operutka operutka     6 25. lis 14.21 libm_pic.a -> libm.a
lrwxrwxrwx. 1 operutka operutka     9 25. lis 14.21 libm.so -> libm.so.0
lrwxrwxrwx. 1 operutka operutka    16 25. lis 14.20 libm.so.0 -> libm-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  2,9K 25. lis 14.21 libnsl.a
lrwxrwxrwx. 1 operutka operutka     8 25. lis 14.21 libnsl_pic.a -> libnsl.a
-rwxr-xr-x. 1 operutka operutka  642K 25. lis 14.21 libpthread-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  1,4M 25. lis 14.21 libpthread.a
-rw-r--r--. 1 operutka operutka  4,6K 25. lis 14.21 libpthread_nonshared.a
lrwxrwxrwx. 1 operutka operutka    22 25. lis 14.21 libpthread_nonshared_pic.a -> libpthread_nonshared.a
lrwxrwxrwx. 1 operutka operutka    12 25. lis 14.21 libpthread_pic.a -> libpthread.a
-rwxr-xr-x. 1 operutka operutka   175 25. lis 14.21 libpthread.so
lrwxrwxrwx. 1 operutka operutka    22 25. lis 14.20 libpthread.so.0 -> libpthread-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  1,4M 25. lis 14.20 libpthread_so.a
-rw-r--r--. 1 operutka operutka  2,9K 25. lis 14.21 libresolv.a
lrwxrwxrwx. 1 operutka operutka    11 25. lis 14.21 libresolv_pic.a -> libresolv.a
-rwxr-xr-x. 1 operutka operutka   80K 25. lis 14.21 librt-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  147K 25. lis 14.21 librt.a
lrwxrwxrwx. 1 operutka operutka     7 25. lis 14.21 librt_pic.a -> librt.a
lrwxrwxrwx. 1 operutka operutka    10 25. lis 14.21 librt.so -> librt.so.0
lrwxrwxrwx. 1 operutka operutka    17 25. lis 14.20 librt.so.0 -> librt-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  2,7M 25. lis 14.25 libstdc++.a
-rwxr-xr-x. 1 operutka operutka  1,1K 25. lis 14.25 libstdc++.la
lrwxrwxrwx. 1 operutka operutka    19 25. lis 14.25 libstdc++.so -> libstdc++.so.6.0.19
lrwxrwxrwx. 1 operutka operutka    19 25. lis 14.25 libstdc++.so.6 -> libstdc++.so.6.0.19
-rwxr-xr-x. 1 operutka operutka 1023K 25. lis 14.25 libstdc++.so.6.0.19
-rw-r--r--. 1 operutka operutka  2,5K 25. lis 14.25 libstdc++.so.6.0.19-gdb.py
-rw-r--r--. 1 operutka operutka  267K 25. lis 14.25 libsupc++.a
-rwxr-xr-x. 1 operutka operutka   997 25. lis 14.25 libsupc++.la
-rwxr-xr-x. 1 operutka operutka  165K 25. lis 14.21 libthread_db-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  434K 25. lis 14.21 libthread_db.a
lrwxrwxrwx. 1 operutka operutka    14 25. lis 14.21 libthread_db_pic.a -> libthread_db.a
lrwxrwxrwx. 1 operutka operutka    17 25. lis 14.21 libthread_db.so -> libthread_db.so.1
lrwxrwxrwx. 1 operutka operutka    24 25. lis 14.20 libthread_db.so.1 -> libthread_db-0.9.33.2.so
-rwxr-xr-x. 1 operutka operutka  2,5M 25. lis 14.21 libuClibc-0.9.33.2.so
-rwxr-xr-x. 1 operutka operutka   19K 25. lis 14.21 libutil-0.9.33.2.so
-rw-r--r--. 1 operutka operutka   33K 25. lis 14.21 libutil.a
lrwxrwxrwx. 1 operutka operutka     9 25. lis 14.21 libutil_pic.a -> libutil.a
lrwxrwxrwx. 1 operutka operutka    12 25. lis 14.21 libutil.so -> libutil.so.0
lrwxrwxrwx. 1 operutka operutka    19 25. lis 14.20 libutil.so.0 -> libutil-0.9.33.2.so
-rw-r--r--. 1 operutka operutka  1,9K 25. lis 14.21 Scrt1.o
-rw-r--r--. 1 operutka operutka   24K 25. lis 14.21 uclibc_nonshared.a

It's a list of files within the /lib directory of my cross toolchain. All the libs are standalone (i.e. they are not just symlinks to libuClibc-0.9.33.2.so).

@JohnTitor
Copy link
Member

@joshtriplett Does it look good to you?

@operutka
Copy link
Contributor Author

Any progress here?

@Amanieu
Copy link
Member

Amanieu commented Jan 26, 2021

I think this PR is fine. All uclibc targets are tier 3 so we're really just ensuring that it doesn't break tier 1/2 targets.

@bors r+

@bors
Copy link
Contributor

bors commented Jan 26, 2021

📌 Commit 6df758a has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Jan 26, 2021

🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened.

@JohnTitor
Copy link
Member

@bors treeclosed-

@bors
Copy link
Contributor

bors commented Jan 26, 2021

⌛ Testing commit 6df758a with merge 50adb91...

@bors
Copy link
Contributor

bors commented Jan 26, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: Amanieu
Pushing 50adb91 to master...

@bors bors merged commit 50adb91 into rust-lang:master Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants