-
Notifications
You must be signed in to change notification settings - Fork 463
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
Two source files with same name, different extension generate same object file name #1294
Comments
Yeah that's problematic. We could solve this two ways:
|
I think adding extension to the hash is the right solution.
Primary reason is for parallel compilation. Also some people depends on it (extract the file from archive or uses |
Doesn't Clang/GCC handle this internally themselves? I just mean, having one process that loads and shares all the header files has bound to be faster than 10 processes doing that? |
No, AFAIK clang/gcc is single-thread.
Well that depends, if a header is large enough and reused multiple times, pre-compiling it to gcc/clang internal format would speed that up (and is supported). In cc-rs, we compile the source files in parallel ( |
Ah, okay, thanks for the explanation! |
No worries. BTW rustc is also designed in the same way originally, but recently rustc adds in multithreading to speedup compilation since the compile unit in rust is crate, whilst in c/c++ it's file. The c/c++ model actually scales better despite it creates multiple processes (would be great if they can do multithreading), but with C++ module things are getting more complex. https://stackoverflow.com/questions/33307657/how-do-i-use-c-modules-in-clang and c++ module might be more expensive to compile as well |
Hi,
When building a project that has 2 sibling files with same name but different extension, they both result in the same filename for the object file. In my case:
produces two
rv003usb.o
files, with the latter overwriting the former. Thus, the resulting build either fails or is missing some symbols. I traced this to this line:cc-rs/src/command_helpers.rs
Lines 330 to 332 in 29d6ca1
The text was updated successfully, but these errors were encountered: