Skip to content

Commit

Permalink
x11use: # try a> so库
Browse files Browse the repository at this point in the history
  • Loading branch information
sam#gemmi-win10 committed Nov 8, 2023
1 parent faf0561 commit d8cd2dd
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/t2-x11-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,47 @@ root@VM-12-9-ubuntu:/mnt/xrdp-repo-v0.9.23-02# ldd ./vnc/.libs/libvnc.so |sort



# try a> so库
# https://blog.csdn.net/wh617053508/article/details/133396789 ##cmd@PIC
# ar -crv libharfbuzz.a libharfbuzz.so #动转静态库
# gcc -shared -o libfoo.so libfoo.a #生成动态库

# gcc-x1
/tmp/xrdp/vnc/.libs # gcc -shared -o ss.so libvnc.a
/tmp/xrdp/vnc/.libs # ls -lh
total 108K
-rw-r--r-- 1 root root 43.5K Nov 8 17:38 libvnc.a
lrwxrwxrwx 1 root root 12 Nov 8 17:38 libvnc.la -> ../libvnc.la
-rw-r--r-- 1 root root 951 Nov 8 17:38 libvnc.lai
-rwxr-xr-x 1 root root 15.7K Nov 8 17:41 ss.so
-rw-r--r-- 1 root root 42.9K Nov 8 17:38 vnc.o
/tmp/xrdp/vnc/.libs # ldd ss.so
/lib/ld-musl-x86_64.so.1 (0x7f3638c6b000)

# clang
/tmp/xrdp/vnc/.libs # clang -shared -o ss.so libvnc.a
/tmp/xrdp/vnc/.libs # ls -lh
total 108K
-rw-r--r-- 1 root root 43.5K Nov 8 17:38 libvnc.a
lrwxrwxrwx 1 root root 12 Nov 8 17:38 libvnc.la -> ../libvnc.la
-rw-r--r-- 1 root root 951 Nov 8 17:38 libvnc.lai
-rwxr-xr-x 1 root root 15.7K Nov 8 17:43 ss.so
-rw-r--r-- 1 root root 42.9K Nov 8 17:38 vnc.o
/tmp/xrdp/vnc/.libs # ldd ss.so
/lib/ld-musl-x86_64.so.1 (0x7f158ecb4000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f158ecb4000)

root@VM-12-9-ubuntu:~# ldd /mnt/ss.so
linux-vdso.so.1 (0x00007ffdd9694000)
libc.musl-x86_64.so.1 => not found


# gcc-x2
/tmp/xrdp/vnc/.libs # gcc -shared -o ss.so libvnc.a
/tmp/xrdp/vnc/.libs # \cp ss.so /mnt2/

# statical!!
root@VM-12-9-ubuntu:~# ldd /mnt/ss.so
statically linked

```

0 comments on commit d8cd2dd

Please sign in to comment.