Skip to content

Configure not detecting compiler. #11648

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

Closed
zackp30 opened this issue Jan 18, 2014 · 3 comments
Closed

Configure not detecting compiler. #11648

zackp30 opened this issue Jan 18, 2014 · 3 comments

Comments

@zackp30
Copy link

zackp30 commented Jan 18, 2014

On attempting to compile latest git version:
Output of ./configure:

checking for i686-unknown-linux-gnu-clang... gcc -m32  
checking for C compiler default output file name... configure: error: C compiler cannot create executables

Output is the same with --disable-clang.

Output of uname -a:

Linux matrix 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
@alexcrichton
Copy link
Member

Have you tried compiling a simple program to make sure it works? Something like gcc -m32 foo.c && ./a.out

@zackp30
Copy link
Author

zackp30 commented Jan 18, 2014

-m32 does not work, complains about
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file
or directory
however, without the -m32 switch it works fine.

Have you tried compiling a simple program to make sure it works? Something
like gcc -m32 foo.c && ./a.out


Reply to this email directly or view it on
GitHubhttps://github.com//issues/11648#issuecomment-32689219
.

@alexcrichton
Copy link
Member

Closing, it sounds like you need to install the 32-bit compiler libraries and headers for your system. I think that on ubuntu you can find this in the gcc-multilib package.

You can also not configure a cross compiler by just running ./configure with no extra --target or --host flags.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 11, 2024
…archo

[`unnecessary_to_owned`]: catch `to_owned` on byte slice to create temporary `&str`

Closes rust-lang#11648

Detects the pattern `&String::from_utf8(bytes.to_vec()).unwrap()` and suggests `core::str::from_utf8(bytes).unwrap()`, which avoids the unnecessary intermediate allocation.

I decided to put this in the existing `unnecessary_to_owned` lint (rather than creating a new lint) for a few reasons:
- we get to use some of its logic (for example, recognizing any of the functions in the `to_owned` family, e.g. `to_vec`)
- the actual inefficient operation that can be avoided here is the call to `.to_vec()`, so this is in a way similar to the other cases caught by `unnecessary_to_owned`, just through a bunch of type conversions
- we can make this more "generic" later and catch other cases, so imo it's best not to tie this lint specifically to the `String` type

changelog: [`unnecessary_to_owned`]: catch `&String::from_utf8(bytes.to_vec()).unwrap()` and suggest `core::str::from_utf8(bytes).unwrap()`
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