Skip to content

gcc's lto breaks rust's jemalloc/llvm interfaces #30178

Closed
@MagaTailor

Description

@MagaTailor

As an experiment I had -flto in my CFLAGS while building rustc which didn't cause any problems.
(Dec 2 nightly, i686-linux, gcc 4.9.3, local llvm 3.6)

It seems the compiler is fully functional but still I'm getting segfaults like this (in other build commands too):

 Compiling gl v0.0.12
failed to run custom build command for `gl v0.0.12`
Process didn't exit successfully: `/home/petevine/unpacked/rust-snake-master/target/release/build/gl-a90cb7fe89544061/build-script-build` (signal: 11)

Program received signal SIGSEGV, Segmentation fault.
0x8007d629 in je_mallocx ()
(gdb) bt
#0  0x8007d629 in je_mallocx ()
#1  0x800890f6 in __rust_allocate ()
#2  0x00000000 in ?? ()

If it's not a good idea to use lto flags at build-time, configure should definitely filter them out or at least warn the user.

EDIT:
This issue is not about artifacts as it can be reproduced with empty .cargo and fresh project directories.

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