blob: f3292cc1ce06eca19171d1feed218d6130a4d08a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
architecture: 0.966
graphic: 0.910
user-level: 0.909
performance: 0.889
permissions: 0.885
files: 0.856
device: 0.822
risc-v: 0.798
network: 0.784
hypervisor: 0.782
ppc: 0.764
PID: 0.753
kernel: 0.740
peripherals: 0.730
vnc: 0.723
x86: 0.716
socket: 0.668
VMM: 0.666
KVM: 0.656
i386: 0.655
TCG: 0.644
semantic: 0.641
arm: 0.634
boot: 0.565
mistranslation: 0.538
debug: 0.510
assembly: 0.498
register: 0.474
virtual: 0.307
--------------------
user-level: 0.965
hypervisor: 0.843
debug: 0.485
TCG: 0.207
files: 0.122
arm: 0.097
kernel: 0.090
virtual: 0.050
register: 0.036
PID: 0.023
architecture: 0.012
semantic: 0.010
device: 0.009
ppc: 0.007
performance: 0.006
VMM: 0.006
network: 0.005
boot: 0.004
assembly: 0.004
socket: 0.003
risc-v: 0.003
x86: 0.003
KVM: 0.003
peripherals: 0.003
permissions: 0.002
graphic: 0.002
i386: 0.001
vnc: 0.001
mistranslation: 0.001
LC_RPATH stripped despite setting INSTALL_REMOVE_ENVIRONMENT_RPATH=FALSE
Description of problem:
When I try to run qemu, I get the following output:
> dyld[93165]: Library not loaded: @rpath/libjpeg.62.dylib
> Referenced from: <85BC1FBA-CA2E-3CAC-9ABF-E5330AC86CAF> /Users/mj/local/bin/qemu-system-aarch64
> Reason: no LC_RPATH's found
Steps to reproduce:
If the qemu-9.0.2 folder is present, remove it:
```
$ rm -rf qemu-9.0.2
```
Create the source folder:
```
$ tar xzf qemu-9.0.2.tar.xz
$ cd qemu-9.0.2
```
Make sure the following environment variables are set:
```
$ export CC=clang
$ export LDFLAGS="-rpath $HOME/local/lib"
$ export INSTALL_REMOVE_ENVIRONMENT_RPATH=FALSE
```
Configure as follows:
```
$ ./configure --prefix=$HOME/local --disable-sdl --enable-slirp --enable-fdt=internal --enable-spice
```
Build
```
$ make -j 10
```
Note there are a large number of linker warnings like this:
> ld: warning: duplicate -rpath '/Users/mj/local/lib' ignored
Execute this:
```
$ otool -l build/qemu-system-aarch64 | grep LC_RPATH -A2
```
See this output
> cmd LC_RPATH
> cmdsize 32
> path /Users/mj/local/lib (offset 12)
Change directory to $HOME/local/bin & execute:
```
$ otool -l qemu-system-aarch64 | grep LC_RPATH -A2
```
The output is now empty - the LC_RPATH has been stripped by the install. This results in the failure to execute the resulting binary. Note, I tried using install_name_tool to add the RPATH, but it warned me this changed the signature of the file, and it would not run.
Executing qemu-system-aarch64 produces the following:
> dyld[93165]: Library not loaded: @rpath/libjpeg.62.dylib
> Referenced from: <85BC1FBA-CA2E-3CAC-9ABF-E5330AC86CAF> /Users/mj/local/bin/qemu-system-aarch64
> Reason: no LC_RPATH's found
|