-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
WIP: cc-wrapper: -nostdlib doessn't mean not C++ #85513
Conversation
This was introduced in 87607af, which made the wrapper aware of `-x <lang>` flags. I am not sure why this new case was added, especially with the `-l` that looks like a mistake. FWIW, https://github.com/briansmith/nostdlib is an example of writing C++ with -nosdlib.
I don't see the contradiction. "isCpp=-1" disables linking to the standard c++ libraries, you can write C++ code with |
Do those flags with GCC affect search paths? Right now we control some |
@Mic92 Might you have some insight here, since you just did the |
Maybe it could set a |
Well does |
It skip linking startup files, search paths are kept intact. The following builds: $ printf '#include <optional>\n extern \"C\" { void _start(){} }' | g++ -nostdlib -o foo -xc++ - |
Great, thanks for checking! I think that means this PR is correct, do you? |
I don't think it is a complete fix for it. Since the wrapper adds |
Oh right! Because we manually do e.g. |
I marked this as stale due to inactivity. → More info |
Fixed by #121527 |
Motivation for this change
This was introduced in 87607af, which
made the wrapper aware of
-x <lang>
flags. I am not sure why this newcase was added, especially with the
-l
that looks like a mistake.FWIW, https://github.com/briansmith/nostdlib is an example of writing C++
with -nosdlib.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)