You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: ar d /var/folders/93/w4lcsnb97rgc2yvyltl1vt7r0000gp/T/rs-97669-0-rustc/libnative-83574243-0.11-pre.rlib native.o failed with: exit code: 1
note: stderr ---
ar: /var/folders/93/w4lcsnb97rgc2yvyltl1vt7r0000gp/T/rs-97669-0-rustc/libnative-83574243-0.11-pre.rlib: Permission denied
The permissions of folders are OK:
drwx------ 49 me me 1.6K Apr 26 15:29 /var/folders/93/w4lcsnb97rgc2yvyltl1vt7r0000gp/T
drwxr-xr-x 2 me me 68B Apr 26 15:23 /var/folders/93/w4lcsnb97rgc2yvyltl1vt7r0000gp/T/rs-97636-0-rustc/
The problem seems to be caused by /usr/local/Cellar/rust/HEAD/lib/rustlib/x86_64-apple-darwin/lib/lib*.rlib being read-only.
If I chmod a+w all *.rlib in /usr/local/, then -Z lto works.
rustc 0.11-pre, host: x86_64-apple-darwin
The text was updated successfully, but these errors were encountered:
kornelski
changed the title
ar d fails when using -Z lto on OS X
-Z lto requires system-level libraries to be writeable
Apr 26, 2014
a+w permissions are broader than necessary. The rlibs only need to be writable by the file owner for LTO to succeed.
My theory is that when rustc copies the rlibs to a temporary directory, it does not set the appropriate permissions on the copy. Instead, the permissions of the original are used.
The original issue is quite old and I think I can't reproduce, but I'm not quite sure what files I specifically need to mark as read-only, so can't be certain. Going to close since I can't reproduce. Please reopen if this is still an issue.
The permissions of folders are OK:
The problem seems to be caused by
/usr/local/Cellar/rust/HEAD/lib/rustlib/x86_64-apple-darwin/lib/lib*.rlib
being read-only.If I
chmod a+w
all*.rlib
in/usr/local/
, then-Z lto
works.rustc 0.11-pre, host: x86_64-apple-darwin
The text was updated successfully, but these errors were encountered: