Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lto-smoke test fails due to multiple definition of 'rust_swap_registers' #12322

Closed
rcxdude opened this issue Feb 16, 2014 · 1 comment
Closed

Comments

@rcxdude
Copy link
Contributor

rcxdude commented Feb 16, 2014

attempting 'make check' produces the following error on my machine with GCC 4.8.2 and revision 3f717bb

----- /home/rcxdude/projects/rust/rust/src/test/run-make/lto-smoke/ --------------------
------ stdout ---------------------------------------------
make[1]: Entering directory '/mnt/data/data/rcxdude/projects/rust/rust/src/test/run-make/lto-smoke'
/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir /mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke -L /mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke lib.rs
/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir /mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke -L /mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke main.rs -Z lto
Makefile:4: recipe for target 'all' failed
make[1]: Leaving directory '/mnt/data/data/rcxdude/projects/rust/rust/src/test/run-make/lto-smoke'

------ stderr ---------------------------------------------
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-o' '/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/main' '/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/main.o' '-nodefaultlibs' '-Wl,--as-needed' '-lmorestack' '-lcompiler-rt' '-L/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke' '-L/mnt/data/data/rcxdude/projects/rust/rust/src/test/run-make/lto-smoke/.rust' '-L/mnt/data/data/rcxdude/projects/rust/rust/src/test/run-make/lto-smoke' '/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/oCXP4WUfM3WdYs3Orustc/libstd-966edb7e-0.10-pre.rlib' '/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/oCXP4WUfM3WdYs3Orustc/libgreen-80d9e76a-0.10-pre.rlib' '/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/oCXP4WUfM3WdYs3Orustc/librustuv-09e0b925-0.10-pre.rlib' '-lc' '-ldl' '-lm' '-lpthread' '-lgcc_s' '-lpthread' '-lrt' '-Wl,-rpath,$ORIGIN/../../../stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib'
note: /mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/oCXP4WUfM3WdYs3Orustc/libgreen-80d9e76a-0.10-pre.rlib(r-context_switch-_context.o): In function `rust_swap_registers':
(.text+0x0): multiple definition of `rust_swap_registers'
/mnt/data/data/rcxdude/projects/rust/rust/x86_64-unknown-linux-gnu/test/run-make/lto-smoke/oCXP4WUfM3WdYs3Orustc/libstd-966edb7e-0.10-pre.rlib(r-rustrt-_context.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status

error: aborting due to previous error
make[1]: *** [all] Error 101

------        ---------------------------------------------
@alexcrichton
Copy link
Member

Closing, looks like a make clean is in order. The librustrt.a library should no longer contain a file called _context.o.

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
…nment, r=flodiebold

feat: implement destructuring assignment

This is an attempt to implement destructuring assignments, or more specifically, type inference for [assignee expressions](https://doc.rust-lang.org/reference/expressions.html#place-expressions-and-value-expressions).

I'm not sure if this is the right approach, so I don't even expect this to be merged (hence the branch name 😉) but rather want to propose one direction we could choose. I don't mind getting merged if this is good enough though!

Some notes on the implementation choices:

- Assignee expressions are **not** desugared on HIR level unlike rustc, but are inferred directly along with other expressions. This matches the processing of other syntaxes that are desugared in rustc but not in r-a. I find this reasonable because r-a only needs to infer types and it's easier to relate AST nodes and HIR nodes, so I followed it.
- Assignee expressions obviously resemble patterns, so type inference for each kind of pattern and its corresponding assignee expressions share a significant amount of logic. I tried to reuse the type inference functions for patterns by introducing `PatLike` trait which generalizes assignee expressions and patterns.
  - This is not the most elegant solution I suspect (and I really don't like the name of the trait!), but it's cleaner and the change is smaller than other ways I experimented, like making the functions generic without such trait, or making them take `Either<ExprId, PatId>` in place of `PatId`.

in case this is merged:
Closes rust-lang#11532
Closes rust-lang#11839
Closes rust-lang#12322
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 26, 2024
…llogiq

Be careful with expressions with attributes

Fix rust-lang#9949.

changelog: [`unused_unit`]: skip expressions with attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants