Skip to content

-Z lto requires system-level libraries to be writeable #13779

Closed
@kornelski

Description

@kornelski
rustc -Z lto test.rs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binaries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions