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

multiple definition in librand with parallel codegen #18243

Closed
msiemens opened this issue Oct 22, 2014 · 4 comments
Closed

multiple definition in librand with parallel codegen #18243

msiemens opened this issue Oct 22, 2014 · 4 comments
Labels
A-codegen Area: Code generation

Comments

@msiemens
Copy link
Contributor

When building rustc with parallel codegen, linking librand fails:

rustc: i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/librand
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.1.o:(.rdata+0x2c0): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::hc349c9a6706e0477dMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x410): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.1.o:(.rdata+0x310): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::hc349c9a6706e0477Mgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x460): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.2.o:(.rdata+0x190): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::hc349c9a6706e0477dMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x410): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.2.o:(.rdata+0x1e0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::hc349c9a6706e0477Mgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x460): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.3.o:(.rdata+0x2b50): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::hc349c9a6706e0477dMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x410): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.3.o:(.rdata+0x3bc0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::hc349c9a6706e0477Mgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x460): first defined here
collect2.exe: error: ld returned 1 exit status

I'm using Windows 7 x64 with MSYS2

@HeroesGrave
Copy link
Contributor

Also occurs on Arch Linux x86_64.

@emberian
Copy link
Member

emberian commented Dec 4, 2014

This doesn't reproduce anymore with pcwalton@c245c5b re-applied.

@msiemens
Copy link
Contributor Author

@cmr: I tried to re-apply the commit too, but it still fails, this time in lib\core:

i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.1.o:(.rdata+0x670): multiple definition of `iter::uint.Step::steps_between::_MSG_FILE_LINE::he1870d67ab684df6fMn'
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.0.o:(.rdata+0x200): first defined here
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.1.o:(.rdata+0x690): multiple definition of `iter::u8.Step::steps_between::_MSG_FILE_LINE::he1870d67ab684df6INn'
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.0.o:(.rdata+0x220): first defined here
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.1.o:(.rdata+0x6b0): multiple definition of `iter::u16.Step::steps_between::_MSG_FILE_LINE::he1870d67ab684df6bPn'
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.0.o:(.rdata+0x240): first defined here
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.1.o:(.rdata+0x6d0): multiple definition of `iter::u32.Step::steps_between::_MSG_FILE_LINE::he1870d67ab684df6EQn'
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.0.o:(.rdata+0x260): first defined here
i686-pc-windows-gnu\stage0\bin\rustlib\i686-pc-windows-gnu\lib\core-4e7c5e5c.1.o:(.rdata+0x6f0): multiple definition of `iter::int.Step::steps_between::_MSG_FILE_LINE::he1870d67ab684df67Rn'
... (and similar)

@alexcrichton
Copy link
Member

I believe this was fixed at some point in the meantime in one of @nrc's patches, so closing as likely fixed.

lnicola pushed a commit to lnicola/rust that referenced this issue Oct 22, 2024
…Veykril

Clamp Position::character to line length

LSP says about Position::character

> If the character value is greater than the line length it defaults back to the line length.

but from_proto::offset() doesn't implement this.

A client might for example request code actions for a whole line by sending
Position::character=99999.  I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.

Not sure how to update Cargo.lock (lib/README.md doesn't say how).

Fixes rust-lang#18240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

4 participants